|
no. the problem is that scala allows almost any string of characters as identifiers, and this encourages programmers to use symbols instead of english words for their function names. So you end up with identifiers that convey no meaning whatsoever, like /:\ or >>:. Sure, this can be in fact very nice if you are writing a DSL for a problem that already has its own well-known set of symbols, like a branch of mathematics. However, what happens in reality is that most programming is "business" programming. But still programmers use it for everything (because we're lazy and typing :: seems faster than "append"). The scala api leads the way here. For example the list class: http://www.scala-lang.org/api/current/scala/collection/immut... The following are all subtle variations on append and prepend: ::, :::, ++, :+, ++:, +: Can any non-scala programmer guess which one is which? When you move on to the Map or Set class, it's a little bit the same and a little bit different. Sure, at one point you will remember all of this by heart, but the same pattern repeats itself when you try to use another library: it defines its own little language, instead of using the one common to us all: english. Note another huge drawback, for me at least: you can't google such symbols because of course search engines will treat them as noise. Even searching for them with regexes is tricky because you can't use word boundaries. The argument I heard over and over is that you can make non-sense function words even if you're restricted to alpha-numeric. This is true, and it happens. However, if I call my function "append" or "xyz", and what it does is "prepend", it's obviously the wrong name and you can point it out. Symbols, on the other hand, are arbitrary, and it becomes a question of taste. edit: removed some list operators added in error, thanks Inufu |
I guess this is something that will settle down eventually. And programmers will stop using so much random symbols instead of English.
For the specific case of Lists, I don't think is that much trouble. It is the most important class of the language. You better get used to it anyway.