Continuing My Scala Adventure

Following up on my previous post, I’m beginning to like Scala more and more. This post summarizes some interesting things I discovered while reading the free Open Feedback Publishing System book from O’Reilly, Programming Scala by Dean Wampler and Alex Payne. Kudos to O’Reilly Media Inc. for the OFPS venture, so we can read and evaluate good books for free!

Coming back to Scala, here are some bits and pieces I’ve picked up from the first chapter of the book mentioned above, that I think are very interesting and useful. The book promotes installing the JDK version of Scala from the language’s official Website, which I caved in and did, despite having installed (and been happy with) the Scala IDE and its Worksheets. I created separate directories for working with the IDE and working with the command line. At this point I am really hoping I don’t have redundant Scala stuff installed on my computer. So here goes —

[1] Scala sbt, the tool I mentioned in my previous post, happens to be a build tool just like Ant or Maven for Java

[2] Some of the main reasons why people should pick up Scala are outlined in the first chapter, namely succinctness, static typing (despite the long standing debate about statically typed versus dynamically typed languages, mostly we all know that static languages are easier to optimize for performance because the types are known in advance), running on the JVM (since the JVM continues to enjoy awesome performance optimizations and allows existing Java classes and libraries to be used with new Scala code)

[3] Scala is very flexible to use since it combines object oriented programming with functional programming, so that programmers can use the best of both worlds

[4] Scala, despite being statically typed, feels and reads a lot like succinct dynamic languages such as Python and Ruby, which is definitely another attractive factor

[5] In Scala certain things are really easy, e.g. creating a Singleton is as simple as writing object instead of class, and Scala takes care of the rest and makes sure that there will only ever be a single instance of the class

[6] Concurrency is apparently done very well in Scala. The concurrency model in Java is error prone; but in Scala, just because there are no shared mutable states, there is no need to synchronize any states like that, which yields much cleaner and simpler concurrent code. It is modeled after the Actor concurrency model in Erlang, which translates to a bunch of software entities with no shared state information, communicating by exchanging messages. I really need to wrap my head around this thing.

So, off to learning some concurrency!

Advertisements

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