Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #29244 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2016-01-16 04:19 -0800 |
| Last post | 2016-01-19 16:48 +0000 |
| Articles | 20 on this page of 56 — 16 participants |
Back to article view | Back to comp.lang.javascript
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
Page 1 of 3 [1] 2 3 Next page →
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2016-01-16 04:19 -0800 |
| Subject | Using break in while loops bad habit? |
| Message-ID | <94ec98fa-9956-48c9-ad34-de8d07cd6419@googlegroups.com> |
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. However it somehow make it a bit harder to get the logic of the loop right. But how does the approaches compare from performance view? What was the main reason to include break in the language? Is there logic that can not be resolved without a break in loop?
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-16 13:59 +0100 |
| Message-ID | <XnsA5918E421DB8Beejj99@194.109.6.166> |
| In reply to | #29244 |
jonas.thornvall@gmail.com wrote on 16 Jan 2016 in comp.lang.javascript: > 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. > However it somehow make it a bit harder to get the logic of the loop > right. Using such a break would not be necessary if you think and program MODULAR. > But how does the approaches compare from performance view? Well, you would have to measure that in the specific implementation. > What was the main reason to include break in the language? Sorry, you would have to mindread or ask the specific implementator[s]. > Is there logic that can not be resolved without a break in loop? No. The if-statement can always be used, but proper modular programming gives better logic. ====================== Edsger Wybe Dijkstra was from the 1960s the main proponent for "Structured programming" [the word "modular" probly was not coined yet in this sense]: 1968 on a typewriter: "Go-to statement considered harmful, A case against the Go To statement" <http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF> Wiki: <https://en.wikipedia.org/wiki/Edsger_W._Dijkstra> <https://en.wikiquote.org/wiki/Edsger_W._Dijkstra> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Philip Herlihy <thiswillbounceback@you.com> |
|---|---|
| Date | 2016-01-16 15:41 +0000 |
| Message-ID | <MPG.3104510a82b8a14a9896d9@news.eternal-september.org> |
| In reply to | #29245 |
In article <XnsA5918E421DB8Beejj99@194.109.6.166>, exxjxw.hannivoort@inter.nl.net says... > > 1968 on a typewriter: "Go-to statement considered harmful, > A case against the Go To statement" > <http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF> > A programming team of which I was a member in the early '80s readily recognised the difficulties with the GoTo statement, and resolved to replace it with the "ComeFrom" statement instead. In other work, we sought to model the observed behaviour of computer systems by positing a "sometimes" qualifier, to be appended to a statement in much the same way that the !important qualifier is appended to lines of CSS. Take-up of these far-seeming developments has so far been slow. -- Phil, London
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2016-01-16 16:41 -0800 |
| Message-ID | <b5faa361-cc9e-4dbd-a067-202209d4d97c@googlegroups.com> |
| In reply to | #29250 |
On Saturday, January 16, 2016 at 9:41:16 AM UTC-6, Philip Herlihy wrote: > > A programming team of which I was a member in the early '80s readily > recognised the difficulties with the GoTo statement, and resolved to > replace it with the "ComeFrom" statement instead. Which is criticized for the same reason as GOTO. Local reasoning is lost[1] > In other work, we > sought to model the observed behaviour of computer systems by positing a > "sometimes" qualifier, to be appended to a statement in much the same > way that the !important qualifier is appended to lines of CSS. Take-up > of these far-seeming developments has so far been slow. For good reason. I think what you might have been discovering at the time was Aspect Oriented Programming [2]. [1] <https://en.wikipedia.org/wiki/COMEFROM> [2] <https://en.wikipedia.org/wiki/Aspect-oriented_programming>
[toc] | [prev] | [next] | [standalone]
| From | Philip Herlihy <thiswillbounceback@you.com> |
|---|---|
| Date | 2016-01-16 13:02 +0000 |
| Message-ID | <MPG.31044fd5afc9fcf9896d8@news.eternal-september.org> |
| In reply to | #29244 |
In article <94ec98fa-9956-48c9-ad34-de8d07cd6419@googlegroups.com>, jonas.thornvall@gmail.com says... > > 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. However it somehow make it a bit harder to get the logic of the loop right. > > But how does the approaches compare from performance view? > What was the main reason to include break in the language? > Is there logic that can not be resolved without a break in loop? Given that the hardware understands only binary, it follows that any high-level language is a tool to allow human readers to follow the logic of a program. If you buy into that the only thing that really matters is whether the code is readily and accurately comprehensible. It may be that the use of 'break' lends itself semantically to exception conditions. -- Phil, London
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2016-01-16 13:43 +0000 |
| Message-ID | <160120161343519329%timstreater@greenbee.net> |
| In reply to | #29246 |
In article <MPG.31044fd5afc9fcf9896d8@news.eternal-september.org>, Philip Herlihy <thiswillbounceback@you.com> wrote: >In article <94ec98fa-9956-48c9-ad34-de8d07cd6419@googlegroups.com>, >jonas.thornvall@gmail.com says... >> >> 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. However it >> somehow make it a bit harder to get the logic of the loop right. >> >> But how does the approaches compare from performance view? >> What was the main reason to include break in the language? >> Is there logic that can not be resolved without a break in loop? > >Given that the hardware understands only binary, it follows that any >high-level language is a tool to allow human readers to follow the logic >of a program. If you buy into that the only thing that really matters >is whether the code is readily and accurately comprehensible. It may be >that the use of 'break' lends itself semantically to exception >conditions. It does and that is just how I proceed. I don't use GOTO (in fact I've not used one since 1978 when I stopped writing in FORTRAN) but I'll certainly use break where it's appropriate. There may be two or three reasons to exit a while loop. So I'll test for each one and then break. Putting all the conditions in the while itself just gets clumsy. -- "That which can be asserted without evidence, can be dismissed without evidence." -- Christopher Hitchens
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-16 14:56 +0100 |
| Message-ID | <XnsA591980416186eejj99@194.109.6.166> |
| In reply to | #29247 |
Tim Streater <timstreater@greenbee.net> wrote on 16 Jan 2016 in
comp.lang.javascript:
> It does and that is just how I proceed. I don't use GOTO (in fact I've
> not used one since 1978 when I stopped writing in FORTRAN) but I'll
> certainly use break where it's appropriate.
>
> There may be two or three reasons to exit a while loop. So I'll test
> for each one and then break. Putting all the conditions in the while
> itself just gets clumsy.
It would just, but barely, be acceptable,
if loops inside loops were not allowed.
Defining the "innermost loop" as the loop that is "broken"
only complicates things.
What about the double break here to get out of both:
loop-a {
loop-b {
if (x) {break;break;}
}
}
or should we consider "named brakes"
[implicitly garbaging inner ones]?
loop-a {
loop-b {
if (x) {break loop-a;}
}
}
Better stay clear of such breaks just like it was Jquery.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2016-01-18 09:39 -0800 |
| Message-ID | <p38q9blqec5ao53bm9ag20c3ro64m4varb@4ax.com> |
| In reply to | #29248 |
On Sat, 16 Jan 2016 14:56:37 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:
>Tim Streater <timstreater@greenbee.net> wrote on 16 Jan 2016 in
>comp.lang.javascript:
>
>> It does and that is just how I proceed. I don't use GOTO (in fact I've
>> not used one since 1978 when I stopped writing in FORTRAN) but I'll
>> certainly use break where it's appropriate.
>>
>> There may be two or three reasons to exit a while loop. So I'll test
>> for each one and then break. Putting all the conditions in the while
>> itself just gets clumsy.
So use a control variable that you update with the conditions in
the loop.
while (normalstuff && controlvariable)
{
la
di
di
da
setcontrolvariablecase1
setcontrolvariablecase2
setcontrolvariablecase3
}
This is particularly useful if cases are more than just a bare
condition.
>It would just, but barely, be acceptable,
>if loops inside loops were not allowed.
>
>Defining the "innermost loop" as the loop that is "broken"
>only complicates things.
>
>What about the double break here to get out of both:
>
>loop-a {
> loop-b {
> if (x) {break;break;}
> }
>}
The second break would not be executed.
I use breaks very occasionally. I have an app (in another
language) that is up to 105,818 lines. It has a lot of loops, but I
have no breaks in it.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-18 19:16 +0100 |
| Message-ID | <XnsA593C3FE72DC4eejj99@194.109.6.166> |
| In reply to | #29313 |
Gene Wirchenko <genew@telus.net> wrote on 18 Jan 2016 in
comp.lang.javascript:
>>What about the double break here to get out of both:
>>
>>loop-a {
>> loop-b {
>> if (x) {break;break;}
>> }
>>}
>
> The second break would not be executed.
Seems you don't follow my explanation.
I am showing code as I think should be implemented
to be slightly acceptable.
As it is now, loop breaks are just as inacceptable as gotos.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2016-01-23 10:32 -0800 |
| Message-ID | <o4h7abp4n07lbv3glff1jcv58jnpu68bc3@4ax.com> |
| In reply to | #29317 |
On Mon, 18 Jan 2016 19:16:01 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> 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.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-24 00:49 +0100 |
| Message-ID | <XnsA599859B9406eejj99@194.109.6.166> |
| In reply to | #29416 |
Gene Wirchenko <genew@telus.net> wrote on 23 Jan 2016 in comp.lang.javascript: >>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? [in the second from innermost loop, of course] This was pseudocode, [Gene do you seriously not understand this?] I showed it should be handy to specify multiple breaks or named-loop breaks, instead of the default innermost loop break, and thereby showing the dangers of such default dependency. In the main, I think breaks are a bad habit, nearly on par with the GoTo statement, as Edsger Dijkstra fought against from 1959 onwards. "break-break" is an expression from cb-radio from around that time. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2016-01-25 21:36 -0800 |
| Message-ID | <0u0eab9u0b7pjmhlc4su20eeaagquvaksr@4ax.com> |
| In reply to | #29424 |
On Sun, 24 Jan 2016 00:49:15 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:
>Gene Wirchenko <genew@telus.net> wrote on 23 Jan 2016 in
>comp.lang.javascript:
>
>>>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?
>
>[in the second from innermost loop, of course]
>
>This was pseudocode,
>[Gene do you seriously not understand this?]
Let me see.
1) You have written something that is syntactically valid code even
down to the semi-colons in a discussion on code. Why would you expect
someone to think that it is pseudo-code when it looks just like code?
2) It is possible to mix code and pseudo-code. When I use
pseudo-code, I sometimes use the pseudo-code as comments and fill in
with the code. I find this useful when the way to do each part is not
neccessarily clear, but working out some of what I want into code may
help clarify the rest.
In short, you were unclear.
>I showed it should be handy to specify multiple breaks
^^^^^^
ITYM "could".
>or named-loop breaks,
>instead of the default innermost loop break,
>and thereby showing the dangers of such default dependency.
"handy" and "dangers of such default dependency" do not fit well.
Please clarify.
>In the main, I think breaks are a bad habit,
>nearly on par with the GoTo statement,
>as Edsger Dijkstra fought against from 1959 onwards.
Breaks have their uses though I prefer to avoid them. I do use
breaks and gotos in quick and dirty code, the sort that I throw away
after.
>"break-break" is an expression from cb-radio from around that time.
And means one interruption.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-26 10:12 +0100 |
| Message-ID | <XnsA59B67D7EAFB2eejj99@194.109.6.166> |
| In reply to | #29441 |
Gene Wirchenko <genew@telus.net> wrote on 26 Jan 2016 in comp.lang.javascript: > Let me see. Okay, fine. > 1) You have written something that is syntactically valid code even > down to the semi-colons in a discussion on code. Why would you expect > someone to think that it is pseudo-code when it looks just like code? Not at all. I have stopped expecting anything from anyone years ago, possibly when you were still ... [censored, I abhorr ad hominem] > 2) It is possible to mix code and pseudo-code. Anything is possible, methinks. > When I use > pseudo-code, I sometimes use the pseudo-code as comments and fill in > with the code. I find this useful when the way to do each part is not > neccessarily clear, but working out some of what I want into code may > help clarify the rest. Good for you. Is this a hidden "do like me and you will do good" ? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2016-01-26 11:11 -0800 |
| Message-ID | <r0hfabhj51qdetgra4clahhedbhaqa95rv@4ax.com> |
| In reply to | #29445 |
On Tue, 26 Jan 2016 10:12:29 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:
>Gene Wirchenko <genew@telus.net> wrote on 26 Jan 2016 in
>comp.lang.javascript:
>
>> Let me see.
>
>Okay, fine.
>
>> 1) You have written something that is syntactically valid code even
>> down to the semi-colons in a discussion on code. Why would you expect
>> someone to think that it is pseudo-code when it looks just like code?
>
>Not at all. I have stopped expecting anything from anyone years ago,
>possibly when you were still ... [censored, I abhorr ad hominem]
I wish I were definitely in the "... When you were still ..."
category. I am 55.
>> 2) It is possible to mix code and pseudo-code.
>
>Anything is possible, methinks.
>
>> When I use
>> pseudo-code, I sometimes use the pseudo-code as comments and fill in
>> with the code. I find this useful when the way to do each part is not
>> neccessarily clear, but working out some of what I want into code may
>> help clarify the rest.
>
>Good for you.
>Is this a hidden "do like me and you will do good" ?
No. It is simply a use case of code and pseudo-code being
together. You probably do not do that yourself, or you would have
understood the confusion better.
It is useful for me. Whether it would be for you is for you to
decide. I have a history of not following advice/tips/whatever that
do not work for me.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-26 22:48 +0100 |
| Message-ID | <XnsA59BE812FE09Feejj99@194.109.6.166> |
| In reply to | #29450 |
Gene Wirchenko <genew@telus.net> wrote on 26 Jan 2016 in comp.lang.javascript: > I wish I were definitely in the "... When you were still ..." > category. I am 55. I started programming in 2650 assembler when you were 5, having done binary arythmatic on quad NOR-gate chips. >>> 2) It is possible to mix code and pseudo-code. >> >>Anything is possible, methinks. >> >>> When I use >>> pseudo-code, I sometimes use the pseudo-code as comments and fill in >>> with the code. I find this useful when the way to do each part is not >>> neccessarily clear, but working out some of what I want into code may >>> help clarify the rest. >> >>Good for you. >>Is this a hidden "do like me and you will do good" ? > > No. It is simply a use case of code and pseudo-code being > together. You probably do not do that yourself, or you would have > understood the confusion better. In early assembler you typically started off getting your mind together using some form of pseudocode on paper, as adviced in Byte. No mix intended. Byte had its own pseudocode then. > It is useful for me. Whether it would be for you is for you to > decide. I have a history of not following advice/tips/whatever that > do not work for me. Some are lethal, safe to say you did not follow those [yet]. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2016-01-26 15:03 -0800 |
| Message-ID | <476f18e8-c30d-4562-ae07-3ae0763a10d0@googlegroups.com> |
| In reply to | #29453 |
On Tuesday, January 26, 2016 at 3:49:24 PM UTC-6, Evertjan. wrote: > Gene Wirchenko wrote on 26 Jan 2016 in > comp.lang.javascript: > > > I wish I were definitely in the "... When you were still ..." > > category. I am 55. > > I started programming in 2650 assembler when you were 5, > having done binary arythmatic on quad NOR-gate chips. 2016 - (55 + 5) = 1966 Signetics 2650 Microprocessor: 1975? [1] Since the Symbolic stage of development does not occur until the teenage years [2], you would have had to have been at least 15 years old at the time in 1966? [1] <http://bitsavers.trailing-edge.com/pdf/signetics/2650/1975_Signetics_2650.pdf> [2] <https://en.wikipedia.org/wiki/Piaget's_theory_of_cognitive_development#Formal_operational_stage>
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-27 00:51 +0100 |
| Message-ID | <XnsA59C8CA6E11Aeejj99@194.109.6.166> |
| In reply to | #29454 |
"Michael Haufe (TNO)" <tno@thenewobjective.com> wrote on 27 Jan 2016 in comp.lang.javascript: > Signetics 2650 Microprocessor: 1975? [1] > > Since the Symbolic stage of development does not occur until the teenage > years [2], I would not take that as an absolute fact, my observations of my granddaughter prospectively contradict that. > you would have had to have been at least 15 years old at the > time in 1966? Evidently, Dr Watson. And the price af a 2650 microprocessor always was $26.50 -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2016-01-23 21:00 -0500 |
| Message-ID | <n81b2o$sd2$1@dont-email.me> |
| In reply to | #29416 |
On 01/23/2016 01:32 PM, Gene Wirchenko wrote: > On Mon, 18 Jan 2016 19:16:01 +0100, "Evertjan." > <exxjxw.hannivoort@inter.nl.net> 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 >
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2016-01-25 21:39 -0800 |
| Message-ID | <of1eablendd0o3ri1l1539sg05j50k3bgg@4ax.com> |
| In reply to | #29429 |
On Sat, 23 Jan 2016 21:00:31 -0500, Norman Peelman
<npeelman@cfl.rr.com> wrote:
>On 01/23/2016 01:32 PM, Gene Wirchenko wrote:
[snip]
>> 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?
A break gives a loop another exit; it is another execution path
that has to be tested. If the loop is long, the break can get lost in
the code. I want flow of execution to be obvious.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2016-01-26 10:17 +0100 |
| Message-ID | <XnsA59B68ACCFAC4eejj99@194.109.6.166> |
| In reply to | #29442 |
Gene Wirchenko <genew@telus.net> wrote on 26 Jan 2016 in comp.lang.javascript: > On Sat, 23 Jan 2016 21:00:31 -0500, Norman Peelman > <npeelman@cfl.rr.com> wrote: > >>On 01/23/2016 01:32 PM, Gene Wirchenko wrote: > > [snip] > >>> 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? > > A break gives a loop another exit; Ah, that is why it is called "exit" in VBS. > it is another execution path > that has to be tested. If the loop is long, the break can get lost in > the code. I want flow of execution to be obvious. The crux, IMHO, is that it breaks the subroutine/loop/function stack: 1 in the machine code, 2 in modular programming. Both need garbage collection, the second one in your mind. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web