5 ms·
"Authentic Operator Overloading" is already a bad idea, so a "Fake Operator Overloading" will be a bad implementation of a bad idea. You may better title the ar
by lucio 12y ago
"Authentic Operator Overloading" is already a bad idea, so a "Fake Operator Overloading" will be a bad implementation of a bad idea. You may better title the article "Casual inadvertent code obfuscation c++ tools fake-implemented in javascript: enjoy!" :)
- blubbi2 12y ago> While fake operator overloading is a fun hack, you probably shouldn’t use it in production code. > 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.
- inglor 12y agoI totally get why people _want_ operator overloading - it is immensely useful when performing arithmetic. Writing `x+y*z` is easier vs `x.add(y.mul(z))` and I think everyone who had to do statistical analysis agrees. 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.