how much does a line of code cost?

Rio de JaneiroThis past week I stumbled upon a nice tool: sloccount. Sloccount was written by David Wheeler and is a set of tools to count lines of code. Wheeler also has some really interesting papers regarding the linux kernel size and its development cost.

After installing sloccount* I immediately started to harvest data on all projects I currently have on my hard drive. I was really impressed by the first results. The costs are too high, I thought. A small project with 2,000 lines of PHP code like the Autoresponder has a development cost estimated at more than US$55k.

After reading sloccount’s user manual and pondering about the Awake Autoresponder I started to change my mind. 2k lines of PHP code encompass a lot more work than the number suggests. A few reasons for this:

  1. The code was updated every time a customer submitted a bug. As you know, fixing a bug does not necessarily imply more lines of code
  2. Out of the box sloccount doesn’t compute HTML, CSS or Javascript
  3. Technical support
  4. Documentation

It took me a few thousand commits, I don’t know how many emails and several hours of night debugging the script on customer’s servers to reach 2k working lines of code. It may sound like cheap advertisement or self promotion but I must say that US$49.90 for the script is a bargain!

* if you are running Ubuntu it’s easy as

sudo apt-get install sloccount

Leave a Reply

Please insert the signs in the image: