Thursday
Jul092009
Jack Cough : Scala Over Ruby - His Debate Ends - Mine Meanders Conclusion-ward

Jack Cough on Software: Scala over Ruby - My Debate Ends: This article struck a chord with me today.
I spent most of today flipping back and forward between Ruby and Scala. I'm working on a project where I'm writing some Ruby talking over sockets and streams and files and I needed something JVM flavoured on the other end.
The JVM end was just some driver code that was going in the bin. I had IDEA open because I was using it to write the Ruby side ( at which it is fantastic ) and a simple Scala script seemed easiest - that's where my head has been recently so it seemed most natural.
Things did not go so well - the embedded Ruby that I was using was badly mangled and had chunks of the standard libraries missing. I ended up spending the day bashing away at various ways of solving the problem. With each change of direction I had to rework both the Ruby and the Scala side of the solution. I noticed something odd.
Version 1.0 was a bit faster to write on the Ruby side. I'm a better Ruby programmer than I am a Scala programmer, but that aside I feel that it was slightly easier to express the problem than in Scala. But as the day went on the Scala code became easier to work with whilst the Ruby code had good and bad patches. Significant refactorings or changes of approach often led to runtime errors in the Ruby code. This wasn't a problem in the Scala code. The IDE, compiler and type system caught most of the problems well before I got the application running.
Have I abandoned Ruby forever? No, it is near and dear to my heart and it is still better for bashing out scripts for which there will be no version 2. The benefits of Scala didn't become apparent until 4 to 6 hours into the piece.
Some questions come to mind:
How well would the Scala fare long term? I don't know. It is possible that I won't understand it tomorrow and that every day will have a 4 to 6 hour ramp up time. But I don't think so. I think I'd reap more benefits tomorrow than I did today.
How would Java have fared? I worked on a similar problem the day before and I used Java. It was a pain in the patooty in many ways, but I'm not sure if it comes above or below the Ruby version though. Many of the same characteristics that Scala has were apparent in that session too. I am sure that I found the Scala experiment more productive - despite the fact that I'm a much, much better Java programmer than I am a Scala or Ruby programmer.
in
Java,
Programming,
Ruby,
Scala




Reader Comments