home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!anarres.CS.Berkeley.EDU!bh
- From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
- Newsgroups: comp.lang.scheme
- Subject: Re: wots going on here!?
- Date: 31 Aug 1992 05:02:56 GMT
- Organization: University of California at Berkeley
- Lines: 29
- Message-ID: <17s960INN2o6@agate.berkeley.edu>
- References: <JINX.92Aug29223329@chamarti.ai.mit.edu> <17piphINNncj@agate.berkeley.edu> <JINX.92Aug30102323@chamarti.ai.mit.edu>
- NNTP-Posting-Host: anarres.cs.berkeley.edu
-
- jinx@zurich.ai.mit.edu writes:
- >Your answer of having to tweak a flag or whatever is analogous to
- >saying "recompile and run it under the debugger".
- >
- >Please remember that there are programs that modify global state, and
- >thus re-running is not an option since they may not fail in the same
- >way or at all.
-
- As an experienced C programmer, I always put CFLAGS = -g in my makefile.
- I'm thinking about what's best for a beginner. Beginners mostly make
- trivial mistakes -- missing or extra parentheses, for example -- and it's
- not clear that a debugger would do them much good. And when the core
- language is still pretty mysterious, I don't think they should have to
- deal with the extra mysteries of a debugger.
-
- So, indeed, when I'm teaching C, I tell my *beginning* students nothing
- about gdb; if they can't find their bugs by inspection I tell them to
- put in debugging printf's and recompile. After a month or so of that,
- that's when I teach them about gdb.
-
- I think it should be the same in Scheme. For the example I gave, which
- was saying (+ 2 a) when there's no variable a, the message I proposed
- says it all. A debugger wouldn't help much anyway. If the problem is
- about something returning wrong values, trace some procedures and run
- it again.
-
- (If it modifies global state and therefore can't be run again, you are
- up to chapter 3 and therefore halfway through the semester. By then
- you can have complicated debuggers if you want.)
-