3 ms·
1) Debugging is harder than writing code, so if you've been clever in writing code you are by definition not clever enough to debug it. Citation needed. And I
by jodrellblank 15y ago
1) Debugging is harder than writing code, so if you've been clever in writing code you are by definition not clever enough to debug it.
Citation needed. And I don't mean proof by appeal to authority because someone famous once said it.
Debugging is different to writing code - you can spend longer thinking about it, you can bring different tools to bear on it, you can focus your attention on smaller or larger pieces of the problem, you can stop thinking about any of the surrounding context which is irrelevant to debugging, instead of having to think about the context relevant for programming.
Is it measurably harder, or is it a less used and less practised skill so not learned as fluently? Is it that programming is seen as "default-success-unless-proved-broken" and debugging is seen as "a-failure-until-fixed", so there's a psychologically different feeling in approaching one than the other? Is it that programming usually happens earlier in a project and debugging later, so there's more stress and deadlines looming? Is it that debugging happens when a problem has been found and now you are acutely aware of what's being held up until the debugging is done?
This quote suggests there is code out there which has known bugs and the authors have tried hard to find them, with enough examples to work from, and never succeeded due specifically to limits of their cleverness. Is this anecdotally true for anyone here?
- deleted 15y ago[deleted]
- andrewflnr 15y agoI don't know about the "not clever enough by definition" part, but I agree that debugging is harder than writing new code. If you're debugging your own code, you're trying to find something out about it that you didn't understand when you wrote it. You're looking for one of an almost infinite variety of side effects or subtle misunderstandings of interfaces, and you have to find which one it is. There are usually more ways to go wrong than right. You then have to change your brain to add this understanding, which is difficult, while writing code is likely to take advantage of existing mental structures. When you're debugging someone else's code, you have all the same problems, except you don't have the benefit of knowing what the writer was thinking at the time, that initial understanding. So yes, you have more time to do it, but that's because it takes longer, and it's more a wrack-your-brains time than writing code.
- antfarm 15y ago"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." (Brian W. Kernighan)