Sunday, April 5, 2009

Lots of code

The Point-of-Sale software I’ve been working on for the last 18 months (StreamPOS) is getting pretty big.  I just published a new version of it, and the source code is currently 165,559 lines long.  It has 79 different screens it can display, not counting the standard “Open File” or “Print” type dialog boxes that most software uses.

In more familiar terms, if those 165,559 lines of code were to be printed on standard letter-sized paper, it would take approximately 3680 pages to print it out.  The stack of paper would be more than a foot and a half tall.   It would consume nearly 7.5 reams of paper, and take 5 hours to print at 12 pages per minute. 

That’s an average of 7 new pages per day, every day, 7 days per week, for the last 18 months.  (What does your brain say when you think, “write a 7 page paper every day for 18 months?”)

If it were published in a paperback book, that book would be 6600 pages long (not including the foreword, index, etc. :) ).  This book would be almost three feet thick.  Reading it would take 110 hours at one page per minute, if you could make it past the first page awake.

This makes it the largest program I have written in my life.  My backup software, FileBack PC, is currently hovering around 140,000 lines.  It took 12 years for FBPC to get to the point where it is now.  StreamPOS is bigger and was started just 18 months ago. 

Ironically, StreamPOS is probably the most bug-free piece of software I’ve ever written too.

The first “long” program I wrote was one I created during the summer after I graduated from high school, my first freshman year of college, and the following summer (16 months in total), weighing in at 27,000 lines.  I did print the source code for that one, and it took a little over a ream of paper.

One metric used to determine the length of time it will take to develop a piece of software says it takes about one person-year to create 3750 lines of code.  If that were really true, StreamPOS would take 44 years to develop.  Of course, that same metric says that a line of source code is worth about $33, and if that were true StreamPOS would cost $5,463,447 if we were to hire someone to write it.  So I’m not sure I buy those metrics.  And I certainly wouldn’t hire the guy that writes 3750 lines per year; I’m writing three times that many every month, which is 35 times faster.

In all fairness, though, a portion (I’d guess about 7-8%) of StreamPOS is library code which has been purchased or licensed elsewhere.  But the remaining 92% has all been entered with my own two hands.  It’s a wonder I don’t have Carpal Tunnel.

But if 165,559 lines seems big, Windows Vista is estimated to be about 50 million lines of code.  Even though I have developed StreamPOS at an incredibly fast rate by industry standards, it would take 453 years to write Windows Vista by myself if I were able to continue working at that rate the whole time.  Ugh.

1 comment:

christine johnson said...

So I guess you're not going into the OS business?

Google Search