3 ms·
What "useless sigils and buzzwords" does Scala have?
by octo_t 13y ago
What "useless sigils and buzzwords" does Scala have?
- lmm 13y agoThe Dispatch periodic table is probably a discredited meme by now, but it's all too representative of many scala libraries. Akka uses ! and ? for its two most important methods (and a pet moan: the experimental typed channel proposal uses :+: for type-level lists despite their being functionally the same as shapeless' :: HList). Shapeless constraints can't even be typed on a normal keyboard - they're things like ->[A]#λ or <<:[B]#λ (real examples from my day job). Scalaz is only slightly better (pulling up a random example I see "@@" used as an operator). Sometimes these sigil operators have non-sigil aliases but that's the perl trap of "there is more than one way to do it" - one can't just ignore the sigils because one has to read code as well as write it (and given that even quite major libraries like scalaz come with no scaladoc, one is often forced to read someone else's code to figure out what a function does). I love scala, but I do find myself wishing method names were required to be alphanumeric.
- octo_t 13y agoBoth ! and ? have their history in Erlang, it was a conscious design decision to use those sigils. I've not looked at typed channels at all, but yeah, thats annoying. Scalaz and Shapeless are designed to do crazy type level stuff, taking their inspiration from type/group/set theory. And yes, I agree Scala is the successor to Perl (but I have no problem with that :p )