14

Various books and web pages claim that Ken Thompson said:

"One of my most productive days was throwing away 1000 lines of code."

It's found for instance in The Art of UNIX Programming by Eric S. Raymond, p. 24.

Is there any evidence that Ken Thompson, known for Unix and C, has said or written these words?

Fizz
  • 57,051
  • 18
  • 175
  • 291
Barry Harrison
  • 14,093
  • 4
  • 68
  • 101
  • 4
    Why would this be "notable"?? – Daniel R Hicks Apr 12 '19 at 21:42
  • 11
    @DanielRHicks A famous quote attributed to a famous person by multiple sources is not "notable" by your standards? – Mark Amery Apr 12 '19 at 21:44
  • 10
    @DanielRHicks If you are a computer programmer, Ken Thompson is REALLY famous. – Barry Harrison Apr 12 '19 at 21:48
  • 4
    @BarryHarrison - I'm not a computer programmer any more, having retired a few years back, but I've heard of Mr Thompson, and heard his quote a half-dozen times or so. Further, on days when I deleted a lot of code (probably never 1000 lines in a day, except when simply clearing old files) I found quite cathartic, if not "productive" in the literal sense. Ugly, unnecessary code can be quite a bottleneck to progress in any programming effort, so a good programmer deleting code is in no way exceptional or "notable". It would be like Trump saying "I nominated 3 new cabinet members today." – Daniel R Hicks Apr 12 '19 at 22:00
  • 9
    @DanielRHicks A famous old-school programmer deliberately choosing to characterize deleting lots of code as one of his most productive days *is* notable precisely because it implies an endorsement of the opinion you give here - that "unnecessary code" is often a burden and that its deletion is often important for progress. That's part of the accepted wisdom of programmers, but is non-obvious to others and is - like most opinions about good software development practice - disputable. I, at least, would find it interesting to know whether Thompson really said it or not. – Mark Amery Apr 12 '19 at 22:18
  • @DanielRHicks Thanks for the clarification. I now see that you mean it isn't exceptional if streamlining old code increases productivity. However, I would still like to learn about the attribution. – Barry Harrison Apr 12 '19 at 23:14
  • @MarkAmery I agree with your comments. – Barry Harrison Apr 12 '19 at 23:14
  • 1
    The quote appears in half-dozen books, it's definitely notable https://www.google.com/search?q=One+of+my+most+productive+days+was+throwing+away+1000+lines+of+code.&tbm=bks – Fizz Apr 13 '19 at 01:33
  • @Fizz Thanks for editing the question to include a single quote from a single book. – Barry Harrison Apr 13 '19 at 06:24
  • @BarryHarrison: My impression is that that book is the origin of the quote. (The other books which contain the quote are more recent). Raymond's book is somewhat authoritative, but still is a pretty new book (from 2003). Either Thompson said it in private... or maybe Raymod made it up. – Fizz Apr 13 '19 at 09:21
  • @Fizz Interesting thought. I had an answer thought out. However, I'll wait to see if you want to expand your thought into an answer. – Barry Harrison Apr 13 '19 at 18:01
  • @BarryHarrison: no, I don't anything else to say at the moment. – Fizz Apr 13 '19 at 18:03
  • @Fizz I will post an answer as soon as I get access to a computer then. – Barry Harrison Apr 13 '19 at 18:41
  • 3
    It's notable in that pretty much everyone who's ever programmed something more complex than Hello World will agree with the sentiment after but a moment's consideration. – Shadur Apr 13 '19 at 19:19
  • @Shadur That proves that the question does not have any merit. "Is water _really_ wet?" – pipe Apr 13 '19 at 22:55
  • 1
    @pipe This question is about attribution and not about the accuracy of the claim. I hope this addresses your concerns. – Barry Harrison Apr 14 '19 at 02:10
  • 2
    A lot of unhelpful comments to the effect of, *"Look how clever I am, I understood the idea behind this quote already"*. It doesn't matter that the content of the quote is uncontroversial, or unsurprising to experienced professionals in a field. Many notable, widely-used quotes are based on experience. As Abraham Lincoln used to say, *"A quote can be obviously true but still widely misattributed to the wrong person, which can be debunked on skeptics.stackexchange.com"* – user56reinstatemonica8 Apr 14 '19 at 13:36
  • 1
    @Shadur - Those who know the history of computing and understand that placing the quote in the context of its time then makes the quote extremely notable. There was a time when managers were trying to objectively measure programmer's productivity and Lines of Code Written was one of the metrics. It was widely popular because it was easy to measure. Thompson's quote was mocking using LOC as a metric for productivity. The idea of using LOC as a productivity metric as being a horrible idea is now widely accepted; but it was certainly not seen that way back in the 80s and 90s. – Dunk Apr 15 '19 at 21:44
  • Surely the most ideal number of SLOC to maintain is 1? – Cobolt Aug 25 '22 at 13:56

1 Answers1

11

To answer this question, I started by searching for old internet references of the quote. The oldest confirmed reference of the quote was here on page 68 of the pdf. This pdf is a "public HTML draft" of the book The Art of UNIX Programming by Eric S. Raymond, p. 24.

On pg. 1, the most recent entry in the revision history is listed as "Revision 0.87; 30 June 2003; Kirk McKusick contributed a summation of the BSD lawsuit." Further below by 1 line: "Revision 0.86; 26 June 2003; Cleanup release." And further below by a further 1 line: "Revision 0.85; 24 June 2003; Review and cameos from Ken Thompson."

Assuming that the version of the manuscript is Revision 0.87, Revision 0.85 would have already included the quote as it is unrelated to the "BSD lawsuit" (UNIX System Laboratories, Inc. v. Berkeley Software Design, Inc.) and shouldn't be added as part of a "cleanup." Thus, Ken Thompson reviewed the book when it contained his quote(s; there are two of his quotes in the book). If Ken Thompson had pointed out the quote was misattributed to him, it most likely would have been removed (the dedication reads "To Ken Thompson and Dennis Ritchie, because you inspired me."). Yet, it is still in the book (i.e. wasn't removed) so it is likely the quote is correctly attributed.

@Fizz wrote

My impression is that that book is the origin of the quote. (The other books which contain the quote are more recent). Raymond's book is somewhat authoritative, but still is a pretty new book (from 2003). Either Thompson said it in private... or maybe Raymo[n]d made it up.

The internet search concurs that the quote likely originated with the book. However, the comment introduces the possibility that Thompson said it in private. Looking at Revision 0.66, the description is "Cameo quote from Brian Kernighan. Various minor corrections."

The only quote attributed to Brian Kernighan and unsourced is the following:

On the other hand, the ‘user-friendly’ GUIs of other operating systems have their own problems. Finding the right buttons to push is like playing Adventure: the interfaces are just as burdensome as any Unix command line interface, save that one can in theory find the treasure by sufficient exploration. In Unix, one needs the manual.

For this quote, the earliest web reference was, again, this manuscript. The use of another cameo quote would make it likely that the Ken Thompson quote is also a cameo quote: said to the author in private (possibly during Ken Thompson's review and starting as an offhanded discussion) and kept in the published version.

Barry Harrison
  • 14,093
  • 4
  • 68
  • 101