Brian Kernighan, of Kernighan and Richie fame, or K&R (if you did’t know, Richie created the C language and Kernighan helped him right the book on it). At any rate, Brian has this famous quote which I can’t seem to find the root source but I found it quoted many times:
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
And that perfectly explains my frustration in the last couple of weeks trying to understand two very clever code bases. Not only is debugging twice as hard, but being a new guy trying to understand the code is at least twice as hard. Hmm, maybe here’s a new quote for people:
“Learning code is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, the only one who’ll be able to understand it.”
Unless the person learning the code is twice as smart as you. Or something… At any rate, I’m not twice as smart as most people so I get to struggle trying to figure this stuff out.
BTW, as I was searching around for the source of the Brian’s quote, I ran across this interesting interview with him that gives a glimpse of the human side of Unix and C as they were created at Bell Labs many years ago now.