Live data from Hacker News

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

news.ycombinator.com

61–70 of 134 posts

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

#61
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-...

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

#62
post #30

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

There's actually a port of OCaml to the JVM that has pretty good interop with the Java ecosystem, or at least it will once it's out of beta: http://www.ocamljava.org/ .

Looking back at my blog, this was in 2011. I am not doing much OCaml these days either, actually.

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

#63
post #55
post #40

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

I know the plural of anecdote is not data, but every time I've asked a question in #scala I've received nothing but helpful and welcoming responses.

Most of the time that's what you'll get. But there are (or at least were when last I was there) two or three people who will respond unpleasantly, and I want to be honest about that.

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

#64
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.

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

#65
post #60

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

> if you're problems are much better expressed in Haskell, why are these developers not using Haskell?

Generally because your boss won't let you.

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

#66
post #52
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) Isn't this true for all languages, and in fact isn't that the hallmark of a _good_ programming language? One could also argue that this provides evidence of simplicity, as many smaller building blocks can be assembled in different orders to produce the same (complex) result. The antithesis is when we see posts about how "Go's too simple".

From 'The Zen of Python' - "There should be one-- and preferably only one --obvious way to do it."

I'm not sure I've seen any "Python's too simple" posts. Maybe Go's criticism is based on some other factor?

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

#67
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…

The problem with a survey asking people how much they love their language is that people will employ all kinds of biases to suppress the cognitive dissonance of choosing a terrible language.

The harder something was to succeed at, the harder you'll try to convince yourself it wasn't wasted effort.

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

#68
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.

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

#69
post #40

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

I'm a professional java dev - groovy definitely does show up on our radar as it's used as the glue for a lot of tools related to our "production" code.

For example gradle buildscripts are groovy, as is the spock test framework.

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

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

Post reply on HN