Fake Operator Overloading in JavaScript (2011)
2ality.com
2ality.com
> But at the very least, fake operator overloading allows you to impress your friends by unusual-looking code.
Couldn't agree more. Please, please don't use this in production.
Edit: Just wrote the following piece of code:
coors[0] = ~~cors[0];
Damn.However - I totally agree that this hack shouldn't be put to real use. ES7 gets value objects with proper operator overloading that shouldn't suck.
Is it possible to identify an arbitrarily long string of operations when you can only control side effects and the return value?
I haven't been able to come up with anything.
Yeah, that's probably an understatement.
http://rosettacode.org/wiki/Hello_world/Text#Malbolge
A choice quote from Wikipedia: "Weaknesses in the design have been found that make it possible (though still very difficult) to write useful Malbolge programs."
Many languages are deliberately made to be difficult to use, but in the end they're always made to be used. Malbolge is the only one I'm aware of where the ability to write programs at all is a "weakness."