Scala like Perl?

These days really many people (in the software development world) are fascinated by Scala. And on the other hand it’s practically impossible to find someone feeling similar about Perl. This is somehow surprising for me as I see similarities between these 2 programming languages. I think one of these similarities is rather unquestionable:

implicit parameters/variables

These are nasty things causing variables coming from nowhere with values silently assigned. Somewhere. In Scala these are called “implicit parameters”. In Perl these are “special variables”.

As far as I know there are no such things in Pascal, C, C++, Java or JavaScript. So you don’t need to study these languages hard to read source of programs written in them. That’s not true in case of Scala or Perl. You need to know these hellish language features to get an idea how the program works. Nice? Cool? Shorter? Unreadable? Expressive? Modern? Shitty?

Well, I don’t like it. And I don’t understand why people do accept one language having such things (Scala) but not the other one (Perl). I’ve found many comments about Scala that it’s modern and fresh. Each time I hear that I think it’s just trendy to use Scala. However “trendy” is something belonging to the world of fashion, not to the world of engineers. On the other hand people often find Perl as programming language hard to read. I guess thanks to these default variables (but maybe I’m wrong).

In that one I would agree: programs written in Scala and in Perl are unreadable (my opinion). And hard to maintain. Or at least it’s really easy to write programs in these languages that way. Such that it’s really unfeasible to fix a bug in such a program for someone not being Scala/Perl fanatic.

Actually I would say Perl has some advantages over Scala. It doesn’t need a JVM. It’s fast. It’s portable. It’s available almost everywhere (in the world of professional IT servers are driven by Unix/Linux which almost always has Perl installed). And Perl has one big disadvantage: it cannot easily use Java frameworks or libraries (what Scala can).

I had to use Scala for integration tests for one project I was working on in 2015. These implicit parameters were my nightmare. So in the huge mass of enthusiastic opinions about Scala I’m really happy there exist others who can take a critical look on it – see the article I Don’t Like Scala by Bozho.

PS. Perl has one funny application of “special variables”. They’re crucial in “Perl golf”!

About krzysztoftomaszewski

I've got M.Sc. in software engineering. I graduated in 2005 at Institute of Computer Science, Warsaw University of Technology, Faculty of Electronics and Information Technology. I'm working on computer software design and engineering continuously since 2004.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

1 Response to Scala like Perl?

  1. Jamie Elliott says:

    hello!,I really like your writing very so much! share we keep in touch more approximately your post on AOL? I require an expert on this area to solve my problem. Maybe that’s you! Having a look ahead to peer you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s