Last week I had the chance to take a look at one of my worse fears about Scala: really bad Scala code. As I thought it might it did include a partial application, I was very grateful it didn’t abuse apply. It also managed to bring in a lot of classic bad behaviour like catching Exception and then swallowing it.
It has always been one of my fears that when someone went rogue with Scala the resulting mess would be so bad it would be a kind of code Chernobyl, its fearsome incomprehensibleness would be like the Lift code only without the brevity.
When I finally had to confront it I thought: this is actually no worse than really bad Java code.
I know that it could potentially be worse but actually it would take someone who was actually really good at Scala to construct the nightmare-ish worst case scenario I had imagined. In most cases terrible Scala code is going to look a lot like terrible Java code.
So that is really my last concern out of the way. We might as well use Scala for the good things it offers like immutability and first-order functions. The boost to productivity is going to outweigh the potential crap that might also be generated.
One thought on “Scala can be the replacement for Enterprise Java”
Maybe you got lucky. Maybe the other devs were not much interested in learning Scala, so they just sticked to Java coding using Scala’s syntax.
I think the optimal solution is:
– to provide decent training
– to provide more or less strict code style guidelines (including which features are a no-no). Exceptions should be done with supervision.
Having said that, I think those actions would most likely provide if not always better, at least no worse code. And for some/most of the programmers, much higher productivity.