home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!spool.mu.edu!darwin.sura.net!Sirius.dfn.de!ira.uka.de!slsvaat!josef!kanze
- From: kanze@us-es.sel.de (James Kanze)
- Subject: Re: GOTO, was: Tiny proposal for na
- In-Reply-To: ark@alice.att.com's message of 5 Sep 92 17:04:34 GMT
- Message-ID: <KANZE.92Sep9203633@slsvdnt.us-es.sel.de>
- Sender: news@us-es.sel.de
- Organization: SEL
- References: <714668024@thor> <6800007@tisdec.tis.tandy.com>
- <1992Aug26.130335.26725@hemlock.cray.com> <1992Aug26.194538.1598@spss.com>
- <rmartin.714931485@thor> <1992Aug27.181013.29933@spss.com>
- <rmartin.715102882@thor> <1992Aug31.170908.13389@us-es.sel.de>
- <23634@alice.att.com>
- Date: 9 Sep 92 20:36:33
- Lines: 35
-
- In article <23634@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:
-
- > But since every program can be mechanically rewritten in that form,
- > it doesn't matter. Moreover, if we do grant your premise, we might
- > argue that it is even easier to prove programs correct if we eliminate
- > iteration, which after all can always be expressed by recursion.
- > [Indeed, there is now a whole family of languages that do just that]
-
- As you so well point out in the rest of your article, a proof is
- really just a convincing argument. What we want is to be able to
- reason clearly about a piece of code. This reasoning is simpler if
- the code conforms to the standards of structured programming. The
- fact that the code could be mechanically rewritten to conform to these
- standards is academic if this doesn't actually take place.
-
- The costs and benefits must be balanced. The balance may be different
- according to the language and the application, but I would imagine
- that the additional simplicity in reasoning about the program would
- not make up for the loss of expressivity (in C/C++, at least) due to
- not using iteration. In the same way, it is possible that in certain
- real time applications, the loss of performance due to not using goto
- may actually outway the added complexity of the code analysis. In
- this case, I use a goto. (Actually, if it gets this time critical, I
- usually drop back into assembler.:-).
-
- Overall, however, my experience is that some sort of (generally
- informal) proof of correctness, based on the fundamental control flow
- structures, is very cost-efficient. Generally speaking, it costs less
- to write a program correctly from the start, than to try and find out
- why it doesn't work later.
- --
- James Kanze GABI Software, Sarl.
- email: kanze@us-es.sel.de 8 rue du Faisan
- 67000 Strasbourg
- France
-