A good debugger will reduce the need for print statements,
but you are still better off with a very small initial set of
test data for your program, so that you can run through
everything by hand and be sure you have caught all the
careless errors.
I made plenty: using sizeofwhen I meant strlen(it was a
while before I noted that my long words were truncated to
8 bytes!). Also, only with a small example can you be
confident that expansions are occurring at exactly the
right time, for example.
Despite finding this error, I still allocated space for
strlen(s) instead of 1+strlen(s). Strangely this mistake
caused me no grief at all!! and remains today as an
undocumented bug in the program!
There is good reason why it caused no problem. Do you
have any thoughts about why things might work?
|