Wednesday, April 28, 2010

The Zen of Code Reviews

An aspiring flute player comes to a new teacher’s house for her first lesson. The teacher instructs the student to begin playing and then proceeds to attend to household chores – sweeping the floor, doing the dishes, watering the plants, etc. After an hour, the teacher tells the student that the lesson is over. The student asks the teacher how she did. The teacher replies “when I didn’t notice your playing, it was good. When I did notice your playing, it was bad.” That is the essence of a code review.

When the code is flowing, easy to read, easy to follow, and easy to understand, the reviewer does not notice the code at all – the code is good. When the code causes the reviewer to pause, to ponder, to question, to hesitate, when the code is difficult to follow and understand, the code is bad.

No comments:

Post a Comment