Hacker News new | ask | show | jobs
by hp 4465 days ago
Scala doesn't have operator overloading btw. It just doesn't restrict method names very much. This is very different from how C++ treats operators as special cases.

If you give your methods bad names, it really is not the language's fault. You can probably find a way to make a bad API even if you are limited to a-zA-Z0-9 ...

If a library has an inscrutable set of method names blame the lib not the language.

2 comments

Operators are treated specially in scala. Methods with certain names have wildly different precedence rules.

The special operator rules allow library authors to create a "DSL" without using the (difficult) macro system. This almost never ends well.

I know that, and I use the term only because the author did. I agree that it's the fault of library designers not on the core language, but it is still a legitimate issue to raise.