4 ms·
It doesn’t matter, you can look it up easily because without overloading, you know exactly which implementation will run.
by throwaway894345 3y ago
It doesn’t matter, you can look it up easily because without overloading, you know exactly which implementation will run.
- pjmlp 3y agoAh, just like I do when I press F12 over an operator.
- enriquto 3y agoYou come across as a bit facetious here. Of course, the compiler or an advanced IDE can know what your code means. If all your identifiers were random permutations of l and I: lIllI1lI, your IDE would not mind either, but the code would be horrific, don't you agree? The point of the OP is that overloaded operators (and functions) make it harder to reason about the code for a human that reads it. At least for some people. At the end, everything is "just" syntactic sugar, but it makes a significant difference.
- throwaway894345 3y agoExactly. If you don't care that the code is unreadable and you can rely on every human viewing the code through an IDE with symbol resolution (and not say, online code review platforms) and remembering to use said symbol resolution to check every operator, then operator overloading is great!