Swift Thinking [video]
realm.io
realm.io
On the conventionality side: Cocoa is known for its consistency in naming and behavior.
Such meta-level code should be encapsulated well and be very useful.
My personal preference is to allow operator overloading, but to (a) enforce that overloaded operators must have reasonable type signatures (via concepts or similar); (b) restrict overloadable operators to mathematical operators (e.g. not the comma operator), and (c) set a good precedent in the standard libraries and community against using mathematical operators for non-mathematical operations (e.g. don't overload bitshift operators for I/O in the standard libraries).
More seriously, I wonder why user-defined operators are considered any worse than user-defined functions. I mean, I think that they often are, but I wonder why.
Maybe we assume less potential for ambiguity when we read a symbol than when we read a word. The possibility that isEqual: has a bad implementation that doesn't respect transitivity seems more obvious than the possibility that == does.
User-defined functions can take more than two parameters. User-defined operators have one or two parameters (allowing rare exceptions).
User-defined functions can have any signature and specify any contract. To prevent surprises, user-defined operators should return a boolean or a number. Not a Maybe<Number>. Not a return code. Not a LazilyConvertsToFloatWhenYouCopyIt.
That being said, I like user-defined operators and the ability to overload operators. But there are tradeoffs, just like in any engineering decision.
User defined functions have names that we can understand, because we already share a common language - English. If we started "making up our own words" for functions, then we're doing just as bad as user-defined operators - nobody will recognize what the hell we're doing without looking up their implementations. It's like reading obfusticated code, or code in some language you don't know. If every programmer invents his own operators, good luck ever getting shit done - people don't have the time to learn some arbitrary language you conjure up just for the sake of shaving a few characters off code. Nor should anyone need a PhD in mathematics to understand the strange notations in your examples/proofs.
Operators cannot be searched for in the same way ASCII text can - we need specialized search engines which don't ignore characters - and they generally need to be written on a per-language basis to be useful. I think the time wasted doing this far exceeds the benefits user-defined operators provide.
Also, many unicode characters look alike, and it may be possible to utilize this in malicious ways where arbitrary characters may be used - by assuming someone reading/reviewing code will not look up the code points of every character. Having a limited set of characters makes it pretty simple to distinguish each one, unless you have poor fonts and can't make out differences between 1,I,l etc.
Operators are useful for sure, but they're never necessary. More to the point, they are just functions - treating them specially is silly, because it's much more useful to abstract over functions of any arity than to abstract over only binary functions.
It is kinda similar to how we can invoke methods on 'nil' in Objective-C and not causing any runtime error.
Just stating if anyone is wondering.