I recently decided to take a swing at learning Scala. The following summarizes why I found the language interesting enough to look at and some excellent learning resources.
Why scala?
- Type inference. When the type for an element is obvious, the Scala compiler is able to automatically make the inference. No need for any additional type annotations. Less typing is great (pun intended).
- Strong Static typing. As fun as dynamic typing can be, I'm sick of running into type mismatch related bugs in rails. Coupled with inference, you can catch the bugs early with the compiler and write less code.
- Flexible approach to immutability. Mutable & immutable variants of all collections conveniently provided. Bootstrap your way to functional programming.
- Higher order functions. Allows the definition of functions that take other functions as input. Makes for very concise and expressive code.
- Multiple inheritance. Sort of. With traits.
- Pattern matching. Case statements on steroids. See here for some neat example applications.
- A JVM language. Can interoperate with Java libraries easily.
- Increasing enterprise adoption. Twitter, LinkedIn and Foursquare(to name a few) make active use of Scala. It's been claimed to be an active ingredient in the secret sauce that helps them scale.
Scalatron
I find the premise here brilliant. Scalatron teaches you Scala while you program the AI to compete in a virtual arena game. Play against the computer or other people's bots as you level up your Scala skills.
Coursera
Scala School
Learn in small bites
I ran across this blog and was impressed by the clear and concise nature of the examples provided. Each well-commented "bite" demonstrates a different facet of Scala.
References
The Scala API
http://www.scala-lang.org/api/current/index.html#package |
Effective Scala
The unofficial "best practices" guide for Scala. Definitely worth a look once you've gone over the basics.
Wish me luck as I learn! What has your experience with Scala been? What resources do you rely on for reference and learning?
No comments:
Post a Comment