Scala continues to make news with two more tutorial series, one by Ted Neward at IBM’s developerWorks and one by Daniel Spiewak on his blog.
Neward’s series, The busy Java developer’s guide to Scala, has just begun, with the first installment, Functional programming for the object oriented, published last week. Spiewak started his series, Scala for Java Refugees, in early January and his fourth part, Pattern Matching and Exception Handling was published today.
Scala has been getting a fair amount of press recently (see InfoQ’s roundup of the discussion) and Neward starts his article with a section on how Java is showing its age, specifically in regards to Moore’s Law.
Actually, it’s Moore’s Law that has many in the industry particularly concerned. Since 2002/2003, the growing trend in microprocessors has been to create CPUs with multiple “cores”: In essence, multiple CPUs within a single chip. This obviates Moore’s Law, which says that CPU speeds will double every 18 months. Having multithreaded environments executing on two CPUs simultaneously, rather than doing the standard round-robin cycle on the single CPU, means that code must be rock-solidly thread-safe if it’s to survive. …The concurrency crunch is a real concern, and some of the new languages offer powerful answers, but too many corporations and enterprises remember migrating from C++ to the Java platform just 10 years ago. To move to a new platform is a risk that many companies just aren’t going to seriously consider. Many, in fact, are still nursing the scars from the last move to the Java platform.
Neward’s tutorial goes through an overview of functional concepts, then discusses how Scala provides for them and wraps up with closures. Spiewak’s series is more lengthy and goes into a lot more detail. He targets his at experienced Java developers who have heard the noise about dynamic languages but are worried about dynamic typing for building enterprise applications.
The good news is that there’s light at the end of the tunnel. There’s a new language on the scene that’s taking the developer world by storm. Scala seems to offer everything you’ve been looking for in a language: static typing, compiled to bytecode (so you can run it on all those ancient Java-capable servers), a succinct and expressive syntax. …You can write your Java applications in Scala. You just need the right introduction.
Spiewak begins with a simple Hello World example and goes on to cover iteration and built-in types in his first article. His second article covers object oriented concepts, including classes, abstract methods, and constructors. His third dives deeper into access restrictions, method overloading and Scala’s approach to statics and his most recent covers pattern matching, case statements, and exception handling.