2 ms·
I'll fully agree with you on monkey patching, I think the extension method system on .NET is a far better idea. Operator overloading can be used stupidly but t
by fleitz 15y ago
I'll fully agree with you on monkey patching, I think the extension method system on .NET is a far better idea.
Operator overloading can be used stupidly but then again so can just about any feature. Operator overloading is no more clever than method overloading.
- jbooth 15y agoWell, I guess we just disagree on the operator overloading.. I agree that it's fundamentally the same in one sense, but in another sense it's much more likely to sneak up on you than method overloading, especially if you're in an environment that doesn't allow monkey-patching. It's always fairly obvious which version of collection.add() you're invoking, and can be much less obvious which version of '+' you're invoking. IMO you need a much bigger productivity win to justify operator overloading, and aside from numerics, it's usually not there.