brooksmoses: (Default)
[personal profile] brooksmoses
Computer programmers tend to have a strong aversion to measuring a programming project by the number of lines of program in the source code. There's a famous quote by Bill Gates about the matter:
"Measuring programming progress by lines of code is like measuring aircraft building progress by weight."
Obviously, you make progress in designing an aircraft by figuring out how to make it lighter weight, not by making it heavier.

The thing is, though, that like any measurement the problem is typically not in making the measurement, but in what you do with it. In particular, though the number of lines of code in a project is certainly not be useful for determining how close to finished it is (given that much of the work is in the debugging and testing stages), it can be used to estimate the total amount of "progress" -- that is, programmer time and effort -- that's required in the project in total. For a given type of project, with a given programming team (or similar teams), the amount of effort is roughly proportional to the number of lines to be written.

You can argue this by handwaving about making estimates and in this case or that case it worked, but there's still the compelling imagery of that quote to contend with. So ... what really happens if you try to measure aircraft by weight that way? I was curious and decided to try it. Just like with software, we can't expect similar results over very different kinds of airplanes, but we can consider similar ones -- for instance, Boeing jetliners. Thus, an experiment: Take the operating empty weight of Boeing's current planes (I pulled the data from Wikipedia), and their cost as a proxy for effort required (Boeing helpfully has a 2010-average-price list on their website), and make a simple linear regression for everything from the 737 to the 777. Then, use that to predict what a new 787 Dreamliner will cost.

Can't possibly work very well, can it?

Here's the chart. The gray line is the linear fit to all the pre-787 planes.



And there you have it. Absolutely spot on (0.02% error) for the 787-8, and not too bad (11.2% error) on the 787-9. If I could estimate the effort in my software projects to within 12% of the actual effort that easily, I'd be absolutely thrilled.

Date: 2010-12-27 12:31 am (UTC)
From: [identity profile] alecaustin.livejournal.com
Wow, yeah. I *wish* we could get work estimates that accurate in games development. (Or when we have them, that we could actually tell our clients that what they've expressed a desire for is unworkable. *sigh*)

Date: 2010-12-27 01:26 am (UTC)
ckd: (cpu)
From: [personal profile] ckd
I suspect the real metric to look at is weight per seat, since OEW and price are both correlated with capacity.

Date: 2010-12-27 01:52 pm (UTC)
From: [identity profile] trom.livejournal.com
I've always hated that quote. Because given the design phase airplane manufacturers know to a reasonable (if not high )degree what the final weight will be. So at some level if you know the current weight of the build in progress you know how much is left to do.

Out of curiosity how good a measure is LOC an indicator of closeness to the point where the only changes are due to qa/debugging etc?

I wonder what a similar chart to yours for LOC for the linux kernel, gcc or windows would look like.
Page generated Jan. 20th, 2026 09:40 pm
Powered by Dreamwidth Studios