> > >> ......Can somebody tell
> > >> me exactly how to debug a program......
> > > me too :-)
> > Go to google.com, type in "How to debug a program" and hit "I'm feeling
> > lucky"
> > :-)
> If only it were that easy - sigh :-)
Actually - being serious for a moment - if I'm honest with myself, the
time I have had trouble and needed to do serious debugging, is usually
when I've not spent enough time and forethought on the initial planning
and design.
So I'd answer the question about how to debug, by advising on doing things
that mean you lessen the chances of getting to the point where you are in
need of serious debugging, e.g. (aimed at students doing projects
et al.[1])...
- spend time with (gasp) paper and pencil to structure your project,
use pseudo-code to sketch out the logic - maybe even resort
to structured design tools (gag, cough spit, but they can
have their place on big projects)
- make sure you understand the language/hardware and it's features you
are using - write some small test programs to check out areas you are
not sure about until you've mastered the concepts etc.
- think especially about your data, and how you'll be structuring it,
about the environment the s/w runs in, how it interacts - programming
is much more than coding :-)
When you do hit problems - before resorting to a full debugger, where
possible use the time honoured judicious insertion of suitable print
statements to display variables associated with the problem.
And for serious problems iterate round the 3 points above again, then
debug.
I'm sure experienced engineers and programmers will have thier own pet
advice.
cheers
Jim
[1] I was once young and impetuous too, and much of this I didn't do
as a young guy learning to program. but you learn from your mistakes
:-)
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|