Re:Five bugs in a single line of JavaScript
by swiecki on Friday November 18, 2011 @11:26AM
(#3252246)
I guess these just don't match my personal definition of a software bug... I was expecting an unexpected result as a product of good programming. This is just "5 reasons this line of javascript shouldn't have been written" and seems to be more about UNIX permissions than code.
[ Parent
| on HN ]
Re:Five bugs in a single line of JavaScript
by jemfinch on Friday November 18, 2011 @12:23PM
(#3252490)
I don't know anyone who defines a "bug" as "an unexpected result as a product of good programming." Bugs are when code is wrong: when it doesn't do what it says, when it doesn't do what was asked of it, when it doesn't do what the user reasonably expects. Bugs are not the result of good programming.
Re:Five bugs in a single line of JavaScript
by Wilduck on Friday November 18, 2011 @02:22PM
(#3252986)
I disagree. I would say there is a distinction between an error and a bug. There's certainly some grey area there, but, for example, if my code sets permissions for a directory instead of a file, I made an error. If my code sets permissions for a file, but produces unexpected results in certain cases because of an implementation detail, then that's a bug.
Re:Five bugs in a single line of JavaScript
by eridius on Friday November 18, 2011 @04:14PM
(#3253441)
A bug is code that doesn't behave as the author intended it to. It doesn't matter if the bug is due to some subtle interaction in the language, or just plain bone-headedness on the part of the programmer.
Re:Five bugs in a single line of JavaScript
by jmilloy on Friday November 18, 2011 @11:51AM
(#3252348)
Is it at all possible for there to be 5 distinct and unexpected results caused by a single, well-written line of code? You're right that these aren't subtle bugs affecting a large piece of software, but why would you expect that given the title?