Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #9697
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Subject | Re: Simulate goto |
| Newsgroups | comp.lang.javascript |
| References | <ef9039a7-0cf7-4887-a98e-81c49968555b@p42g2000vbt.googlegroups.com> <4ef9e511$0$16555$a8266bb1@newsreader.readnews.com> <eh2kf7tbrdvgbjh0otfl5neu5huk8ok8na@4ax.com> <Xns9FC8D4E2AFC9Deejj99@194.109.133.133> <bfbkf71ddujc3t7na648lovnf17an3smko@4ax.com> |
| Date | 2011-12-27 23:07 +0000 |
| Message-ID | <4efa4fb2$0$16680$a8266bb1@newsreader.readnews.com> (permalink) |
| Organization | readnews.com - News for Geeks and ISPs |
On Tue, 27 Dec 2011 21:49:38 +0100, Hans-Georg Michna wrote: > On 27 Dec 2011 19:55:41 GMT, Evertjan. wrote: > >>Gene Wirchenko wrote on 27 dec 2011 in comp.lang.javascript: > >>> Some algorithms are more easily expressed with a goto. > >>I do not think so. >> >>Goto makes havoc of a programme, >>as programmse should be build from modular blocks, whose entrees and >>exits should not be compromized bij wrong levels. > > There are valid exceptions. One prime example is the state machine, > sometimes also called finite-state machine or syntax machine. By far the > fastest and easiest implementation is to go from one state, implemented > as a block of statements or simply a label, to another with a goto. > > I still suspect, like you, that most attempts to use a goto statement in > other contexts than breaking a loop are not very sensible. If you want to break a loop, most languages have a "break" or similar statement which gives control to the instruction following the loop - this is normally where you would want to go when exiting the loop. goto may in some cases still be in use to support old code (I understand that in some market sectors code that is several decades old written in the likes of algol, fortran and cobol is still in use), and of course in assembler and at the machine code and microcode levels both conditional and unconditional jumps tend to be pretty common, however I am unable to conceive of any situation where a "simulated goto" might actually be useful in javascript. Rgds Denis McMahon
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Simulate goto Archos <raul.san@sent.com> - 2011-12-27 01:19 -0800
Re: Simulate goto Archos <raul.san@sent.com> - 2011-12-27 01:50 -0800
Re: Simulate goto Archos <raul.san@sent.com> - 2011-12-27 02:09 -0800
Re: Simulate goto Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-12-27 11:31 +0100
Re: Simulate goto "Tom de Neef" <tdeneef@qolor.nl> - 2011-12-27 12:12 +0100
Re: Simulate goto Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-27 18:27 +0100
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-28 16:56 +0000
Re: Simulate goto Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-28 19:10 +0100
Re: Simulate goto Jake Jarvis <pig_in_shoes@yahoo.com> - 2011-12-28 23:18 +0100
Re: Simulate goto Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-29 12:18 +0100
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-29 16:31 +0000
Re: Simulate goto Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-29 17:47 +0100
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-30 11:04 +0000
Re: Simulate goto Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-30 16:10 +0100
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-27 14:41 +0000
Re: Simulate goto Denis McMahon <denismfmcmahon@gmail.com> - 2011-12-27 15:32 +0000
Re: Simulate goto Gene Wirchenko <genew@ocis.net> - 2011-12-27 10:12 -0800
Re: Simulate goto "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-27 19:55 +0000
Re: Simulate goto Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2011-12-27 21:49 +0100
Re: Simulate goto Denis McMahon <denismfmcmahon@gmail.com> - 2011-12-27 23:07 +0000
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-28 16:28 +0000
Re: Simulate goto Nomen Nescio <nobody@dizum.com> - 2011-12-28 22:33 +0100
Re: Simulate goto Gene Wirchenko <genew@ocis.net> - 2011-12-27 13:19 -0800
Re: Simulate goto "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-27 22:02 +0000
Re: Simulate goto Tim Streater <timstreater@greenbee.net> - 2011-12-27 22:18 +0000
Re: Simulate goto Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-28 00:23 +0000
Re: Simulate goto John G Harris <john@nospam.demon.co.uk> - 2011-12-28 16:37 +0000
Re: Simulate goto Tim Streater <timstreater@greenbee.net> - 2011-12-28 17:44 +0000
Re: Simulate goto Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-29 01:16 +0000
Re: Simulate goto Gene Wirchenko <genew@ocis.net> - 2011-12-28 17:34 -0800
Re: Simulate goto "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-29 08:27 +0000
Re: Simulate goto Dr J R Stockton <reply1152@merlyn.demon.co.uk> - 2011-12-30 20:54 +0000
Re: Simulate goto Tim Streater <timstreater@greenbee.net> - 2011-12-31 11:55 +0000
Re: Simulate goto Gene Wirchenko <genew@ocis.net> - 2011-12-27 14:50 -0800
csiph-web