News for hackers. Stuff that matters.
Re:How many lines of code can you write? by cperciva on Monday January 28, 2008 @03:01AM (#105410)
I don't keep track of how many lines of code I write and subsequently delete; but here's the month-to-month changes in the total number of lines of code for my online backup code (http://www.tarsnap.com) throughout 2007, as measured by sloccount:

  January    +994
  February  +1291
  March      +691
  April     +1318
  May       +1431
  June      +1430
  July      +1497
  August    +2098
  September   -55
  October   +1392
  November   +618
  December   +934
In total, on December 31st 2007 I had 13639 more lines of code than I had on January 1st; that works out to 1137 lines/month, or 37 lines/day. (Yes, in September I wrote a negative number of lines of code: The 2098 lines of code I wrote in August included many common idioms, and in September I refactored those out into generic functions.)

I've commented before (http://www.daemonology.net/blog/2007-06-21-think-before-codi...) that anyone who is consistently writing more than 5,000 lines of code per month is either writing trivial code or writing garbage; I think a 1000 - 1500 lines of good quality code per month is a reasonable target (at least as far as C coding is concerned -- I don't have enough data on other languages).

Assuming that Python doesn't vary wildly from C in terms of the amount of thinking required per line of code, I'd say that at 200 lines/day the danger is more likely one of not writing high enough quality code, not one of not writing fast enough.

Edit: It's also worth pointing out that, as Dijkstra commented, "we should not regard [lines of code written] as 'lines produced', but as 'lines spent'" -- given two solutions to the same problem, the one which uses fewer lines of code is generally cleaner and easier to maintain, since it will have less duplication and more layers of abstraction.

There are no comments on this comment yet.