I think many people misunderstand the purpose of code review. The purpose of code review is not for the reviewer to find bugs, and certainly not for them to ensure that the code is bug-free. Anyone who depends on code review to find bugs is living in a fool's paradise. As everyone should know by now, it is not in general possible to find bugs by examining the code.
The primary purpose of code review is to find code that will be _hard to maintain_. The reviewer looks at the code and tries to understand what it is doing and how. If they can't, that means it will be hard to maintain in the future, and should be fixed now, while the original author is still familiar with it.
This discussion was very useful in understanding the importance of getting feedback on code … and documenting ASAP - because, over time, even the author’s memory of the code’s purposes will get dimmer.
If the code is at all complicated? Then after a year or two, documentation (including function and variable names!) might make the difference between hours of study and days.
This discussion was very useful in understanding the importance of getting feedback on code … and documenting ASAP - because, over time, even the author’s memory of the code’s purposes will get dimmer.
If the code is at all complicated? Then after a year or two, documentation (including function and variable names!) might make the difference between hours of study and days.