3 ms·
Not only LOC is a poor indicator of bug occurence but strictly speaking it's not even positively correlated. Some of the worst bugs are errors of omission, forg
by reinhardt 14y ago
Not only LOC is a poor indicator of bug occurence but strictly speaking it's not even positively correlated. Some of the worst bugs are errors of omission, forgetting to handle special cases. Minimizing such cases is a noble goal leading to both less LOC and bugs but unfortunately the real world is riddled with them.
- SomeCallMeTim 14y agoMissing the point. If I create an algorithm in X lines of code in one language, and I can create the same algorithm in another language in X/10 lines of code, it will be easier to understand the latter IF ONLY because it's more concise. And easier to understand means that, given a spec, it's easier to see that it's been implemented, special cases and all. And easier to understand also means the bugs will be more obvious, easier to prevent in the first place -- and easier to find and fix when they do occur. Q.E.D. If you want to see an example, check out this benchmark -- the Lua code [1] and the Java code [2], with Java at 9x the Lua. Can you seriously claim it would take the same amount of time to debug both, and that they have an equal opportunity for bugs? [1] http://shootout.alioth.debian.org/u32/program.php?test=knucleotide&lang=lua&id=2 http://shootout.alioth.debian.org/u32/program.php?test=knucl... [2] http://shootout.alioth.debian.org/u32/program.php?test=knucleotide&lang=java&id=1 http://shootout.alioth.debian.org/u32/program.php?test=knucl...