N
Nick Keighley
for me instead the debugger is a test;
every function has to pass the "test the first run" in the debugger
for see what going there (and always go wrong the first time)
and to me this is *the* primary way to waste time with a debugger.
If you want to test a function write a test. Then you can re-run
the test at any time for almost zero cost. And it will always
be the same test.
eg. me. I suspect most people do it from time to time. Sometimes
when somebody describes a fault to you in a program you are familar
with you can almost instantly diagnose the problem. "Darn I bet
the code doesn't check that the string isn't null!". And you look
at the code and lo, you are right.
not seem that to me. i can read well my code 10% like "Barry Schwarz"
because i write the sub language i know but i could to have some difficulty
to follow some C library function or the full C++ syntax
well I'm talking about code you are very familiar with. Obviously
in you aren't sure of the semantics of the constructs you are looking
at you'll have a hard time working out what the program is doing
(by definition really!). This comes with practice. And I'd rather
read a manual then single-step a debugger to learn the semantics
of a language! A debugger seems a *very* hit-and-miss way to learn a
programming language.
i not know how to use a debugger because someone theach me what to do;
but it is better to see what code does and how-where data is written
in the memory
I disagree. Some people who post on this ng agree with you.
this is wrong because it is possible one operation that you think write
on the data memory 000000000000000000000000000000000000000000000000000
write in memory 001111111000000000000001111111100000002222200000000
no it isn't wrong. He really did this. You are getting way
to chummy with the machine. I almost never care what addresses my
program
is using. I couldn't for instance tell you where the stack is for any
of
the programs I routinely modify and (sadly :-( ) debug.
sometime there is something has not "symptom" this day
but tomorrow can seg falut or give one wrong answer
If there are no symptoms there is no bug...