[quote]Oh, and did I mention… anyone who dislikes operator overloading is a foul heathen.
[/quote]
As a day job professional c++ developer who has to maintain other peoples “creative” c++ code I can categorically say that the ONLY instance in which operator overloading has not caused more pain than it is worth is ‘+’ for string concatenation. Even that is suspect because it breaks the commutativity property of numeric addition.
Operator overloading should ONLY be defined by the language and ONLY for immutable types and ONLY where it makes logical sense. If you think operator overloading is only abused by bad programmers consider the fact that one of worst cases I have seen is the “bit-shift is totally logically similar to stream concatenation” in the c++ STL.
On closures:
Have investigated a few times and still don’t really understand the concept fully. Anonymous inner classes have served me fine for the rare cases when I have needed them. I have always wondered how likely closures are to introduce obscure bugs and how they impact debugging.
The day I switch to Python will be the day operator overloading is added to Java.