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