I recently stumbled on the following article about “Norris numbers”
The quick summary is that for an untrained programmer, 1500 lines of code is about where they hit the wall before they succumb to complexity and organizational issues. The next big barrier is 20,000 lines of code for those that have some training and a bit of experience. The next big barriers are at 200,000 lines, 2 million lines, etc. At each level, a programmer or team has to develop new techniques and strategies to overcome the inherent cognitive limits of our human brains.
Linux offers a neat little tool called “sloccount”. You can run it on just about any source tree, and it will count up the lines of actual code and then estimate how long it might have taken to develop that code and what the expected costs might be.
For example, my core UAS autopilot project is about 41,000 lines of code currently. Sloccount estimates this represents nearly 10 years of effort (I started the work in 1995) and at a modest yearly salary estimates the cost to develop this code at about $1.3 million dollars.
My first reaction is this is crazy talk, sloccount is just pulling numbers out of it’s rear aperture. But after thinking about it, maybe these numbers aren’t so far off. If you also consider the need for a project to mature over a period of time and consider bugs, testing, etc. then it’s not so much about how many lines of code can you crank out per hour, but more about how much effort is required to create a body of code that is functional, robust, and mature. If you take a mature software package and work backwards, I suspect sloccount’s numbers would start to look much more reasonable.
Workload and Expectations?
I’ve spent my career in the trenches. I never really was interested in the management track. This clearly colors my perspective. When I read generalized comments (like the article linked above) my first thought is to apply them to myself.
After reading the article about code complexity barriers, I immediately went out and evaluated several of my projects. FlightGear = 264,000 lines of code. My UAS autopilot is 41,000 lines of code. My little summer side project is 6,000 lines of code (sloccount estimates that is 15.76 months worth of effort packed into about 2 months of time.) My model airplane designer project that I’ve worked on during Christmas break the past 2 years is 5,600 lines of code.
I still don’t think we can put too much faith in sloccount’s exact numbers, but when I wonder about why I’m so overwhelmed and feel buried in complexity and deadlines and pressure, maybe this offers a little perspective, and maybe I’m doing ok, even if I feel like I’m coming up short of everyone’s expectations. For the managers and entrepreneurs out there, maybe this can guide your expectations a bit more accurately.