Here is an email I received in response to one of my essays.
It defines a union of char[4]; and uint, inititializes the int using a function call, then the argument to return is a huge single line of &&, ||, <<, >>, <, >, == etc. operators. The idea is to return a boolean value. The single comment is /* cool hack, gene */
Now, I don’t really have a problem with the union, nor the long gross return. The real heinousness is that all the test values are literals! Have a little typo accident with emacs, vi or msvc or whatever anywhere in that line and you get a virtually untraceable bug! The code will compile and run just fine changing values or operators willy nilly! It will even work correctly most of the time!
There is of course, not test function written for this code. Even better, the author is now CEO (Chief Executive Officer) at a startup…
Uh oh… boss just drove in…
This page is posted |
http://mindprod.com/feedback/unmain/union.html | |
Optional Replicator mirror
|
J:\mindprod\feedback\unmain\union.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.15.198.120] |
| |
Feedback |
You are visitor number | |