Hacker News new | ask | show | jobs
by jbooth 4711 days ago
Sure, the crazy symbolic operator overloading and a bunch of libraries that encourage you do do things like a :=: b and have it mean something.

Also, there's something about the net sum of the type system where it feels like there are a lot of concepts at work and it's easy to get lots with what type something is, exactly, especially if you didn't write the code and you're just skimming it.

1 comments

Scala has neither operators nor operator overloading and I don't know any library which "encourages" doing those crazy things.

There are a few places where symbolic method names are used, and in pretty much every case, it is well-established prior art: +, -, *, /, etc for math operations, ! for sending actor messages (Erlang), &, | ,^ for bit operations (C and friends).

Regarding the type system ... well, the alternative is stuff like reflection and casting. Both introduce the possibility of runtime failures and make refactoring and reasoning a lot harder.

Sure, sometimes a well-placed I-assume-this-can-never-fail cast is exactly what one needs, but I'm happy that Scala gives developers another, safer option here.