On Mon, Dec 20, 2010 at 4:47 PM, David Harkness <davi...@highgearmedia.com> wrote: > On Fri, Dec 17, 2010 at 10:05 AM, la...@garfieldtech.com < > la...@garfieldtech.com> wrote: > >> What PHP has implemented is "named break statements", as I understand it. >> > > Not exactly. You can jump to arbitrary (labeled) lines within the same > context (method/function), but you cannot enter loop constructs--only exit > them. While the last bit implies they are only "named break statements," you > can use them outside of loops as a normal goto statement. > > firingSequence: > if (!acquireTarget()) > goto done; > fireMainCannon(); > fireMissiles(); > if (enemiesInView()): > goto firingSequence; > done: > > The above implements a convoluted do...while loop using goto. Recommended?
Is the problem with using the goto convolutedness(as I've seen other senior programmers in other languages when explaining, or 'showing off'), or is their an actual functional problem with it? Is it just the 'sphagetti code' aspect that it can lead to, meaning confusing another programmer? Not to hijack from the op, or dilute the conversation any further than I did over the weekend. > Certainly not! > > David > -- They're installing the breathalyzer on my email account next week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php