-3

I vaguely remember a quote from, IIRC Kernighan. Something along the lines of:

when you find a bug, fix all occurrences of it

I think it was either in the "Practice of Programming" or "The C programming language."

And, IIRC, it was in the context of logical errors, so did not presume one was not following DRY.

Does anyone recall that and know where I might find it?

I'm writing slides for a talk, so would like to have the exact wording in context which is probably pithier than my vague recollection.

  • 1
    "...these questions aren’t educational in any way, because there’s no way to learn about the process of discovery. A particular community member, by virtue of their experience in the field, just happens to be able to take the limited information you remembered and fill in enough of the blanks to guess the correct answer... guessing game questions do not meet our goal of making the Internet better." (blog.stackoverflow.com/2012/02/lets-play-the-guessing-game) – gnat May 13 '18 at 18:28
  • @gnat, fair enough. My apologies. – Mike Samuel May 13 '18 at 20:04
0

I tracked it down.

In Chapter 5 of The Practice Of Programming:

Every bug you find can teach you how to prevent a similar bug from happening again or to recognize it if it does.

and

Don't make the same mistake twice. After you fix a bug, ask whether you might have made the same mistake somewhere else."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.