Scala is more complex than Java? Think again…

Scala

I’ve read yet another blog saying in so many words the same thing: Scala is just more complex than Java.

Enough has been written about it but I just want to mention two trivia facts that I always bring about when I speak about GridGain and Scala:

  • Scala has less “reserved words & symbols” than Java. Actually, almost 20% less (!)
    (make sure to count symbols as well in both languages)

  • Scala has only… 6 control structures. Yes – only 6 and here they are:
    • if
    • for
    • while
    • try
    • match
    • function call



    That’s it.

Point 2 usually sets people off. “How come?” – they ask. With all the perceived “complexity” and everything – we actually have the language that has less keywords than Java and only 6 control structures…

The reason is actually “hidden” in the name itself. Scala stands for Scalable Language and it shows clearly in how Scala the language can scale from very simple core to a language with one of the most advanced features today.

So, the language is not complex. Changing the way you think about algorithms – may take a while but it will be so much worth it.

9 responses

  1. The reason for that is, most of what is a “language keyword” in Java can be implemented in a library in Scala, which makes it more adaptable.

  2. Lot of words in Java are reserved ‘just in case’ and are not actually used in specification. And Brainfuck language have also very simple specification…

    But I would agree that Scala is less complex then Java, after about 1 year of mastering.

  3. I totally can’t agree with the so-called ‘measurement factors’ mentioned here, which is used to compare the complexity between java & scala.

    Comes to the ‘complexity’, different people has different points of view. But, basically, it may be related to learning curve (the quantity of keywords doesn’t give much burden to beginners, but the background and programming experience are counted on.), programming paradigm & learning material, etc.

  4. Guys,
    I did mention that it was just a “trivia” facts… I, of course, had not intention to rehash old same old discussion on Scala being “complex”.

    You take it all too seriously.

    Best,
    Nikita.

  5. Pingback: Scala: Easier to read (and write), harder to understand? « Schneide Blog

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: