3 ms·
Kernighan's Law - 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 defin
by zikzak 2y ago
Kernighan's Law - 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.
- bilekas 2y agoI feel as an outlier to this I need to make a comment.. Debugging (with source) to me at least, it’s so much more easier as you have all of the stack with you along the chain.. It’s very rare, not impossible though, to find crazy behavior during correct debugging.. This law is new to me though.
- geewee 2y agoI think it depends on how thorny the thing you need to debug is. Race conditions, intermittent bugs that crash the process leaving no trace, etc. Debugging is much more than using a debugger
- parpfish 2y agoI like to differentiate between “bugs that stem from a recent code change” (easy to fix) and “bugs that suddenly appear out of nowhere” (hard to fix)
- marcosdumay 2y agoThat, of course, is only valid if you are using your cleverness to optimize for something that isn't readability.
- immibis 2y agoA lot of clever code thinks it's optimizing for readability when it's really optimizing for the feeling of cleverness itself.
- cies 2y ago"Do not write today, that what you cannot debug tomorrow."