I’ve been tracking discussions about the Scala language and listening with interest to people’s early experiences of using it on projects since the beginning of this year (2012). Based on what I’ve heard, including the advocacy of several highly respected technical folks in the Java community that I follow, I recently decided to invest some time learning the language.
So, why should an experienced Java developer invest time and effort learning Scala? In addition to the general language improvements it offers over Java (7) today, the key points that convinced me were:
- Tight interoperability with Java – The fact that Scala runs on the JVM and that Scala programs are able to invoke Java code and vice-versa means that you can continue to leverage the best-of-breed Java frameworks and libraries you’ve already invested time in learning and have experience of using, whilst benefiting from the language improvements.
- First-class language support for functional programming on the JVM, today – I’m keen to gain more experience of functional programming beyond what’s possible today with Java 7 and add-on libraries, and the foreseeable future (given the current schedule for Java 8).
- Continued support for OOP – The fact that Scala is a hybrid object-oriented and functional programming language lowers the barrier to learning the language when compared to languages which are 100% functional.
I’ve started by downloading the latest GA version of Scala (2.9) and completing the ‘First Steps to Scala’ tutorial by Bill Venners, Martin Odersky, et al. The tutorial is a few years old now, but I found it a quick and easy way to get started, covering all the basics and some.
I like what I’ve seen so far, so I’ve moved on to reading Scala for the Impatient by Cay Horstmann. I plan to publish my answers to the exercises at the end of each chapter of the book using Git – see my public projects on BitBucket.