top | item 42921443

(no title)

zikzak | 1 year 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.

discuss

order

marcosdumay|1 year ago

That, of course, is only valid if you are using your cleverness to optimize for something that isn't readability.

immibis|1 year ago

A lot of clever code thinks it's optimizing for readability when it's really optimizing for the feeling of cleverness itself.

bilekas|1 year ago

I 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|1 year ago

I 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

cies|1 year ago

"Do not write today, that what you cannot debug tomorrow."