Hacker News new | ask | show | jobs
by dkhenry 4931 days ago
I don't think its dismissive, The truth is Scala is _not_ complicated. People can do complicated things with it, but in general the language poses no real barrier to entry. Now the second point you bring up is more of an issue that I run into at times as well. Where I find a solution to a problem that presents itsself as the "Scala" way of doing something, and After i close my browser and go home for the day I forget about why I did that and show up the next day staring at magical Glyphs on the page that appear to work ( ohh i needed :>> not >:> ). To solve that problem you need to stop doing things you don't understand and instead take the long way around and write out function names instead of using the shorthand operators that your provided with. Once you get used to a library you will commit the operators to memory and you will know that :: is cons and ::: is list append and you won't have the "what did I do here" problem nearly as much
2 comments

That's good for small teams/individual developers, but it really does become a nightmare in 5 years time. How do we know this? Go ask anybody who has had to maintain any kind of Perl code.

Scala is still very nice, but you need to exercise very heavy restraint so you don't end up with write-only code. (Java, and every other language, does admittedly have the same problem: I've seen Java code made up of so many levels of interfaces that tracking down what it does is almost impossible. Obfuscated C/C++ is a true terror. Ruby can get very nasty if you go 'off the rails'. etc etc.)

Right its a problem that exists in every language, there is nothing novel about scala that lends it to being any more cryptic then c++, other then there is a different set of rules as to what can be used where. Operator overloading in C++ is just as bad as scala, but most c++ programmers are used to it since they have seen it for a while. The first time I saw :/ I was really confused as to what it was since that's not an idiomatic C operator, but after seeing it in a few places you get used to the fact that its an operator and you read through it, just like I would if I saw a << in C++
I don't think its dismissive, The truth is Scala is _not_ complicated.

No. You think it's not complicated. I think it's complicated but manageable and that its real problems lie elsewhere. Claiming your position as "the truth" is dismissive and insulting to people who have the temerity to disagree with you.

As for your second bit--the thing is, I do not use "shorthand". The problem, I feel, lies more in the haphazard (to a reader) usage of "code punctuation marks" like braces and so forth. You find situations where they're used inconsistently or not at all, making it much harder for the eye to pick up what are otherwise natural breakpoints within the code for your eye to use to parse the intent of the code. Other design decisions such as including initialization logic in the class body, versus using a dedicated constructor method, contributes, for me, to a general sense of chaos. I do not feel like a lot of effort was put into writing a language that is conducive to reading the next day.

Note that I am not saying that you cannot write clean code in Scala--but I am of the opinion that the language's design is such that it does not encourage it.

No claiming that complexity is _subjective_ is dismissive. there is complexity and there is simplicity. There is also perceived complexity and perceived simplicity. As far as languages go Scala is pretty darn simple. There is very little going on in the background and the core of the language was designed to be a small set of orthogonal features that can be layered to build complex pieces of software. The perceived complexity is something we can argue about as it is subjective which is why you need to take a look at what your doing and how you might alter your practices to make it a more readable and simple implementation. You will always run across bits of a language that you will not understand, that doesn't mean the absolute state of the language has changed just your perception has changed.

This happens every time new developers run across a piece of Object Oriented C code with run time function overloading, their default reaction is I don't know whats going on this is too complex. C didn't magically become a more complex language because we introduced a new guy to function pointers and dynamic dispatch. Likewise Scala doesn't become more complex the first time you need to understand why marking your types as being covarient is important.