Lines of Code Are Back (and It's Worse Than Before)
3 months ago
- #AI-generated code
- #Software metrics
- #Productivity
- The software industry historically agreed that lines of code (LOC) is a terrible metric for productivity, as it encourages verbose and inefficient code.
- With the advent of AI, LOC has resurfaced as a key metric, with tech CEOs boasting about the percentage of AI-generated code in their projects.
- AI-generated code is often measured by volume (e.g., 'Total Lines Suggested' and 'Total Lines Accepted'), ignoring quality, bugs, or whether the code was ever deployed.
- Goodhart's Law is exacerbated by AI, as the cost of generating code drops to zero, making LOC an even more meaningless metric.
- Studies show that AI-generated code leads to increased duplication, reduced refactoring, and higher churn rates, indicating lower quality and maintainability.
- Developers using AI tools often take longer to complete tasks but perceive themselves as faster, highlighting a significant perception gap.
- Security flaws are prevalent in AI-generated code, with reports showing 45% of such code contains vulnerabilities.
- The industry has shifted to 'acceptance rate' as a new metric, but it suffers from the same flaws as LOC, conflating 'not rejected' with 'valuable.'
- Alternative metrics like time-to-value, code half-life, defect origin rate, and comprehension coverage are proposed as better measures of productivity and quality.
- The real bottleneck in software development is understanding, design, and judgment, not typing speed or code volume.