Debugging - a dark art?

Thanks Jantje! Just my life experience. Just my most recent experience (not exactly debugging code): I plugged in an AC adapter and used it to power a motor shield for my project. I then ran some motor test code with "motor" (just two LEDs twisted back to back with a serial resistor so I can see green for forward motor and blue for reverse). For quite a few trials I can't find why the motor won't move. Out of frustration I unplugged USB and tried to power the thing with ac adapter, which is when I realized my board is not powered at all. Checked the power strip, I only had one conductor plugged in the socket and left the other one out (was fumbling with the adapter without enough lighting). Easy enough, when power is supplied, the motor starts to turn. I think if I have learned anything over my almost 3 decade programming experience, I learned to not trust myself but it is hard to do.