Re: Top ten errors
From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 11/20/03
- Next message: Kevin Saff: "Re: Resume the computation after an exception"
- Previous message: Mike Wahler: "Re: Top ten errors"
- In reply to: Karl Heinz Buchegger: "Re: Top ten errors"
- Next in thread: Anand Hariharan: "Re: Top ten errors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 Nov 2003 20:04:54 GMT
"Karl Heinz Buchegger" <kbuchegg@gascad.at> wrote in message
news:3FBCE3E4.B987F274@gascad.at...
>
>
> Gary Labowitz wrote:
> >
> > "Ulrich Eckhardt" <doomster@knuut.de> wrote in message
> > news:bpi952$1ol1lh$2@ID-178288.news.uni-berlin.de...
> > > Gary Labowitz wrote:
> > > > More?
> > >
> > > while(! cin.eof())
> > > { ... }
> > >
> > > Reusing temporaries to 'reduce resource usage'.
> > >
> > > Taking too many steps at a time and then wondering why the program
doesn't
> > > work and no backup is available.
> > >
> > > Taking courses where they get tought how to use a compiler but not how
to
> > > use a debugger.
> >
> > Oh, good ones.
> > But the debugger issue hits one of my buttons. I start them on using
command
> > line to run the compiler. And linker. The gdb is so hard to use I just
don't
> > bother. Want to debug a C++ program? Use VC++.
> > Did I just learn it wrong or not at all? I don't know. But VB and the
like
> > has spoiled the debugging loop for C++ beginners.
>
> Tech them the simple technique of inserting output statements to watch
> variables or the execution of program paths. For beginners and their
> toy programs this is often good enough.
> For some reasons I don't understand, newbies have a tremendous fear of
> writing functions or code snippets which are to be removed in the final
> version but serve well during the debugging phase.
I think the 'fear' could be from the fact that many find
writing code so difficult, that they assign high value
to every line of code they write regardless of whether it's
correct or useful (e.g. "If it compiles then it has value"),
and thus are reluctant to destroy or discard such 'valuable'
things. :-)
Some of the most 'valuable' code I've written was eventually
thrown away (yes, even 'correct', working code). The 'value'
was the learning experience, not the code itself.
When I can throw away good working 'learning' or 'testing' code
without qualms, that's imo a good indication that I've learned
something to my satisfaction, since it means that I have enough confidence
in my new knowledge that I consider writing it again
from scratch to be no problem.
$.02,
-Mike
- Next message: Kevin Saff: "Re: Resume the computation after an exception"
- Previous message: Mike Wahler: "Re: Top ten errors"
- In reply to: Karl Heinz Buchegger: "Re: Top ten errors"
- Next in thread: Anand Hariharan: "Re: Top ten errors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]