I was recently comparing two systems. Here are the commonalities of the systems:
- .Net 3.5
- ASP.NET
- C#
- SQL Server 2005
- 2 tiers, multi-layered
Here are the stats for System A
- 227 distinct screens (pages)
- 176,510 lines of code
Here are the stats for System B
- 234 distinct screens
- 23,724 lines of code
Size difference? 87.9%
These are both line-of-business applications. Why such the big difference in lines of code?
Answer: consistency & architecture
Both systems are very successful and meet the needs of the business, so it’s not a matter of bad/good.
I don’t have time to do a full analysis of the causal relationship (I don’t know what that would be), but this is very interesting to me. Increased lines of code means increased Total Cost of Ownership. I have an incentive to deliver functionality using the least amount of code. I don’t get this by combining lines of code but by applying architectural principles to eliminate code duplication and increase reuse.
Credit: Thanks to Eric Hexter for pulling these numbers.