Debugging? What???

Started by
13 comments, last by Yann L 16 years, 1 month ago
I think learning to debug code without the aid of a debugger is a useful and valuable skill. As you say, it forces you to focus a bit more on code correctness rather than a trial-and-error approach. And it is more educational to learn to spot the logical error in your code, than for a debugger to find it for you. But there are many times when something goes subtly wrong and a debugger is far and away the most efficient and effective way of resolving the problem. For those times, you owe it to yourself - and to any future colleagues, if you end up working as a programmer - to learn how to use this valuable tool.
Advertisement
Working without a debugger makes you more cautious, IMO (well, makes -me- more cautious). If you ever get stuck working on embedded systems, sometimes the stuff you work on can't be remotely debugged (you write the code, stick it on device, hope it works). This is not always the case, but I have had to do it a few times and it ...well, it is unpleasant, shall we say? It's never nice to see that a simple mistake (overwriting something that you meant to keep protected in memory) can cause your entire system to crash irrecoverably :(

I vote for debugger in all circumstances where you can use one! When that fails, formal logical reasoning is your best bet (but only if you really care what happens when you start things up).

~Shiny

[edit] Reasons why people still care about formal methods :P
------------'C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg.' -Bjarne Stroustrup
hm... my two cents:

Reasons for using a debugger:
Faster to find bug,
Multithreading, call stacks, memory windows, dynamic value changes,
Enables to understand easilly what is the bug and why,
Allows you to step through your program easilly seing how its being run
No changes to the release code (ie: you are sticking it full of message boxes)

Reasons for knowing how to debug without a debugger:
Not always possible to debug (on client site for example)
some languages just dont have debuggers or arent easy to get them (&#106avascript, Java for example, though now there are debuggers for it as well).
Not dependent on a debugger or worst a particular debugger.
Requires knowledge of the application's logic and working.

Reasons for Not using a debugger:
Debugger not available.

Conclusion:
Make sure you can debug without a debugger but dont do it unless you have to.

just my thoughts but they since ok.

Yours Truly
K
Pain is Inevitable, Suffering is Optional.Unknown
ok. a lot of people already comment and pretty much all of them agree that yes it's a good thing... and so do I.

A programmer that can't debug isn't really a programmer!

Using breakpoints, watches, stacks, context and so on are all your friends... learn them.

also debugging is great when you want to know what is going on in other peoples code and 99% of the time programmers will be working on other peoples code in a company.

debug debug debug (gods gift to programmers)
http://osghelp.com - great place to get OpenScenGraph help
Quote:Original post by BloodWarrior
Reasons for knowing how to debug without a debugger:
Not always possible to debug (on client site for example)

Remote debugging over the internet. That saved our asses quite a few times in the past... :)

This topic is closed to new replies.

Advertisement