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

  • 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 sure there are others).

    1. Scala does not form part of an established programming language tribe. It is neither a better Java nor a Haskell on the JVM. So people are challenged in their assumptions; they don't know what it is, and react negatively in order not to have to learn more.

    2. Scala is pretty successful. So people in neighbouring language communities sometimes feel frustrated that a seemingly (to them) inferior language gets traction and their perfect language gets less. I saw some of that when Java eclipsed Smalltalk in the 90's. I never met a community as spiteful of Java as the Smalltalk one.

  • I have used Scala for building business solutions since 2012. I had been maintaining PHP and Rails systems of 50k to 150k LOC prior to the switch. I still have to maintain PHP and Rails systems. The move to Scala was driven by the need for better performance, system resiliency, and to mitigate the effect of multiple developers coming in & out of a codebase. It turns out to be ideal for this.

    Idiomatic Scala is not a grab bag of features or paradigms. It is firmly based on programming with expressions and using the type system to improve abstraction. Statements and mutable data structures show up when interfacing with external systems or for performance reasons. The Collections libraries are arguably "object-oriented" as that term is commonly understood, but this is not typical for application code. However, object-oriented features such as objects, classes, and traits are the basis of Scala's module capabilities.

    For programmers coming from 20th century mainstream languages that are all based on programming with statements, mutable variables, and are arguably a thin abstraction over the machine itself, programming with Scala can be a challenge. If you want to do your familiar imperative style of programming, Scala is going to be painful. Use another language. But if you would benefit from a type system and good support for expressions, then Scala is possibly the best choice currently for growing business applications. We are not in 2005 any more.

    Scala is not ideal as an introduction to functional programming. Other languages, such as F#, SML, OCaml, and Haskell have better, simpler syntactic support for features associated with functional programming.

    People who dislike on Scala are probably either stuck in the past or don't have pain that Scala would solve.

  • 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, F#, OCaml or Haskell. They would all teach you interesting aspects of programming and then you could come back and examine Scala with a broader perspective.

  • There has been an... unfortunate community attitude. Some people were quite unwelcoming to newcomers. I think this is down to two individuals; nowadays many friendlier folks are writing Scala libraries and hopefully the community will improve.

    I get the sense the Java community is also unused to interacting with other languages, because for a long time the JVM was a world unto itself. Most languages have a spectrum of "neighbour" languages and so users are used to working with at least slightly different alternatives. Scala is possibly Java's closest neighbour (Groovy is not really popular enough to show up on the radar of most Java devs) and it's become something very different, so there's a real culture shock just trying to talk to each other. A lot of Scala folks take a lot of assumptions for granted that are very alien to Java folks.

    None of which really takes away from the language itself, if you're willing to learn on your own or tolerate a few insults when you ask for help. IMO it is very much worth it: Scala is genuinely the best practical language available today (it has more than its fair share of warts but they're mostly for JVM/Java compatibility, which makes it so much easier to introduce to business than e.g. Haskell).

  • This might be worth a read:

    http://codahale.com/the-rest-of-the-story/

    http://codahale.com/downloads/email-to-donald.txt

    Having worked with Scala; I'd say I love it.

    Having worked with Scala; I'd say don't use it for most projects.

    It is not the best language to start learning FP. Wrap your head around a dedicated FP language and if you still feel the need for a hybrid FP/OO language Scala is definitely worth a look.

    However as it is a hybrid I've felt it made my code just too complex. Compared to Java there are a dozen more ways in Scala to fix something; and often you struggle to find the best way. This takes a lot of learning and it just isn't worth it. It's a great and elegant language in many ways, but I've come to dislike a lot of features of it.

    Simplicity is one of those things that make a beautiful codebase. See also (recently featured on HN);

    http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-...

  • In 2015, XML is a first class citizen but JSON get a third class treatment. JSON parsing in Scala is ridiculous. http://www.reddit.com/r/scala/comments/2l7v5u/json_parsing_i...

  • I dabbled in scala for a while a few years ago and ultimately decided not to invest the time becoming an expert in it for the following reasons. 1) Slow compile times, I really value fast feedback and if it takes me over a second to compile and run a unit test that just doesn't cut it for me. 2) No clear idiomatic style and having many different ways of doing things each of which can imply different behaviour in different contexts.

  • I don't hate it. Scala looks cool and I might use it if I had to use the JVM.

    What turns be off from looking into it much:

    Verbosity. It seems that it can't infer types in as many places as an ML. I prefer rather succinct code. I understand Scala has a powerful type system and it isn't always possible, but... ugh.

    OO. Scala seems to want to really embrace Java's OO model fully, and that's a bit ugly. It's probably a good practical decision but feels like a turn off. Again, I haven't used Scala, this is just an impression I have.

  • 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 and I find that refreshing.

  • I've written C# for most of my career, and have in the last couple of years been exploring functional programming. I started learning Scala, and getting involved in the community and I found it to be quite interesting.

    Something I find different is that most C# developers like writing C#, they may dislike many other parts of the ecosystem, but they generally enjoy the language. However with Scala developers, I find that many of them seem to dislike the language.

    To cast a broad stereotypical brush, it seems like there are 2 main groups of Scala developers. There's those who are really into FP, and would love to be getting paid to write Haskell all day, but unfortunately Scala is the only option they can convince their employer to adopt. So they begrudgingly choose it because it has some of what they want, but they are forever wishing it was better & making their frustrations known.

    Then there's the other side, which are developers coming from Java (or other OO languages) after hearing about the benefits of FP/Scala. They're either not using Scala professionally, but want to learn, or are just starting to use it at work. They are much more enthusiastic about the language.

    Unfortunately, the first group are often more vocal, and it puts off newcomers.

  • I wouldn't say hate. Scala is a OO-functional language, so it's bound to have people who dislike it from both of those camps.

    I started learning Scala (it got me into functional programming) but dumped it for the same reasons as Java. It's bloated. I also question Scala's longevity.

    I'm happily using Elixir and Clojure these days, but I mainly do web stuff so YMMV.

  • Programming languages are a new thing for humanity. I'm pretty sure that we aren't making programming languages correctly yet. And even worse there almost definitely isn't a One True Programming Language (it seems suspiciously like there's going to be more than one "right" programming language per domain (ie embedded, web, server side, etc) and to make things even even worse the right language to use might even be different based on the person using it).

    If you find yourself in the future "hating" all the programming languages, this isn't necessarily problematic, it might just mean you have a good understanding of programming languages. Just try to remain polite and remember that there's more than one way to see most scenarios.

  • Not hate, but I had a feeling that it was a kitchen sink language, also too much academic influence leaves a bad taste.

  • I am not really sure. I come from a Ruby and Python background and just love scala. It's a joy to work in and relatively easy to introduce at work compared to other FP languages.

  • 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 type system seems less helpful than Haskell's (e.g. why is "asdf" + 3 not a type error?)

  • Everyone agrees Scala is too complicated. Beyond that, there's a flexibility problem: Scala allows you to write a global mutableMonadFactoryFactoryMonad.

    That said, nothing does exactly what Scala does. Fluently mixing imperative, lazy, OO and functional styles isn't really common. Neither is the wealth of concurrency constructs available to Scala programmers through the standard library and Akka.

    I'm writing a compiler in (not for) Scala right now and it's pretty sweet.

  • Here's one: http://blog.gmane.org/gmane.comp.lang.scala.debate/month=201...

    Apart from occasional issues in the community Scala is criticised for being too complex: https://www.youtube.com/watch?v=uiJycy6dFSQ

  • If you compare it to Java or Groovy, Scala is the winner. Even the designer of Groovy admitted by saying something like "If I knew the Scala back in 2003 I'd probably have never created Groovy" But compare to Haskell, it looks like a bit bloated. On the other hand, Play Framework has been a great catalyst for Scala.

  • For me personally, main problem with Scala is somewhat hard to explain, but can be summarized with few very abstract phrases which are overlapping:

    * Dirty (opposite of Clean) language.

    * Relationship between theory and practice is so far away from being "1 to 1".

    * "Not In My Head" anti-patterns (something that will constantly require checking your notes/internet if you haven't worked with it within e.g. a month) everywhere.

    Everything seems to be made overcomplicated on purpose for no reason (apart from JVM compatibility I guess, which is no excuse for me as user). Starting from simple things, variable function declarations, so many ways to declare functions, so much theory on var/val/def/lazy/ and how they differ at some corner cases. Function vs. Method stuff in combination with currying/partial application makes things so overcomplicated with so many corner cases which I will never be able to remember. I mean I have many pages of my notes from time I studied Scala, consisting just of corner cases and explanations of why they are present.

    If you consider how Golang is viewed by many - as huge step back in our knowledge of language design. I consider Scala as step back in what is known in clean code, overall lessons from designing nice products. It just makes me feel like, it betrays everything I care internally and if Scala becomes dominant platform, it would just show to me that we as an industry just don't have standards and can accept just anything, we will never have something nice, close to perfect.

    So my stance on Scala:

    * If you just want to learn functional programming - pick something else, F# for me looked a lot cleaner and much closer to "1 to 1" - you can just apply functional theory without fighting the language.

    * If you looking for language to make you happy - don't pick Scala. Unless you're into "The Abyss" thing @ Crockford.

    * If this is for the money or because it sucks less than X (e.g. Java) in some ways - Scala is good consideration.

  • I was a big fan of SML, and really wanted to like Scala. The reason I didn't pursue it was the language is really complex (imo) kitchen sink as others have said, and as others have also said, there's no one best way to do things, no clear idiomatic style. Plus there was a bit of churn in the language in the beginning. I concluded that if I was going to use the jvm, may as well just stick with Java, or another jvm language with more wide spread acceptance (jython, groovy, ...).

  • I've been programming in Scala for around a year and a half. I hate one thing about Scala, which is the community.

    It's split into two, the people who wish Scala is Haskell (shapeless, scalaz &c) and the people who want Scala to be Enterprise Qualityâ„¢

    It causes lots of issues, as their goals for the language are completely different and Scala devs are usually in one camp or another.

    As an aside, I always think that if your problems are much better expressed in Haskell, why are these developers not using Haskell?

  • 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.

  • If any one from the scala community is hearing. This is what I have to say as a newbie who started learning Scala a couple of days back.

    Free learning resources. There are no good free scala books which can teach you the language in the way it is supposed to be learned. Not something expected of a language which wishes to compete with something like Java on the longer run. The biggest issue I have faced so far is learning from scattered blog post all over the internet explaining the powers of scala, even before introducing how to use the very basic features to build simple things.

    There is too much assumption about what the programmer already knows, or about the programmer's background is; while introducing these features. As some one who is not familiar with the Math behind most of these functional programming concepts, every thing goes over like water poured over a stone when the documentation talks about Types, Category theory, Monads. In fact it took me a great deal of simplification, and thought to understand concepts like map, reduce, foldLeft, foldRight. Most of it was in language totally unpalatable to an ordinary programmer. Talking in a language understandable only to Phd students won't work for nearly all of the programming world.

    So far my introduction to Scala has been similar to seven blind men describing an elephant by touch various parts of the elephant's body.

  • as a reasonably seasoned non-scala programmer who was fairly new to scala, I think that it's a combination of 3 things combined together. Implicits combined with non-alphabetic dsls (somewhat combined with the removing the dots from the method calls)

    .. additionally, I always found the scala equivalent of the javadocs harder to read.

    The end result (for me) was that I'd download, say an HTTP library, all the method names would be things like '/' and '?' - and you couldn't actually see what a minimally functioning code should look like due to all of the implicits flying around.

    If you compare this to java, which was undoubtably more verbose, but was easier to take and unfamiliar library, squint a bit, and see how the building blocks roughly fit together, using a combination of reading the docs, and looking at the intellisense in your IDE.

  • Taste.

    Just like how people won't touch Python because of its whitespace, people won't touch Scala because of the JVM.

  • Previous discussion may be pertinent:

    https://news.ycombinator.com/item?id=7458588

  • Hate is too strong a word, but I've seen some poorly written Scala that over used overridden operators and it left a bad taste in my mouth.

  • I can speak from my own experience with using it on a growing team: Don't.

    It's a very powerful and expressive language. That translates to "completely unreadable by people without at least a few months direct experience in it." If you plan on introducing people with little to no scala experience to your code base regularly you will probably want a different language or to severely limit your allowed feature set.

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

  • Hatred is such a strong word ....

  • It's disappointing to see Scala diehards coming here and downvoting anything that isn't glowing sycophantic love of scala. That's not leaving a good impression to the neutral crowd at all.

    Here's an example of a post censored from StackOverflow: http://stackoverflow.com/questions/3606591/why-does-intellij...

    Here's a backup of the post that was mirrored: http://w3facility.org/question/why-does-intellij-idea-compil...

    There is one word to describe the mind of a scala die-hard: Solipsism. The view or theory that the self is all that can be known to exist. [1]

    [1] https://news.ycombinator.com/item?id=9389563

    You see the way they squirm? They can't accept any criticism and therefore refuse improvement. They just want to sit there and be hobbyists. Not on my investors' dime!

  • I think it's because they went into it for the wrong reasons. If you jump into a language because it is the latest fashion, and not for solid engineering reasons, then it will be an uphill struggle to reach your goals.

    I have only dabbled in Scala myself, kicked the tyres as it were. My question was, is this an Ocaml or Haskell with good interop with the Java ecosystem? The answer is no but I don't hate Scala for it, I just moved on. But many folks would have persisted and tried to make it into something it's not and gotten miserable in the process.

  • So normal caveats apply, this is all personal opinion, experience, etc. I recognize many people like Scala, it has lots of use out there, I am in no way denigrating its use in production by experienced developers, etc etc.

    I have both an OO and a functional background at this point. OO was in Java, Smalltalk, and Ruby, and functional has been predominantly in Erlang. I have used both paradigms exclusive of the other. So I should find Scala exciting, since it combines the two, right? Well...no. I'm really not a fan. Why?

    First, I've come to really embrace functional coding. To where OO just seems unnecessary. Many problems that seem ideal for OO...still end up more elegantly implemented in functional paradigms (though are sometimes more work to figure out). A lot of the Scala gurus seem to end up predominantly functional coders, where objects are just a way of organizing their code in lieu of modules. Occasionally inheritance and whatnot may come in handy, but oftentimes it's an unnecessary part of the language. So it mostly ends up as a functional language.

    Still, though, having the option of OO is good, right? I mean, more options? Well...no. One of the things I like about FP is it forces me to do the right thing more often. Having immutability be the default (or only) option means I'll write my code that way; having it coexist on equal terms with mutable code means I'm always tempted to take the easy (but likely problematic) route. And mixing paradigms on large scale projects seems...exceptionally dangerous.

    Having both paradigms ends up reflective of the common issue people have with Scala; too many options. Too many paradigms, too many syntax choices to achieve the same effect, too many ways to make things implicit, too many decisions you as a programmer have to make. "This is really elegant" - yeah, sure, if you wrote it; it's extremely cryptic if you are just reading someone else's code though. Etc.

    I started trying to learn Scala as my first FP language. I mean, it makes sense, I know OO, so this way I can ease my way into learning FP, right? Well...no. It never worked out that way. Having that escape hatch of mutability, having that distraction of OO type hierarchies, meant I never was forced to figure out how to do things immutably, never really saw the benefits of organizing my code into composable functions rather than these 'objects' (type hierarchies feel like bikeshedding to me now; sometimes they can be useful, but too often it's just architectural masturbation; how do we avoid painting ourselves into a corner, when if we just put them into modules based on what makes sense right now, and weren't concerned with type, we could easily move functions around as makes sense later when requirements change, without destabilizing this entire hierarchy).

    I'm not saying you can't learn FP in a mixed paradigm language, only that I personally did not have the discipline or knowledge to do so in a reasonable time (too many features; which ones allow me to write functional code, vs which ones lead me to more OO? The ones I know, and think in, and am most familiar, are the OO ones, and FP is kind of an abstract term, how do I make sense of this and use the right bits to force me to learn something new?) What worked for me was going straight into a fairly concise language that forced a number of FP concepts on me (Erlang), and solving problems with that. I was grokking things within a week or two, and actually writing some non-terrible code within a month (still plenty of terrible code, as my +2 years of experience self reflects on, but some of it was actually tolerable). I did not manage that with Scala.

    Now, with all that said, I feel like if I went back to Scala, I could use it as an FP language (and possibly even mix some OO if there was just an obvious benefit). I'd still have to figure out what syntax choices to use and which to avoid, I'd still have to avoid some bad design choices, things which aren't unique to Scala, but which the language presents you with more choices in. I personally find that distasteful, if I needed a JVM language I'd probably go Clojure, since it has design choices that better match my own preferences, but that's just it, it's a matter of taste.

  • Bloated,complex, perl syntax, slow compilation times, bad attidude of the Scala community. Please, don't waste your time trying to learn Scala.