This entry is for the people searching for the Dijkstra quote about “lines spent”.
This evening, I commented on a Chip’s Quips entry, titled Chipping the web: December 2nd. Yeah, not very descriptive. At any rate, discussion had reached the point where Chip (aka Sterling) and I were talking about the motivations behind panicky legislative actions like the $700 billion bailout bill.
I think half the laws that get passed by legislators are penned in the first place only because they figure they won’t get reelected if they don’t pass more laws. It’s like the whole lines of code metric of productivity: the more lines of legislation they write that get passed into law, the more work they’re doing for their constituents.
Dijkstra was closer to being on the right course, with his statement that — if we’re going to measure lines of code — we should measure them not as lines produced,
bybut lines spent. That goes double for legislation.
While composing that comment, I did a Google search for the Dijkstra quote to make sure I was remembering it correctly. I didn’t want to credit Dijkstra and find out it was someone like Donald Knuth who had said it. The full quote, by the way, is from Dijkstra’s On the cruelty of really teaching computer science:
From there it is only a small step to measuring “programmer productivity” in terms of “number of lines of code produced per month”. This is a very costly measuring unit because it encourages the writing of insipid code, but today I am less interested in how foolish a unit it is from even a pure business point of view. My point today is that, if we wish to count lines of code, we should not regard them as “lines produced” but as “lines spent”: the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger.
The search term I entered into Google’s text box was:
"lines spent" code
The results looked like this:
Because the number four result in a Google search was to Lines of Code: The New Heresy — which doesn’t even mention Dijkstra, let alone actually quote him — I figured I should do Googlers like myself the favor of making sure I have an entry here at SOB that offers the exact Dijkstra quote, and even links to a source for it. Thus, this SOB entry was born. I hope it helps someone.