I ran across that blog post in my searches a few days ago, but I only read the first couple paragraphs at the time. I fully agree that the title is misleading with a subtle point that: 1. If used as a slant toward sarcasm is a point most will miss or 2. If stated as a true opinion, it's one I don't agree with
Maybe the right title should be "Scala is not ONLY a better Java". Many of the arguments used to prove complexity point to DSLs, which are *very hard* to do right and most people should not tread into that capability lightly. So ok, let's throw them out of our mind for a little and just look at some of the things left over, that IMHO, lead directly to "a better Java": 1. Type inference 2. Immutability by default 3. Consistent application of object-oriented principles (i.e. no protected statics which don't make sense, no direct difference between primitives and object forms) 4. Case classes to automatically create entity classes with getters and optional setters, guaranteed accurate equals and hashCode implementations - all with 1 line of code 5. Closures 6. Strings-in-switch (one use of pattern matching) 7. A truly beautiful collections library You get all these features, on the JVM with all the features that gives you, and interop with Java libraries. If this isn't a better Java then nothing is. But I do agree with the author's points that Scala, the *language* has different goals than Java. But if I remember back to my days when I switched from C++ to Java, the language was not my main reason. It was other things, like a way to do GUI in the same language that I could write console/server apps (unlike VB), the ability to write rich web applications through applets (later replaced via DHTML libraries but at the time an intriguing option), and MEMORY MANAGEMENT!!! All that with a similar syntax to C++. That C++-based libraries really never took off in all those years, while Java libraries mushroomed immediately just stamped the language in place. With the ability to keep the powerful JVM in place while there exists an option to look at different languages that, when you throw out the DSL stuff, still leads to a better Java, I think it would be irresponsible for us to not at least take a real look. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
