2 ms·
Although it is only a bullet point at the end of a very long article, the "verify everything" is really important. Small misunderstandings can suck up huge amo
by mikekchar 11y ago
Although it is only a bullet point at the end of a very long article, the "verify everything" is really important. Small misunderstandings can suck up huge amounts of time. If the code has a test suite, it can often be a huge benefit to write a couple of tests in the area of code you are working on just to see if you are correct. And as the author mentions, "printf debugging" is worth its weight in gold.
One of the mistakes I see more junior programmers make is underestimating how much time they need to understand a piece of code. They rush through it, neglecting to build a solid base for their understanding.
On the opposite side, RMS's timeless advice about debugging is very important: don't debug code that isn't broken. You need to narrow your scope or you will be reading code forever. One of the best points about this article is pointing out that you need to have a well defined goal when you are reading the code. You should then restrict yourself to understanding the code around that goal, ignoring the rest.