4 ms·
When debugging: Somebody is always lying. I found that most of the time, a bug is the result of a misunderstanding. Once I've ruled out the most obvious things
by gjadi 5y ago
When debugging: Somebody is always lying.
I found that most of the time, a bug is the result of a misunderstanding.
Once I've ruled out the most obvious things that could go wrong, I assume that every line of code is a lie.
Doing x + y => print x, print y and print x + y (oh oh here is an overflow)
Sending a parameter to a function => print arguments before the call and within the call (oh oh somebody is messing with memory and I'm reading garbage)
This helps catching silent failures which causes problems down the line.