home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / scheme / 2115 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  1.9 KB

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