3 ms·
There is exactly one good reason against operator overloading, and that’s operator<<. People are mostly sane otherwise and it’s a good thing to have.
by saagarjha 4y ago
There is exactly one good reason against operator overloading, and that’s operator<<. People are mostly sane otherwise and it’s a good thing to have.
- kaba0 4y agoArbitrary overloading can be problematic, like !#< or whatever is quite hard to look up (scala, haskell), but I agree that implementing an interface/trait that will give you that syntactic sugar is mostly okay (like Rust, e.g. implements Add would give you + operator).
- vips7L 4y agoI remember working in some scala that used akka actors and seeing ! for the first time. Something like: actor ! someData It was just an operator to send the data to the actor. A named function would have been so much better.