by azinman2 · 11y ago · 0 comments
My perspective of dev'ing in scala since 2009 (and I love scala):
"Scala isn't that complicated, just takes some time to learn."
Scala is complicated. Like really potentially super complicated, and the compiler error messages can be hyper-cryptic. It was written by academics (versus "developers") and it shows.
New developers will end up asking someone else a basic language question about every 10 minutes, mostly because they don't even know what to google for.
I've been using it for years and I still have to lookup prepending versus appending to lists because I can't remember if it's x :+= y or x +:= y, let alone ::: versus :: versus ++ or ++=. Really? Why not #!:@## while we're at it?
It's crazy that in these slides he says "I wanted a hipster language" -- most languages use [] for arrays so I used (). WHY!!!!? Just to be different? No actual real advantage? That's a terrible reason and a great way to make it hard for new people to adopt your language.
It doesn't help that there are 50 ways to do the same thing and the language is totally agnostic as to what you should do. It's almost like being an alien, coming to Earth, and trying to learn to have sex with humans from someone who is bi-sexual and into every fetish there is.
---
It would be really great if they could canonicalize the language in the way that python has, and once having done so further simplify their syntax so mere mortals can use it effectively. Programming is hard enough without the language being difficult, too.
It's crazy that in these slides he says "I wanted a
hipster language" -- most languages use [] for arrays so I
used (). WHY!!!!? Just to be different? No actual real
advantage? That's a terrible reason and a great way to
make it hard for new people to adopt your language.
You might not get it, but the slide makes fun of knee-jerk reactions like those shown in your comment.Scala does things for a good reason. Not caring to figure out the reason doesn't mean the language is wrong.
Another reason is that an IndexedSeq is really itself a function (extends Function1), so the parens are literally function application, not some specially interpreted syntax for indexing.
Scala makes sense and has a logic behind all its reasons, but sometimes it seems to go against convention for the sake of its own philosophy.
I would characterize this sort of thinking as one of the core principles of the language design. The designers search for underlying generality and bring it to the surface of the language. This can be a little frustrating at times, since humans aren't necessarily geared toward abstraction. But investment in understanding the abstractions pays off again and again.
But does that mean everyone agrees with the rest?
func<Future<List<Option<String>>>> vs func[Future[List[Option[String]]]]
Which one is easier on your eyes?
>Which one is easier on your eyes?
i don't get the joke here. Or are you seriously implying that one is in someway better than the other? (i'm curious as i've been in the industry for more than two decades, so my eyes just filter that crap automatically anyway)
func<Future<List<Option<String>>>>
func[Future[List[Option[String]]]]func(Future(List(Option(String))))
Func (Future (List (Option String)))compare that to Java - landing and learning how to do it in 16th century somewhere like Spain - engaging in that sinful activity in the most vanilla and least sensual way with only purpose of procreation and only when. Thanks God progress can't be stopped :)
Parentheses for array and map access really bugged me until I grokked functors. They're really all doing the same thing, and the mathematical symmetry of using the same syntax for all of them is very pleasing.
Prepend and append are very different. And you do need to know, because for many scala collections one is O(N) and the other is O(1) [1], plus the importance of knowing order.
The difference between x :: y and x ::: y could mean List(List(1), 2, 3) versus List(1, 2, 3).
[1] http://docs.scala-lang.org/overviews/collections/performance...