4 ms·
> Says who? Says at least me and the OP, and probably others... I haven't put a ton of time into learning Scala and only occasionally interact with it, but in
by apendleton 12y ago
> Says who?
Says at least me and the OP, and probably others... I haven't put a ton of time into learning Scala and only occasionally interact with it, but in that capacity I'd definitely say I find it a bit intimidating and someone hard to read. Certainly there are many ways to write Scala, and a Java-like style is doable, but idiomatic Scala, as far as I've seen, encourages terseness and the use of opaque punctuation-laden operators that aren't immediately interpretable by people not familiar with the language.
Whether legibility from non-experts is important is absolutely a matter of opinion and personal taste (it's a clear source of disagreement between the Python and Ruby communities as well), but if you're someone who thinks it's an important property for languages that get widespread adoption to have (and I am), looking at Scala code as it seems to typically be written would give you (or at least gives me) pause. I can look at Swift without having ever written any and know roughly what it's doing. I can't with Scala. I don't think they fill the same niche, as the poster seems to be advocating that they could.
- smrtinsert 12y agoI'm a non expert in Scala and after a little learning it is extremely legible and provides many ways to clearify your syntax. If you're arguing that syntax should be obvious, I think that's a non starter in a technical argument. That's like believing that programming should be possible without programming.
- mgkimsal 12y ago"I can look at Swift without having ever written any and know roughly what it's doing. I can't with Scala." Gut feeling, Scala is the new Perl. At least with respect to 'idiomatic' Scala/Perl encouraging a terseness, as well as a fairly deep/loyal (if small) fan base. Also, many of the use cases where the language shines tend to be non-mainstream - usually other languages handle mundane 'every day' use cases differently, perhaps more verbosely, but also with a lot more developers on board. Just a thought that popped in to my head. I've no doubt I've offended the very core of many Scala and Perl devs out there just now. ;)
- saryant 12y ago> but idiomatic Scala, as far as I've seen, encourages terseness and the use of opaque punctuation-laden operators This is not idiomatic Scala. http://docs.scala-lang.org/style/naming-conventions.html#symbolic_method_names http://docs.scala-lang.org/style/naming-conventions.html#sym... > Avoid! [...] As a general rule, symbolic method names should be well-understood and self documenting in nature. The rule of thumb is as follows: if you need to explain what the method does, then it should have a real, descriptive name rather than a symbols. There are some very rare cases where it is acceptable to invent new symbolic method names. Odds are, your API is not one of those cases!
- benburton 12y agoI think this is actually the crux of the issue. The language gives you enough rope to hang yourself with, and when people do hang themselves with it, those who look in from the outside throw the baby out with the bathwater.
- saryant 12y agoI think that's definitely it. That old Dispatch periodic table has done a lot of damage to Scala's reputation IMO (even though it's no longer used by Dispatch). Looking at the major Scala libraries and frameworks today, I don't see a ton of symbolic operators in use. Akka just has ! and ? (both of which have very obvious uses once you understand actors), Play only uses them for iteratees (which most devs will never have to think about, plus it provides named equivalents for all of them), SBT has been cutting back. Outside of scalaz, the problem seems to be under control.
- tormeh 12y agoScalaz is not even ASCII. That shit's seriously scary.
- tormeh 12y agoScala doesn't really have an idiomatic style. There's no "The Scala Way" to do things. What you've encountered are functional programmers who really love terse programming, but terse programming is no more idiomatic in Scala than Java-style programming. You can even keep the semi-colons and explicit type declarations if you want.
- apendleton 12y agoYeah, I understand that, but I think (and this is probably the Python programmer in me talking) that there's value in encouraging a preferred way of writing a language that facilitates people reading each other's code. I want there to be an idiomatic style, and ideally that style would be relatively legible.
- tormeh 12y agoThis is Scala. It has dependent type support and loops with global state. Basically, there's no unified community. No one agrees on anything, except that everyone else's code sucks.
- frowaway001 12y ago> I can look at Swift without having ever written any and know roughly what it's doing. I can't with Scala. You realize that Swift not only resembles Scala syntax closely, but also adopts many of the same concepts?