Finding your bug is a process of confirming the many things that you believe are true — until you find one which is not true.
—Norm Matloff
“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
[[
… ]]
vs. [
… ]
==
vs. =
.1 + .05 == .15
identical()
or all.equal()
)insert print statements to help you verify 1) your understanding of what is happening and 2) that what you expect to be happening is happening.
hypothesize, test, repeat – and keep track of how things are going.
it’s quite easy to work yourself into a panic over a bug, so make sure to take breaks.