> In languages that have it I've never used operator overloading to produce anything good or that was obviously better than just using methods.
I used a Scala library for S3 once that overloaded + to mean upload.
var bucket; var file;
bucket + file;
Which is obviously bad and unnecessary.
It's really a feature that should be used very rarely by those who make basic libraries, but there it can make a lot of sense - data structures, numeric types, etc.
I used a Scala library for S3 once that overloaded + to mean upload.
Which is obviously bad and unnecessary.It's really a feature that should be used very rarely by those who make basic libraries, but there it can make a lot of sense - data structures, numeric types, etc.