Hacker News new | past | comments | ask | show | jobs | submit login

> I would start with operators and operator overrides, most of the time they don't make sense and it's difficult to know what it does, that's why most other languages banned them.

Yeah, that's what I was talking about - in Scala operators are just functions, and badly named operators are an issue with some libraries rather than an issue with the language. They're unfortunate, but all one can really do is avoid them - no language is impossible to write bad libraries in. Certainly I wouldn't ever want to go back to a language that uses magically-named methods for operator overloading, like Python and Kotlin do - I find that far more confusing, I can never remember whether a * b is calling a.__times__(b) or a.__star__(b) or something else. I could get behind a language that disallowed symbolic names entirely, but I don't think I've seen one of those since Java.

> Secondly, the implicit concept makes the code difficult to read.

IDE support has gotten a lot better now (green underline to highlight any implicit conversion, expand out implicit parameters) which makes them much easier to work with. If you only use implicits in cases where you otherwise wouldn't do anything in code at all, they enhance readability - but of course if you use them to replace things that you'd otherwise make explicit then they can reduce readability. I don't have a good answer, because I definitely want extension methods, typeclasses with derivation, and the magnet pattern, but I haven't yet seen a language design that makes those things possible while disallowing the bad uses of implicits.




most of these criticisms I agree with but I don't blame scala as a language for it. I write, and encourage my colleagues to write, code that is very easy to follow and reckon about. Few obscure operators, almost zero implicits....


What IDEs support this behavior?


Both eclipse and intellij will underline implicit conversions. Showing implicit parameters might be intellij-only.


Emacs + ENSIME also underlines implicit conversions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: