Don’t get suckered in by the comments — they can be terribly misleading. Debug only code.
— Dave Storer
Consider a developer named Chuck. To figure out how to use an algorithm, Chuck writes comments to describe each step. A few days later, he fixes a bug in his algorithm, but forgets to change the comments. A few weeks later, another fix is required, resulting in more changes to the code, but the comments remain the same.
A few months later Gary, another developer, is tasked with adding a feature to Chuck’s code. After reading the comments Gary starts adding the new feature and can’t figure out why it doesn’t work.
In an ideal world, comments would always correspond with code, but experience shows that the world is not ideal. If you’re maintaining code and see comments that are no longer correct, by all means fix them, but it’s good advice to only follow the code. Comments are secondary in most developers’ eyes, and when they’re fixing a problem, they test the program, not the comments.