Go Down

Topic: Debugging - a dark art? (Read 2 times) previous topic - next topic

AlxDroidDev


You left the important part out, wildbill: flick the switch off and on a bunch of times in the hope that the result will differ one time and the light will start working. What a colleague of mine used to call POPO.... power off, power on.


Power switches are nondeterministic, therefore the POPO approach often works!
Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

liudr


So, if debugging is the art of finding and removing errors in code, that must mean programming is the art of putting errors in and we should  refer to programming as "bugging".


If that is the case then we should end up with nothing after we find and eliminates all the bugs from our programs.

I think programming is expressing your idea in every necessary detail with bugs in them cause your idea is partly flawed and your execution is partly flawed. After debugging, you will have a working implementation of your modified idea with less bugs.

Jantje

Quote
I think programming is expressing your idea in every necessary detail with bugs in them cause your idea is partly flawed and your execution is partly flawed. After debugging, you will have a working implementation of your modified idea with less bugs.

I like this definition. I marked the things that meet my experience in bold.
I can think of 1 experience I had you do not explicitly mention. Adding that to the definition gives me.

Quote
Programming is expressing your idea in every necessary detail with bugs in them; cause your idea is partly flawed and your execution is partly flawed. After debugging, you may end up with a working implementation of your modified idea with less bugs.


best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

liudr

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.

AWOL

Not at all computer-related, but my f(l)avourite debugging story, ever.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up