Ted Neward on why Java developers need Scala. Scala Syntax Primer. Scala runs on the JVM and can directly call and be called from Java, but source compatibility was not a goal.
Scala has a lot of capabilities not in Java, and to help those new features work more nicely, there are a number of differences between Java and Scala syntax that can make reading Scala code a bit of a challenge for Java programmers when first encountering Scala. This primer attempts to explain those differences. It is aimed at Java programmers, so some details about syntax which are the same as Java are omitted. This primer is not intended to be a complete tutorial on Scala, rather it is more of a syntax reference. For a much better introduction to the language, you should buy the book Programming in Scala by Martin Odersky, Lex Spoon and Bill Venners.
However I've long wanted a long term replacement to javac. I even created a language to scratch this itch. Java is a surprisingly complex language (the spec is 600 pages and does anyone really grok generics in Java?) , with its autoboxing (and lovely NPE's hiding in there), primitive types, icky arrays which are not collections & general lack of polymorphism across strings/text/buffers/collections/arrays along with extremely verbose syntax for working with any kind of data structure & bean properties and still no closures (even in JDK7) which leads to tons of icky try/catch/finally crapola unless you use frameworks with new custom APIs & yet more complexity. Java even has type inference, it just refuses to use it to let us save any typing/reading. So why Scala? Scala By Example. Scala. Code Commit: Roundup: Scala for Java Refugees. 13 Feb 2008 To be honest, I’m somewhat kicking myself for writing this post.
As I’ve said many times: roundup posts are for people who are too lazy to write real content. I can’t tell you how many blogs I’ve come across which have a roundup-to-post ratio of easily 3:1. You know it’s a bad sign when sites start having roundups of their roundups… Meta-roundups aside, I decided (after much deliberation) that a single post linking to all six parts of the series would be useful to one or two people. Of course it’s always possible that you subscribe to my way of looking at things. Part 1: main(String) Introductory article giving motivation for learning Scala and some first steps to “get your feet wet” in the language.
Part 2: Basic OOP Looking at Scala’s syntax in a little more detail. Part 3: Methods and Statics Scala’s method syntax is far too powerful to cover in a single post. Part 4: Pattern Matching and Exceptions Part 5: Traits and Types Part 6: Getting Over Java.