home *** CD-ROM | disk | FTP | other *** search
- From: kers@hplb.hpl.hp.com (Chris Dollin)
- Date: Fri, 4 Sep 1992 07:29:31 GMT
- Subject: Re: Re: GOTO, was: Tiny proposal for named loops.
- Message-ID: <KERS.92Sep4082931@cdollin.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!scd.hp.com!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
- Newsgroups: comp.lang.c++
- References: <2318@devnull.mpd.tandem.com> <rmartin.715001372@thor> <4192@papaya.bbn.com> <1992Sep2.131733.20676@terminator.cc.umich.edu> <r
- Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
- Lines: 40
- In-Reply-To: rmartin@thor.Rational.COM's message of 3 Sep 92 13:23:02 GMT
- Nntp-Posting-Host: cdollin.hpl.hp.com
-
- In article ... rmartin@thor.Rational.COM (Bob Martin) writes:
-
- You don't have to make up your own rules. Some other guys, who have
- thought about it alot, have put together a pretty well thought through
- set of rules. Moreover, the industry has, for the most part, accepted
- those rules as valid. Moreover, it has been proven that those rules
- are always workable, and it has been shown that they help to make code
- more readable and maintainable.
-
- In what sense do you claim that ``these rules'' (by which I understand you to
- mean the usual rules of structured programming) have been ``proven'' to be
- ``workable''?
-
- It's certainly true that any procedure can be rewritten in structured style
- (ie, using only while, if, and sequencing as control structures). But the
- easiest proof of this -- turn it into a loop wrapped round a case (chained ifs,
- if you want to be picky) -- also shows that it's not necessarily a good idea,
- if what you want is *clear* code.
-
- And clearness is as much a matter of psychology as of mathematics. There's a
- lot of empirical evidence to suggest that traditional SP ``works'', ie, that
- for very many programming problems, they are an effective solution. [The
- evidence is the large number of programs written effectively in that style.]
- But there's also evidence that they're not *enough* -- that other control
- structures are needed for clarity -- consider
-
- * procedures
- * FOR-loops (of various kinds)
- * N+1/2 times loops
- * Scheme-style use of tail-call
- * Co-routines
- * Higher-order functions
-
- for example.
-
-
- --
-
- Regards, | "If taking devious pains was a sign of laziness, he was quite
- Kers. | prepared to call Hazelton the laziest man alive." Blish (m-o-l)
-