3 ms·
You're right readability is important, and Scala fails terribly in that department. I worked with Scala for around 6 months or so at one point, and I was still
by yogthos 8y ago
You're right readability is important, and Scala fails terribly in that department. I worked with Scala for around 6 months or so at one point, and I was still constantly looking things up after months of using the language. There's simply too much syntax and weird quirks in the language that it becomes impossible to keep it all in your head.
- lmm 8y agoNot my experience - I found Scala's syntax is a lot more consistent than most mainstream languages (though, yes, it certainly doesn't go as far as lisps). Operators are just normal methods. Rather than complex rules about which constructs require braces, everything permits an expression or you can put a braced block of statements anywhere you could put an expression. Rather than a bunch of different special case syntaxes for collections / async / possibly-absent values, you have a single lightweight syntactic sugar (for/yield) that translates directly into plain old method calls. There are some libraries out there that make poor choices of method name, but that's about all.
- yogthos 8y agoMy experience with Scala matches this pretty closely https://www.reddit.com/r/scala/comments/4246qc/heres_why_scala_sucks/ https://www.reddit.com/r/scala/comments/4246qc/heres_why_sca...
- lmm 8y agoThat's a strange set of complaints for a clojure advocate, since most of what they're complaining about is not too much syntax but too little - no mandatory braces, mandatory brackets, mandatory types. Indeed "a -> b" for "(a, b)" is not syntax or even a macro, but just a function. _ is genuinely costly syntax, as are by-name parameters (though less costly in an age of IDEs). I consider _ to be worth its while (indeed I miss it a lot when writing lambdas in any other language); if you're going to have syntax in your language at all then it's one of the most general-purpose, effective constructs I've seen.
- yogthos 8y agoThe problem isn't whether there's too much or too little, it's that the syntax is incredibly inconsistent. There are a million ways to do anything, and you have to juggle it all in your head. Consider stuff like this: https://twitter.com/pembleton/status/1116343189437394944 https://twitter.com/pembleton/status/1116343189437394944 A new line can be significant syntax in Scala! With s-expressions, all of this mental overhead goes out of the window. I have regular boring syntax where pretty much everything works the same way. It's incredibly liberating. On top of that, s-expression syntax facilitates structural editing, where I'm manipulating the code tree semantically as opposed to thinking about moving lines of text around.