Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #29275
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Using break in while loops bad habit? |
| Date | Sun, 17 Jan 2016 01:29:37 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 55 |
| Message-ID | <87io2tf0xq.fsf@bsb.me.uk> (permalink) |
| References | <94ec98fa-9956-48c9-ad34-de8d07cd6419@googlegroups.com> <d2afc3d1-f6d2-4502-867a-ba28a1d506e9@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="14257"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nb9CteVsc0ZFvsoyDJ8nX1WpuyUy8QqQ=" |
| Cancel-Lock | sha1:IHGY982cOUYl61X+345KVwAE/2E= sha1:arUXfieOTf1g+RO65g8dftnIKfY= |
| X-BSB-Auth | 1.34a70a16049f3592c4cb.20160117012937GMT.87io2tf0xq.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:29275 |
Show key headers only | View raw
"Michael Haufe (TNO)" <tno@thenewobjective.com> writes:
> On Saturday, January 16, 2016 at 6:20:15 AM UTC-6, jonas.t...@gmail.com wrote:
>> I have a question regarding the use of breaks in while loops, it
>> seem most breaks can be avoided by adding extra conditions for the
>> loop.
>
> Correct.
>
>> However it somehow make it a bit harder to get the logic of the loop right.
>
> That would depend on how complex[1][2] the body of the loop is.
>
>> But how does the approaches compare from performance view?
>
> Hard to say. It would depend on the algorithm.
>
>> What was the main reason to include break in the language?
>
> Simply put: because Java had it. [3]
>
> Why did Java have it?
> Because C++ had it.
> why did C++ have it?
> Because C had it.
> Why did C have it?
> Because BCPL had it.
> Why did BCPL have it?
> Because CPL had it.
Did CPL have break? I can't find it in the most widely published paper
on CPL[1] but CPL evolved a lot and was never finalised so it may well
have acquired break by the end. Do you have a better reference?
> Why did CPL have it?
> Because ALGOL had it.
Did Algol have it? I don't think so.
> Why did ALGOL have it?
>
> Who knows. it had everything and is held up as an example of why
> Design By Committee[4] is not a good idea.
I'm not just nit-picking. Your idea is that it's lost in time in some
committee's vanished collective memory, but break seems to have been
added by BCPL -- a design be a single, still living, individual. So if
that's the case one could ask!
<snip>
[1] "The main features of CPL", D. W. Barron, J. N. Buxton,
D. F. Hartley, E. Nixon and C. Strachey, The Computer Journal, 1963.
--
Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Using break in while loops bad habit? jonas.thornvall@gmail.com - 2016-01-16 04:19 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-16 13:59 +0100
Re: Using break in while loops bad habit? Philip Herlihy <thiswillbounceback@you.com> - 2016-01-16 15:41 +0000
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-16 16:41 -0800
Re: Using break in while loops bad habit? Philip Herlihy <thiswillbounceback@you.com> - 2016-01-16 13:02 +0000
Re: Using break in while loops bad habit? Tim Streater <timstreater@greenbee.net> - 2016-01-16 13:43 +0000
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-16 14:56 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-18 09:39 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 19:16 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-23 10:32 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-24 00:49 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-25 21:36 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 10:12 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-26 11:11 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 22:48 +0100
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-26 15:03 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-27 00:51 +0100
Re: Using break in while loops bad habit? Norman Peelman <npeelman@cfl.rr.com> - 2016-01-23 21:00 -0500
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-25 21:39 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 10:17 +0100
Re: Using break in while loops bad habit? Doc O'Leary <droleary@2015usenet1.subsume.com> - 2016-01-26 17:10 +0000
Re: Using break in while loops bad habit? Doc O'Leary <droleary@2015usenet1.subsume.com> - 2016-01-26 16:44 +0000
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-26 11:17 -0800
Re: Using break in while loops bad habit? Doc O'Leary <droleary@2015usenet1.subsume.com> - 2016-01-27 05:00 +0000
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-27 09:29 -0800
Re: Using break in while loops bad habit? Norman Peelman <npeelman@cfl.rr.com> - 2016-01-23 20:53 -0500
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-24 10:28 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-25 21:41 -0800
Re: Using break in while loops bad habit? Robert Heller <heller@deepsoft.com> - 2016-01-16 09:06 -0600
Re: Using break in while loops bad habit? Tim Streater <timstreater@greenbee.net> - 2016-01-16 17:31 +0000
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-16 16:52 -0800
Re: Using break in while loops bad habit? Aleksandro <aleksandro@gmx.com> - 2016-01-16 12:43 -0300
Re: Using break in while loops bad habit? Silvio <silvio@internet.com> - 2016-01-16 17:51 +0100
Re: Using break in while loops bad habit? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-01-17 09:09 +0100
Re: Using break in while loops bad habit? John Harris <niam@jghnorth.org.uk.invalid> - 2016-01-17 11:19 +0000
Re: Using break in while loops bad habit? Silvio <silvio@internet.com> - 2016-01-18 00:40 +0100
Re: Using break in while loops bad habit? Andrew Poulos <ap_prog@hotmail.com> - 2016-01-18 13:53 +1100
Re: Using break in while loops bad habit? Silvio <silvio@internet.com> - 2016-01-18 07:59 +0100
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-16 16:34 -0800
Re: Using break in while loops bad habit? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-17 01:29 +0000
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-17 19:22 -0800
Re: Using break in while loops bad habit? Tim Streater <timstreater@greenbee.net> - 2016-01-18 10:00 +0000
Re: Using break in while loops bad habit? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-18 10:50 +0000
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-20 16:40 -0800
Re: Using break in while loops bad habit? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-21 01:50 +0000
Re: Using break in while loops bad habit? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-01-18 22:55 +0000
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-18 16:10 -0800
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-18 09:46 -0800
Re: Using break in while loops bad habit? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-01-18 10:16 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-18 19:18 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-23 10:33 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-24 00:51 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-25 21:46 -0800
Re: Using break in while loops bad habit? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 10:22 +0100
Re: Using break in while loops bad habit? Gene Wirchenko <genew@telus.net> - 2016-01-26 11:19 -0800
Re: Using break in while loops bad habit? Doc O'Leary <droleary@2015usenet1.subsume.com> - 2016-01-19 16:48 +0000
csiph-web