Interoperability with Java is not a good thing.
Most serious Java programmers have heard about Scala at this point, I would imagine. If you haven’t, here’s the description from the Scala web site: Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java.
Scala is doing a lot of good. It is bringing functional techniques over to the world of Java development, where they sorely are needed. Its interoperability with existing Java code is touted as being very important. Coming from a Java perspective, this is no doubt quite true. Being able to use existing Java code with the new capabilities of Scala is beneficial.
But I’m not sure if that’s true when looking at the issue from the perspective of Scala. We don’t see interoperability, but instead we see cruft. The existing Java classes are not designed to make the best use possible of the novel features offered by Scala. They’re handicapped in many ways. Now, it would be possible to wrap those Java classes in some fashion. But the use of such adaptor code often leads to messy software.
So when considering Scala as a language of its own, perhaps it would be best if the Scala community looked past its Java roots. Instead, it should embark on a journey of its own, developing supporting libraries that make excellent use of the unique features it offers. Besides being able to eliminate some of the sore points of many of the existing Java classes, the use of Scala-specific features could very easily lead to significant developer productivity improvements. And that’s a goal worth striving for.
August 25th, 2007 at 2:15 pm
[…] short while back I wrote about how Scala’s interoperability with Java is not necessarily a good thing. One of my main […]