🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2121

Re: use of the break statement

#2121
From: Ken Arromdee
Date: Fri, 01 Mar 1996 15:31
20 lines
1470 bytes
In article <4h2s54$o3@solutions.solon.com>,
Bill Winn <bill_winn@acm.org> wrote:
>I beg to differ.  break, used in the context of loops, is nothing more than 
>a glorified goto statement.  If you have conditions that force a loop to 
>stop executing why not just have a flag that is set when the loop is to 
>terminate?  Sure, you have to go to the top of the loop (in the case of for 
>and while) to test for the condition, but I would venture a guess that doing 
>such will not cause your system to fail.

That's making C into Pascal.

Of course you can always _do_ this, but it makes the code logic harder to
follow.
--
Ken Arromdee (arromdee@jyusenkyou.cs.jhu.edu, karromde@nyx.cs.du.edu;
    http://www.cs.jhu.edu/~arromdee)

"An alien invader has entered our galaxy!  It has now entered our universe,
clearing Saturn...  radial velocity KMS minus 8.  It is now orbiting directly
for Earth."      --Bad American Dubbing #2 (quoting ???)
Technical Details
Message-ID: <4h758c$4j6@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4gfcl7$2ls@solutions.solon.com> <4gnbcp$biq@solutions.solon.com> <4h2s54$o3@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: arromdee@jyusenkyou.cs.jhu.edu (Ken Arromdee)
Newsgroups: comp.lang.c.moderated
Subject: Re: use of the break statement
Date: 1 Mar 1996 09:31:24 -0600
Organization: Johns Hopkins University CS Dept.
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4h758c$4j6@solutions.solon.com>
References: <4gfcl7$2ls@solutions.solon.com> <4gnbcp$biq@solutions.solon.com> <4h2s54$o3@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com