home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!rpi!usc!sol.ctr.columbia.edu!eff!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.c++
- Subject: Re: GOTO, was: Tiny proposal for named loops.
- Message-ID: <TMB.92Aug25220434@arolla.idiap.ch>
- Date: 26 Aug 92 02:04:34 GMT
- References: <TSOS.61.714395736@uni-duesseldorf.de> <1992Aug21.203635.2917@alias.com>
- <rmartin.714668024@thor> <2299@devnull.mpd.tandem.com>
- <rmartin.714749390@thor>
- Sender: news@ai.mit.edu
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 17
- In-reply-to: rmartin@thor.Rational.COM's message of 25 Aug 92 13:29:50 GMT
-
- After many postings extolling the evils of "break", "return" and other
- "non-structured" exits from blocks, Bob Martin writes in article
- <rmartin.714749390@thor>:
-
- In a real application, when confronted with memory outage, I would
- throw an exception, call assert, or just plain exit.
-
- What is an exception exception other than an exit from a block? How is
- that going to leave your "pre- and postconditions" intact?
-
- Altogether, I find Bob's arguments against "break" unconvincing. There
- is nothing wrong with using "break", exceptions, or even the
- occasional "goto" in C++, since C++ has mechanisms (destructors) that
- can be used to take care of cleanup jobs when a block is exited from
- anywhere; simply use them.
-
- Thomas.
-