Live data from Hacker News

Ask HN: Java 8 or Scala?

news.ycombinator.com

11–20 of 39 posts

Re: Ask HN: Java 8 or Scala?

#11

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.

If immutablity and functional style programming are priorities, then why Scala over Clojure? By which I mean that the decision is less about technical concerns, they all run on the JVM, than team dynamics and who is willing to learn what...or not learn what. If using Java/Scala contributes to the likelihood of the project team failing then Java/Scala is the wrong choice.

Re: Ask HN: Java 8 or Scala?

#12
If your devs are bright and want to learn something new, go for Clojure. If you already have strong Java skills and need to deliver fast, go for Java 8.

Re: Ask HN: Java 8 or Scala?

#14
How well does the team know the domain in which the project rests? If it's a well trod domain, going to a new language (Scala) would do well to keep interest high, while not getting bogged down in the challenges of solving a known problem.

If, however, the problem domain is relatively unknown, I would recommend Java8, so you and your team aren't fighting two unknowns at the same time.

Re: Ask HN: Java 8 or Scala?

#15
From my experience, Java while more verbose offers better tooling, standards, documentation and support. Scala certainly is more concise but there is a cost that you will incur later when trying to debug or maintain s large fast moving code base. Sbt blows, ide support for scala is spotty and good luck defining a code convention and standard that you can automatically lint and format. To me it's c++ for the jvm (not a good thing ☺).

The next thing I'd advise is to not use play but to consider dropwizard or better yet spring boot. You may be thinking "ugh spring.. Isn't that so heavy?" Possibly but it's a lot simpler to use, extremely powerful and well documented and supported. Play just doesn't have that maturity and support going for it that a spring or dropwizard have.

Re: Ask HN: Java 8 or Scala?

#16

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.

   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.
Deja vu. I use to talk just like you. My colleagues would too.

I miss Java's verbose-ness. It's hell, but for large codebases and tooling - I wish I had a bottle of JDK 8 right now.

I heard a lot of this "prescription"-like talk, it'll buy us a lot X down the road. I blame our "this or nothing" attitude toward scala.

We would unconsciously, I think, immediately cast aside any contrary information. We thought ourselves as using this perfect tool and were condescending to anyone who used other things.

We wrote everything in it. We fired 2 node/python coders.

We're too invested and afraid to admit reality, it's a flawed language. Too complicated. Too many idioms for the lexer to handle.

Frankly, the only scala engineer who ever admitted it (they outright ban scala detractors on the mailing list and freenode) was Brad Phillips. Don't take my word for it, I recommend looking him up.

Re: Ask HN: Java 8 or Scala?

#17

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 bac…

Doesn't Play have documentation / API for Java?

Re: Ask HN: Java 8 or Scala?

#18
post #17

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 bac…

Doesn't Play have documentation / API for Java?

Yes it does. But even after knowing some basic Scala, I find it significantly easier to work with Play on the Scala side. It feels more of a first-class citizen. However, this is just my personal opinion.

Re: Ask HN: Java 8 or Scala?

#19
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?

For a website?

Why scala? Because LinkedIn and Twitter use it?

I have had great experience with Django in the past 8 years. Nice tooling. Nice template engine. Nice ORM. Mature. Scalable. Robust.

The main detractor you'll hear about it is performance. You're just building a website. Even in situations where I'm recompiling LESS (bootstrap), with all debug tools on, and rendering images in the same pageload, it takes 200ms.

Since python is interpreted, you just refresh the page. No 10 minute compiling just because you had a typo.

One thing about django I don't like though is you never get the "snappy" feeling of just loading a page like lightning fast. Java / scala / golang gives the impression.

Re: Ask HN: Java 8 or Scala?

#20
post #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 be…

What do people mean when they say "powerful type system"? Does that mean it could potential be a downward spiral where everyone creates their own DSL?

I use Ruby on Rails and Django - and in ruby and python, it's interpreted on the fly.

How will a type system, let alone a "powerful type system", help improve ruby or python's web apps?

Post reply on HN