3 ms·
> More lines of code usually indicates more bugs so its not an entirely useless metric. This is conventional wisdom, but it still feels dubious. Often I see a
by rileymat2 2y ago
> More lines of code usually indicates more bugs so its not an entirely useless metric.
This is conventional wisdom, but it still feels dubious.
Often I see additional lines of code added to remove a bug, without adding a bug. So comparing the before and after more lines means less bugs.
On the flip side it often indicates more capability, which is more lines, more bugs, more complexity, but also a very unfair comparison.
I am not completely sure what I am getting at here; but, it seems like there are alot of confounding factors.
- boyter 2y agoWhile you are right, in that you add lines to remove bugs, I suspect its still true to say given 2 projects, written in the same language by the same person, on average the one with more lines is more likely to contain more bugs.
- rileymat2 2y agoYes, I was going to add another paragraph about more skilled developers using less lines and creating less bug. But this is not true unless the less skilled implementation considers corner cases.
- spc476 2y agoI've seen it stated as, "It is a bit of received computer science wisdom that any program has at least one superfluous line and at least one bug. Apply this rule recursively and you can see that any program can be reduced to a single line with a bug in it." And for proof---http://en.wikipedia.org/wiki/IEFBR14#Implementation http://en.wikipedia.org/wiki/IEFBR14#Implementation
- plorkyeran 2y agoIn my experience it is very common for the additional lines of code added to fix a bug to turn out to introduce a new bug of their own. The ratio of bugs to lines of code is obviously not constant, but fixing known bugs changes it less than it appears to.