Thus far I’ve tried to argue that Scala is a functional programming language that is also very pragmatic for real-world work. I think any Java developer who’s looking for something more sophisticated but doesn’t want to give up their development environment or their current toolchain should take a very serious, hard look at what Scala has to offer. JetBrains, creators of the popular IntelliJ IDEA, have shown interest in Scala with good reason; a few of their employees post to the Scala mailing list on a regular basis.
Here are some links to other interesting code examples.
- Here is an example of using a GUI library in the works by EPFL. It wraps around Swing and makes it much easier to use. It’s only in the early stages but it looks promising. It certainly makes Swing easier to use.
- David Pollak has been writing some interesting extended examples in Scala and you should have a look.
- The Scala wiki has an impressive example of simplifying JDBC with implicit definitions. Implicit definitions allow you to consume Java libraries (which tend to be akward to use, a state of affairs still preferable to what you find if you’re using Lisp/OCaml/Haskell, where the libraries you need don’t exist and probably never will unless you write them yourself) on much more amiable terms without having to extend them and thereby getting stuck in a rigid class hierarchy unfamiliar to a Java programmer who has used the library in question before. Implicit definitions are quite useful when used properly.
With that, I will take it as a given that Scala is a legitimate, useful language that any person who cares about producing brief, readable, high-performance code should definitely consider. The entirety of Java-land is the Scala hacker’s oyster, and he picks and plucks his favorite libraries at will, writing tiny bits of view code to simplify away the ugliness and verbosity, writing code often comparable to Erlang, Haskell, or OCaml in brevity. It is up to the Java community as well as functional programmers whether they want to be open to new ways of doing things that will help them and their customers or not.
Scala is definitely a little rough around the edges, still, being so young, of course. Probably its biggest flaw at the moment is documentation. But that is getting better on a rapid basis. The Scala team has shown that they are extremely open to user feedback and they are making rapid, regular progress towards improving both the language and documentation. They have gotten amazingly far, considering that Scala is only about 5 years old, and have only had a 1.0 release for a few years.
If all this isn’t enough to convince you about the potential merits of Scala, probably nothing will, and therefore I will cease preaching to either the converted or the unconvertible.