Subtract Lines Of Code

Many software development shops are complacent in bean counting:

Many programmers believe that for the purpose of either measuring programmer productivity, or estimating the schedule, LinesOfCode is misleading. However the reality is that many managers cannot forego this bad habit of counting the lines of code. Given that we have to give them satisfaction of bean counting, how do we improve this?

The response comes from EwDijkstra: lines of code should be subtracted and not added. Here's what he says in the paper "Fruits of Misunderstanding", http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD854.PDF :

 [...] In this respect a program 
  is like a poem: you cannot write a poem without writing it.
  Yet people talk about programming as if it were a 
  production  process and measure "programmer productivity"
  in terms of "number of lines of code produced".
  In so doing they book that number on the wrong 
  side of the ledger: We should always refer to
  "the number of lines of code spent".

In other words we need to convince managers that a programmer is more valuable if he/she writes fewer lines of code for the same functionality.

UnitTests can provide a partial solution to this conundrum. Instead of how many SLOC's (god I hate that term) produced, unit tests fulfilled can be the metric.


Perhaps a better measure of productivity would the LOCs that a programmer manages to remove whilst maintaining/increasing functionality.

I hope your company doesn't employ Perl programmers!


A great story about Bill Atkinson at Apple regarding negative lines of code:

  http://www.folklore.org/StoryView.py?project=Macintosh&story=Negative_2000_Lines_Of_Code.txt


Earl Muntz also believed that "taking things out" usually made things better, more reliable, etc. Some people saw that as positive: "What's All This Muntzing Stuff, Anyhow?" http://www.national.com/rap/Story/0,1562,17,00.html Others saw it as "cutting corners": "Earl Muntz for President" http://mckeesport.dementia.org/blog/000237.html


See also FunctionPoint


EditText of this page (last edited January 14, 2007) or FindPage with title or text search