Live data from Hacker News

Ask HN: Java 8 or Scala?

news.ycombinator.com

1–10 of 39 posts

Ask HN: Java 8 or Scala?

#1
We are going to start on a new project. We will be 7-8 developers. 5-6 know Scala basics. We are deciding between choosing Play with Scala vs Play with Java. What do you think will help?

I personally like less verbose code and that's why prefer Scala. But considering team would be working and shipping the project, not sure whether Java 8 or Scala would help better.

Re: Ask HN: Java 8 or Scala?

#2
I work at a company that exclusively uses Scala for the backend of our applications/services, and I found that if developers are willing, it's almost never a problem to have them learn Scala within a reasonable amount of time, if they come from a Java background.

We found that it's very hard to find Scala developers when hiring, so we basically dip into the Java pool and look for strong and talented developers there, that are eager to try and learn Scala. We then train them on the job, which almost never takes more than a couple of weeks before they really become productive.

So I'd say, if you're confident in your team as far as their quality as developers goes, then go for Scala. The time lost in learning, will be made up in productivity once they get the hang of Scala and the start experiencing the productivity boost that a more functional approach can give you.

Re: Ask HN: Java 8 or Scala?

#3
Scala is more flexible (for better or worse) and less verbose (for better or worse).

Because of this, it's possible to be much more expressive in Scala and it's possible to be much more terse/obtuse.

I like Scala's powerful type system -- I just have a hard time reading most other people's Scala.

If you're sure you can get a consistency of style and approach in Scala among your team, sure, by all means. But if you believe that you're likely, at least in the short term, to have stylistic inconsistencies among your team, I'd lean a little more towards Java (just on "worse-is-better" principle).

Re: Ask HN: Java 8 or Scala?

#4
Scala for sure. It is a more expressive language that leads to less bugs down the road. Encouraging lots of immutability is huge, as well as a bunch of other benefits.

There will be a transition time for non-scala devs, but it should easily pay for itself down the road.

Re: Ask HN: Java 8 or Scala?

#5
In .NET as a similar choice, very subjectively, I would pick C# over F#, because:

1) succinct != readable

2) ReSharper and Roslyn IDE support makes a difference

3) there is no work opportunity to learn it

4) learning it in spare time would mean not implementing something else - I would prefer to solve domain problems rather than language AND domain problems

Re: Ask HN: Java 8 or Scala?

#6
5-6 know Scala basics.

Where will the team get Scala expertise?

Where will it get Java expertise?

What is the buy in to Scala from the team as a whole? What is the buy in for Java?

What is the level of expertise with Play?

What languages and frameworks has the team used previously on successful projects? What has it used on unsuccessful ones?

What matters more in this decision are the human factors, not the technology. That's why you're not considering Clojure among alternatives. If the team is split over language, that's a team problem and the solution can only come via working to get buy in from those who feel they have something to lose if Scala or java is the way forward.

Finally, if the long term goal is to transition from Java to Scala, Play with Java is a good first step. It gets Scala in the door, but keeps it out of the way as people are in the early stages of onboarding.

Good luck.

Re: Ask HN: Java 8 or Scala?

#8
The strange part of that question is you appear to have decided on the framework before the language. Strange because having used Play quite a bit, it's really not all that great in many ways, not good enough to be a default choice anyway.

I might consider taking a step back and reconsider your decision making steps to this point.

If for some reason you have to use Play then the only sensible choice is Scala.

Re: Ask HN: Java 8 or Scala?

#9
Java is the right choice.

Before I get into that, you may want to not focus on the framework so much, at least not before you choose the language!

Scala is great for the right purpose, it's powerful and should make you productive much faster. Yes, Scala is much less verbose which seems like it would be much more efficient. Enter one Scala developer who has small stylistic inconsistencies and you have set everyone back quite far (especially when using other sources to answer a problem).

Java is super easy to find answers if you need to and super, super easy for one developer to inherit the code of another.

But then again, Scala might be the right choice if you HAVE to use Play, as Play was written in Scala.

Re: Ask HN: Java 8 or Scala?

#10
post #8

The strange part of that question is you appear to have decided on the framework before the language. Strange because having used Play quite a bit, it's really not all that great in many ways, not good enough to be a default choice anyway. I might consider taking a step back and reconsider your decision making steps to this point. If for some reason you have to use Play then the only sensible choice is Scala.

What would you recommend instead?
Post reply on HN