Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13548

Re: The goto statement in PHP

From Tim Streater <timstreater@greenbee.net>
Newsgroups comp.lang.php
Subject Re: The goto statement in PHP
Date 2014-05-07 20:16 +0100
Message-ID <070520142016022238%timstreater@greenbee.net> (permalink)
References <12m67qcdacclw.zdjrtjbgfn8m$.dlg@40tude.net> <lk874j$jdn$2@dont-email.me> <oajkm9d68lp0l7m3v5oqeiqalgouadq54q@4ax.com> <lke0a8$gcs$1@news.albasani.net>

Show all headers | View raw


In article <lke0a8$gcs$1@news.albasani.net>, The Natural Philosopher
<tnp@invalid.invalid> wrote:

> On 07/05/14 16:13, Graham Hobbs wrote:
> > On Mon, 05 May 2014 10:27:36 -0400, Jerry Stuckle
> > <jstucklex@attglobal.net> wrote:
> >
> >> On 5/5/2014 9:50 AM, richard wrote:
> >>> In Liberty BASIC (LB) we also have branched goto labels.
> >>> As I was reading the goto manual on php.net I see where they make no
> >>> distinction between a label and a variable.
> >>> In LB it is simple.
> >>> a=0 is a distinct variable.
> >>> [a] is a distinct label.
> >>>
> >>> When goto [a] is encountered, it matters not what or where the variable
> >>> "a"
> >>> is.
> >>>
> >>> I'm just suggesting that they need a means to distinguish the pair.
> >>>
> >>
> >> Better yet - don't use goto.  I never have needed it.
> > Just reminds me of the 'sphagetti' code' days.
> 
> I have never NEEDED it above assembler code, it but I have occasionally 
> USED it.
> 
> I think its possible to say that its almost impossible to get away 
> without it at assembler level.

Well, in assembler it'll just be a JMP or equivalent, won't it.

> Sometimes 'Go To  jail: go directly to jail, do not pass Go, do not 
> collect £200' is exactly the simplest way to express something.

I once worked with a FORTRAN compiler that gave exactly that message if
you put:

       GOTO JAIL

> I've always felt Dijkstra was a bit of a Dijk...frankly.

Did he also try to insist on single-entry-single-exit for functions?
I've never paid any attention to that; early return for error
conditions is the way to do it.

-- 
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

The goto statement in PHP richard <noreply@example.com> - 2014-05-05 09:50 -0400
  Re: The goto statement in PHP Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-05 10:27 -0400
    Re: The goto statement in PHP richard <noreply@example.com> - 2014-05-05 11:08 -0400
      Re: The goto statement in PHP Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-05 11:33 -0400
        Re: The goto statement in PHP Tim Streater <timstreater@greenbee.net> - 2014-05-05 16:44 +0100
      Re: The goto statement in PHP Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-05-06 00:57 +0000
        Re: The goto statement in PHP Richard Yates <richard@yatesguitar.com> - 2014-05-05 19:06 -0700
          Re: The goto statement in PHP Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-05-06 17:23 +0000
    Re: The goto statement in PHP Graham Hobbs <ghobbs@cdpwise.net> - 2014-05-07 11:13 -0400
      Re: The goto statement in PHP The Natural Philosopher <tnp@invalid.invalid> - 2014-05-07 20:07 +0100
        Re: The goto statement in PHP Tim Streater <timstreater@greenbee.net> - 2014-05-07 20:16 +0100
  Re: The goto statement in PHP Norman Peelman <npeelman@cfl.rr.com> - 2014-05-06 22:02 -0400
  Re: The goto statement in PHP Arno Welzel <usenet@arnowelzel.de> - 2014-05-09 10:30 +0200
    Re: The goto statement in PHP Arno Welzel <usenet@arnowelzel.de> - 2014-05-09 12:00 +0200
      Re: The goto statement in PHP Mi Na <ya12983@mail.com> - 2021-07-23 00:55 -0700

csiph-web