Live data from Hacker News

Ask HN: Why do people have a hatred for Scala?

news.ycombinator.com

111–120 of 134 posts

Re: Ask HN: Why do people have a hatred for Scala?

#111

In my opinion (and I have worked on large scale development in Scala in the past) it is just unnecessarily complicated. Random annoyances off the top of my head - you can't necessarily understand an isolated function unless you know what implicits are being used, crazy overuse of operator overloading and slow compilation times (this has improved over the years). You don't have to learn Scala, you could learn Clojure,…

Agreed that implicits were one of the critical things that caused me to move away from Scala. I really couldn't justify in my head the use of such a thing.

The one case I can make for implicit conversions (implicit parameters are brilliant and useful and not normally what people complain about) is the spray-routing DSL, e.g. https://github.com/spray/spray/blob/master/examples/spray-ro... . What would be a separate config file in any other framework is instead ordinary Scala code following the rules of ordinary Scala, which is wonderful - you can factor out and reuse common parts of your routing really easily, because it's all just code.

Re: Ask HN: Why do people have a hatred for Scala?

#112

I don't hate Scala but I did not pursue it after only a few 'lessons' : transitioning from Java to Scala was smooth and not intellectually stimulating. On the other hand , Clojure programming forces me to think differently and the solutions are more elegant. I understand Scala is also functional but it is too permissive and I slide back in imperative all too easily. Clojure is highly disciplinarian and opinionated an…

Interesting, that was exactly my reason for preferring Scala. With Clojure I could see it would take me weeks to get productive. With Scala I could write Java-without-semicolons and be slightly more productive on day 1, hour 1 even, and then gradually pick up the more advanced features.

Re: Ask HN: Why do people have a hatred for Scala?

#113
post #35

I'm currently learning Scala (background in Python and Haskell) and I have encountered a few road blocks: 1. The REPL is not very helpful: You cannot look up documentation a la IPython (i.e. myFunc?) or inspect objects easily to find out how things work 2. There always seem to be 10 ways to do the same thing. This makes it much harder to understand other people's code than when there is just one way to do it. 3. The…

2. There are places where this is true, but a lot of people seem to get hung up on the syntactic differences between e.g. "a.foo(b)" and "a foo b", which really are superficial and you learn to read past very quickly.

3. Some of these are backwards compatibility. You can get a more helpful typesystem by setting a few flags: https://tpolecat.github.io/2014/04/11/scalac-flags.html

Re: Ask HN: Why do people have a hatred for Scala?

#114
post #51

Earlier quoted context omitted.

> Everyone agrees Scala is too complicated. This is not true.

Everyone who hasn't used it for at least a year or more than three.

I've been using it for five years and I don't think it's too complicated. (There are plenty of places where I think complication is a necessary evil for the sake of Java compatibility)

Re: Ask HN: Why do people have a hatred for Scala?

#115
post #37

Scala grew really fast off of an interesting, new academic ideas. There are a lot of stretch marks.

Could you give an example?

A lot of Scalaz and Shapeless duplicates things that were implemented less well in the standard library. E.g. standard-library tuples can't be abstracted over (supposedly will be addressed in Don Giovanni but that's at least 3 years away). Standard-library futures aren't completely controlled (and overuse implicits) so there is scalaz-concurrent Future which is almost but not quite the same. The macro implementation is clunky and really needs a couple of minor changes that are going to be in the next release but aren't at the moment, quite possibly because it was implemented by an academic whose time didn't quite sync up with the scala language release cycle.

Re: Ask HN: Why do people have a hatred for Scala?

#116
post #70

I don't like Scala for the same reason as C++. Scala has an incredible semantic complexity with a Perl-like syntax. Too much magic going on.

Yes magic is one thing that makes it difficult to get into a language and to maintain code written in that language, where of course maintaining can mean going back to code you wrote last month. One of my pet hates in C++ was implicit casting and I'm hearing that Scala does similar, which is putting me off it.

Scala has implicit conversions but the IDEs highlight when they're happening, so they're not completely invisible.

To my mind Scala is a very unmagic language; very complex libraries are written for it, but they're never magic, they're always ordinary Scala code and ordinary Scala features, just combined in clever ways. E.g. typeclasses are a language feature in Haskell, but in Scala they're just a pattern that you implement using implicit parameters. Actors and messages are a language feature in Erlang, but in Scala they're just a library with methods that you call. Type-level functions are a language feature in e.g. Idris, but in Scala (e.g. Shapeless) they're just a technique making use of implicit resolution.

Re: Ask HN: Why do people have a hatred for Scala?

#117
post #22
post #5

People who actually use Scala love it. For instance, Scala is one of the most loved languages in the recent StackOverflow developer survey. The survey had more than 26'000 respondents, so this is pretty significant. http://stackoverflow.com/research/developer-survey-2015#tech... But you are completely right that there's also a lot of negative sentiment around it. Here are two possible reasons I can think of (I am sur…

We used Scala for major projects; love the language, hate the infrastructure / documentation / frameworks / sbt / attitudes of many in the community. I believe this is a pretty common sentiment.

We use Scala for major projects too, I love the language and also the documentation, frameworks, (even sbt) and attitude of the MAJORITY of the community. Can you give concrete examples of what caused you to hate all of the above? Especially I'm interested in the community aspect. I've found the community very friendly and helpful, but perhaps I'm going to the wrong (i.e. right) places?

Re: Ask HN: Why do people have a hatred for Scala?

#118
post #108

Earlier quoted context omitted.

Is it an accident that you picked the worst offenders for each category? :) Not as verbose as Java -> Java is probably the most verbose compiled OOP language Refactoring is safer than it would be in JS -> I think with the IDEs this means almost nothing. Runs faster on Linux than C# -> I mean seriously, Java's biggest advertised feature was multi-platform support while we know that Redmond guys don't care about other…

Scala isn't the best at any of these things though. It's great because it's an all-rounder language. How about this: Scala doesn't - quite - have the safety and conciseness of Haskell. But it's close. Scala doesn't - quite - have the enterprise support and tooling infrastructure (monitoring/instrumentation, profiling, debugging, IDEs, library ecosystem) that Java does. But it's close. Scala doesn't - quite - have the…

What scala does is sloppily bolt on everything without putting any checks or balances.

I don't doubt your sincerity.

Try to pull yourself out and understand it as an investor:

$500 a day to pay for a scala engineer. Not a word about the bottom line.

Python? Ruby? Are they algorithmically fast? No, but they ship and sell.

Re: Ask HN: Why do people have a hatred for Scala?

#119
post #118
post #108

Earlier quoted context omitted.

Scala isn't the best at any of these things though. It's great because it's an all-rounder language. How about this: Scala doesn't - quite - have the safety and conciseness of Haskell. But it's close. Scala doesn't - quite - have the enterprise support and tooling infrastructure (monitoring/instrumentation, profiling, debugging, IDEs, library ecosystem) that Java does. But it's close. Scala doesn't - quite - have the…

What scala does is sloppily bolt on everything without putting any checks or balances. I don't doubt your sincerity. Try to pull yourself out and understand it as an investor: $500 a day to pay for a scala engineer. Not a word about the bottom line. Python? Ruby? Are they algorithmically fast? No, but they ship and sell.

Depends what you're making. http://www.joelonsoftware.com/articles/HighNotes.html can apply - what I'm working on right now with Spark I dread to think how you'd do reliably in any other language.

> $500 a day to pay for a scala engineer. Not a word about the bottom line.

Maybe - I don't make that much and I have 5 years' Scala experience. (I have a relaxed environment and great culture though, so I'm not complaining). What I really don't get is Java companies where developers are chomping at the bit to use Scala and management says no - your devs are volunteering to become devs that companies would pay 2x for, the least you can do is let them.

Re: Ask HN: Why do people have a hatred for Scala?

#120
post #48

Earlier quoted context omitted.

+1 Implicits. We put very strict limits on use of implcits. They make code extremely difficult to reason about, but can also be incredibly dangerous. I once stumbled upon an implicit cast of Int to Float... Oh, my.

Is there any linters available for IDE's to ensure conformance with a vanilla ruleset of scala? If that existed, scala would be able to shape itself up nicely.

Their are linters available for scala (e.g. wartremover). Also, the Scala compiler supports a number of flags to warn you if your code is using some of Scala's 'more questionable' features. You can even tell the compiler to fail if any of these warnings occur. A list of useful flags can be found at https://tpolecat.github.io/2014/04/11/scalac-flags.html.

You might also want to look at this excellent talk titled 'Toward a Safer Scala' at https://docs.google.com/presentation/d/1tCmphnyP3F5WUtd1iNLu... that recommends a number of best practices that can be followed using Scala.

If you're using sbt, I put together a giter8 template for scala/sbt projects that follows these best practice recommendations at https://github.com/hohonuuli/basicscala.g8

Post reply on HN