home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / programm / 2413 < prev    next >
Encoding:
Text File  |  1992-08-20  |  2.0 KB  |  41 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!myrias!cg
  3. From: cg@myrias.ab.ca (Chris Gray)
  4. Subject: Re: Teaching the basics
  5. Message-ID: <714321786.18023@myrias.ab.ca>
  6. Summary: Recursion is often good
  7. Organization: Myrias Research Corporation
  8. References: <1992Aug17.123916.14815@husc13.harvard.edu> <14066@goanna.cs.rmit.oz.au> <1992Aug19.154830.11787@uwm.edu>
  9. Date: Thu, 20 Aug 92 14:43:04 GMT
  10. Lines: 29
  11.  
  12. In article <1992Aug19.154830.11787@uwm.edu> markh@csd4.csd.uwm.edu (Hunk) writes:
  13. >In article <14066@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
  14. >>If you don't know recursion, you don't know programming.  It is one of the
  15. >>simpler concepts in computing.  (Much simpler than mutable variables, IMHO.)
  16. >
  17. >I think recursion is a farce.  And just to rub it in, here's the Towers of
  18. >Hanoi (up to N = 31, I'm assuming long integers are 32 bits) without it (in C):
  19.  
  20. [two non-recursive Towers of Hanoi programs deleted]
  21.  
  22. An excellent example of why recusion is often a good thing! I assume thats
  23. what you had intended to show? Your programs had an unobvious limitation
  24. not in the simple recursive form, contained (ick!) hidden gotos, and gave
  25. no clue from their form as to what they were intended to compute. Determining
  26. their correctness could be tricky. Back when I was teaching undergrad C.S.,
  27. I would have loved your programs, as examples of why recursion can be good,
  28. and also as examples of how not to program. A marvelous collection of non-
  29. standard usage too, like capitalized local variables, multiple statements
  30. on a line, using comma operators where semicolons work just as well, etc.
  31.  
  32. If I misinterpreted your posting, and you actually believe those are examples
  33. of good programming, well, er, ...
  34.  
  35. -- 
  36. Chris Gray    Myrias Computer Technologies Inc.   (403) 463-1337
  37.     cg@myrias.ab.ca          ...!uunet!myrias!cg
  38. -- 
  39. Chris Gray    Myrias Computer Technologies Inc.   (403) 463-1337
  40.     cg@myrias.ab.ca          ...!uunet!myrias!cg
  41.