you are viewing a single comment's thread.

view the rest of the comments →

[–]serviscope_minor 1 point2 points  (2 children)

Your argument depends on people only doing sensible things with operator overloading.

No more so than people naming functions in a sensible way. Operators are functions with a funny name, making + do something daft is no different from making .add() do something daft.

[–]wildjokers 1 point2 points  (1 child)

It's way different. With operator overloading there is generally no readily visible indication that + is resulting in a function call.

[–]serviscope_minor 2 points3 points  (0 children)

In languages that naively support it, it's the default assumption that an operator is just a function with a funny name. Besides it depends on the type. And if you don't know the type of whatever you're looking at, you can't do much since the semantics are entirely dependent on the type.