3 ms·
> My gut says the probability of a random typo executing without raising an error or exception is rather low In many code editors, numerous fat fingered shortc
by lloeki 13y ago
> My gut says the probability of a random typo executing without raising an error or exception is rather low
In many code editors, numerous fat fingered shortcuts could produce such a compilable line duplication/deletion (deletion because maybe that's not a goto line duplicated but a test line deleted).
I'm baffled that neither clang nor gcc spits a warning for the unreachable code.
Not trying to shift blames or anything, but rather than do some finger pointing, I'd rather see this as a warning for all of us to ramp up our game and better our tools so that everyone benefits, reducing the risk of both honest and intentional or covert[1] malfunctions.
[0]: example custom shortcut as ^d to duplicate (could have been cmd(+shift)+D, which sits right along cmd(+shift)+S): http://www.xinsight.ca/blog/xcode-trick-creating-a-shortcut-to-duplicate-a-line/ http://www.xinsight.ca/blog/xcode-trick-creating-a-shortcut-...
[1]: http://en.wikipedia.org/wiki/Underhanded_C_Contest http://en.wikipedia.org/wiki/Underhanded_C_Contest