Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Norman Peelman Newsgroups: comp.lang.javascript Subject: Re: Using break in while loops bad habit? Date: Sat, 23 Jan 2016 21:00:31 -0500 Organization: A noiseless patient Spider Lines: 37 Message-ID: References: <94ec98fa-9956-48c9-ad34-de8d07cd6419@googlegroups.com> <160120161343519329%timstreater@greenbee.net> Reply-To: npeelman@cfl.rr.com Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 24 Jan 2016 01:57:44 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="c6d618bb7247ee8069480f77b1316bc7"; logging-data="29090"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Eibsq6tr2n0wUTQko5Qddg+9Ok5t6cDU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: Cancel-Lock: sha1:cmUDw5xtCysN9fn5IgwnmpCf574= Xref: csiph.com comp.lang.javascript:29429 On 01/23/2016 01:32 PM, Gene Wirchenko wrote: > On Mon, 18 Jan 2016 19:16:01 +0100, "Evertjan." > wrote: > > [snip] > >> Seems you don't follow my explanation. > > Since > break; break; > is two statements and the first interrupts the normal flow of > execution, when were you thinking that second statement would be > executed? > >> I am showing code as I think should be implemented >> to be slightly acceptable. > > If you were thinking of one statement allowing multiple levels of > breaking, I would agree with you that it could be done. It would be > horrible to maintain such code though. Imagine adding another level > of looping and all the changes that might be required. > >> As it is now, loop breaks are just as inacceptable as gotos. > > Nope. A loop break is a special goto, to just outside the loop. > I prefer to go with the control variables since I maintain code, and I > find code with break harder to maintain. > I am quite curious as to why that would be? > Sincerely, > > Gene Wirchenko >