Post navigation

Are You More Productive In Scala?

Yesterday I wrote a blog entitled ‘A New Java Library For Amazing Productivity‘, which was – in all honesty – a trap: a well-intentioned honey trap with the purpose of trying to convince developers that they should be looking at Scala and evaluating it on the merits of its potential to deliver productivity gains, just as they would with a library or framework, rather than discounting it because it’s a “language”.

Huge claim: “A New Java Library for Amazing Productivity Posted on February 11, 2013″
No facts or numbers.

In my defense, the blog post had nothing to do with proving that Scala delivers huge productivity gains (though obviously I believe it does). It was just trying to get people to try it out rather than avoid it.

However, being a geek, I have trouble avoiding a challenge, so I’ve taken Stephan at face value and have committed myself to trying to gather some statistics on Scala and productivity.

Here’s my attempt: a short survey, just 8 multiple-choice questions, about Scala and productivity. My hope is that, if we can get as many Scala developers as possible answering the survey, we might get something useful out of it. My plan is to let it work its way around the web for about a week and then process the results and publish back here soon after.

14 thoughts on “Are You More Productive In Scala?”

My take on productivity: It looks more or less the same compared to Java (my basis around 10yrs of Java and the last 4-5yrs only Scala usage as I think Scala is currently the best language for me).

The driver for productivity is: Don’t write code. If you do not need to write code you’re done. Reduce scope is one productivity technique. When writing code the biggest productivity gain is libraries/frameworks. That’s the main driver for Rails productivity for web development (libraries for everything).

I also 10x read and think more about code than I write about code. So writing less lines of code is not much more productive to me. Others I understand have a different ratio, for them writing less code might be much more productive.

Scala productivity vs. Java:
(+) filter, map, .. makes me a little more productive, not because of the code size, but the concepts.
(+) Option in particular makes me more productive, no thinking about NULL, no NPEs. This is perhaps the hugest gain for me. Other Monads are also useful concerning productivity.
(+) Implicits make me more productive, I do not need to care about implicit parameters e.g.
(-) IDEs still do no complete syntax check, compared to Java I often need to compile Scala code to find errors
(-) IDE refactorings, completions etc. are far behind Java
(-) errors are often cryptic: Sometimes it takes a lot of time for me to understand type errors the compiler complains about
(-) upgrading versions and libraries are a pain, because of binary compatibility. It sometimes takes days to upgrade my environment
(-) Changing SBT configuration also sometimes takes days to get it working again

My 2c about Productivity. Would it be for productivity, I’d not use Scala

Since you’re basing the survey on impressions of scala programmers, here’s what I think is the killer question: for those of you writing entirely in scala now, do you ever want to go back to java. Variants: how likely are you to listen to a job offer involving writing java full-time? How likely are you to liste to a job offer to write scala full-time?

I first learned Scala because I’m something of a language junkie and I like functional languages. I’ve stuck with it over the last year-and-a-half for a number of reasons, but chief among them is this: I can flat-out work faster and produce better code faster in Scala than in any other language I’ve ever encountered. I find that using Scala makes it easy to get the ideas from my head into code, and that the result is more likely to be correct and maintainable from the start than in any other language. And the result runs surprisingly fast. (F# and Python are tied for a close second place and I use then where I can’t use Scala.)

One question was how would you rate your knowledge of FP. I would also like to note that my knowledge of FP before learning Scala was MUCH lower. I imagine there are other people in the same boat as me. Just don’t want people to assume only FPers could like Scala, since it may be that people like FP because of Scala. Other than that, good luck w/ the survey!

Thanks for the comment, Tom. My aim there is to find out if there are people who are not confident with FP but still feel productive in Scala. I think that would be a good situation as it would give evidence the road to productivity in Scala is relatively short. We’ll have to let the data show what it shows, though.

I like the idea of the survey, but I am not sure if you are going to learn much. The questions are very biased towards scala. Do they compare to java only or any other languages? My productivity in scala surely depends on what I am trying to do. If it’s android programming, I tried a bit, but java is still a winner. For server side, scala beats java, not sure if it beats php in direct productivity, but it probably beats it in code maintainability.

About the question of amount of scala code in the porject… again, compared to what? If I do a webapp project, some code is in scala and some in javascript and maybe a bit in PHP. Having 50% of scala in the project doesn’t mean much as anyway, I wouldn’t be able to do the clientside code in scala.

I am all for scala, but I am not sure if you will convince the java hardcore users with such a survey.

Thanks, Bill. I agree. There are trade offs with any technology choice and often one of them is that power provided by having more abstraction can backfire when you have a problem and need to delve beneath the abstraction to solve it. I’ve tried to capture some of this in the survey by asking not just about people’s feelings of productivity while coding but also about whether the team delivers more value to the business/customer.

I do not know anybody using Scala wanting to go back to anything else.
Plus the level of abstraction possible makes comparison with Java impossible, because Java cannot even come close.
No Tuples, no Akka, no pattern matching, a very weak type system, broken generics, no real DSL possibility, no implicit,… There is so many things missing, for the person stating he has the same productivity in Java, please explain to me ????