I have been meditating on the cost we incurred developing the Java application at http://www.easycollage.com It certainly took way longer than we estimated. This made me wonder if there are any references for the lifetime cost of a line of code? I have often wondered how much money I was saving the company by refactoring and removing unnecessary code. And how much cost were we saddling the company with when we hacked together something that would need to be maintained for the foreseeable future? I have read somewhere that the average developer can write 10 bug free lines of code a day. When I think of all the time I have spent not actually coding such as in meetings, tracking down bugs and performance tuning I can imagine this estimate is not completely unreasonable. So lets plug in some guesses at some costs to try and come up with a really rough estimate. Lets say my total daily cost is $800. That means a line of code costs $80! I have also heard that maintenance costs can be 80% of the lifetime cost of the software. That seems pretty high to me. But if you do the math that means that the line I wrote cost $80 initially and another $320 to keep it going. So a single line of code might cost as much as $400! I would love to know what you all think. ---- See also SoftwareAsLiability