3 ms·
'There is a direct and measurable causal relationship between number of LOC and number of bugs.' So if i write unit tests, that increases the number of lines o
by canadiansaur 15y ago
'There is a direct and measurable causal relationship between number of LOC and number of bugs.'
So if i write unit tests, that increases the number of lines of code, thus increasing the bug count right? The static type information in java is more akin to unit tests than actual programming logic - they decrease the bug count, not increase it.
Whether they decrease the bug count enough to make up for the productivity loss is the part that is debatable
- famousactress 15y agoI agree with you.. static type information reduces potential test cases which makes it more like unit tests than LOC which will impact the bug count negatively.. but even though the author argues that the 'extra' Java code is type information, I think that's overly simplistic. Java also lacks mechanisms for re-use that languages like python have.. that increases LOC and redundancy in a way that I think will tend to affect the bug count negatively. In my experience, done right it's a bit of a wash. There's more potential cases to test in python.. but the tests are easier generally to write, and the code is more concise and easier to read. With pretty extensive experience at this point in both languages I wouldn't say I've experienced a significant difference in bug trends at all, frankly.