Stefan Tilkov's Random Stuff

Scala as the Lesser Evil

Sorry for the title, I’m not really serious. But Bill de hÓra has put up an interesting post regarding Scala:

Yes, I know you can run Django in the JVM via Jython, I know there’s Clojure, and Groovy too. This is just about the theme of Ned’s post, which is the type system. And Scala has a better one than Java.

I’m still somewhat undecided yet, but I’m starting to believe that if any language has the chance to become Java’s successor, it will be Scala. It simply doesn’t require - or at least it doesn’t seem to require - the same amount of mind change for typical Java programmers. (You know, it has classes, and curly braces, and it’s taken seriously by the Java posse.) I’m not exactly enthusiastic about the language’s design (XML literals? WTF?), and in fact strongly prefer Clojure as a JVM language. But given the choice between Java and Scala, I won’t hesitate for a second - Scala is a way, way better language than Java, with its type inference, case classes, and support for functional programming.

So my position on programming languages as of November 2009 is this: For pragmatic reasons, as well as for the fun in programming, there’s still nothing that beats Ruby or JRuby on Rails for DB-backed Web applications.

From a language design standpoint, I believe that nothing beats Clojure. It’s my absolute favorite programming language at the moment. So for domains other than mere Web development, I consider Clojure an excellent choice. (I know about Compojure, and it’s neat, but the community is probably about 0.01% of the size of the Rails community.)

But if the forces that decide things will neither accept Clojure nor Ruby, I’ll suggest Scala, feeling sure that there’s simply no reasonable technical argument left to prefer Java instead. Which is somewhat satisfying.

Comments

On November 14, 2009 11:43 PM, Bill de hÓra said:

“It simply doesn’t require - or at least it doesn’t seem to require - the same amount of mind change”

I suspect Groovy wins the mind the gap position. And I know we’re supposed to like Clojure because it’s a Lisp, but I’ll see your XML literals wtf and raise you an STM wtf. A heap is a heap.

“there’s still nothing that beats Ruby or JRuby on Rails for DB-backed Web applications. “

Not even Django on Jython?!

“there’s simply no reasonable technical argument left to prefer Java instead”

That we can agree on, and I assume the tools will follow. My old boss writes the Scala plugin for Eclipse so I have a lot of faith :)

On November 14, 2009 11:50 PM, http://www.innoq.com/blog/st/ Author Profile Page said:

Not sure what exactly you mean with your “a heap is a heap” comment. Independent from a like or dislike for Lisp, Clojure’s persistent data structures + STM seems like a great idea to me.

I’m under the impression that those who favor static languages will not easily be won over by Groovy.

You may have a point on Django, I’m simply not qualified to comment.

Glad we agree on the last one :-)