Goto is so bad in computer programming it ...

Joined
Feb 27, 2011
Posts
15,427
Likes collected
83,655
Location
UK
Funster No
15,452
MH
Self Build
Exp
Since 2005
An xkcd cartoon is in the official docs for the goto command for PHP.

1649950412406.png



Sorry probably won't mean much to many, but I found it hilarious and I know there are quite a few programmers on this forum.
 
The first script I ever wrote on a ZX81:

10 Print "whatever"
20 GoTo 10

Actually I didn't get much more advanced :LOL:
 
Not a programmer but know enough to make me laugh nervously and saying surely not!
 
nothing wrong with GOTO 😁

10 PRINT “Hello World “;
20 GOTO 10

Subscribers  do not see these advertisements

 
I did a tiny bit of c+ programming and after a few hours I wondered where "goto" had err gone to. I googled it and read it was not good practice any more. Can't remember why. 🤔 Anyway, my interest in c+ only lasted a few days 😜
 
I got out of commercial programming (PL/I) when structured programming became de rigeur. As an MVS Systems Programmer using Assembler you could just use Branch instead of goto ....
 
Back in my COBOL days, press compile have a cup of tea feet up until the list of errors came back.
 
Nassi scheidermann charts sorted the “go to “ out.
 
Ah, the good old days:

1. Write Fortran code onto coding sheets and submit to typing pool.
2. Get 80 column cards back and hand in deck to run control.
3. Job runs on ICL 1904S* main frame running 'George' operating system with 64Kb of core memory.
4. Job fails due to spelling/typing mistake on coding sheet.
5. Correct error on coding sheet and start again at step 1.

Subscribers  do not see these advertisements

 
The bad thing about using GOTOs is you could end up in an endless loop. That was then, but nowadays most programs are endless loops. They jump out of the loop when an event occurs (mouse click, button press, time expired), perform a function, then drop back into the endless loop.
 
Ah, the good old days:

1. Write Fortran code onto coding sheets and submit to typing pool.
2. Get 80 column cards back and hand in deck to run control.
3. Job runs on ICL 1904S* main frame running 'George' operating system with 64Kb of core memory.
4. Job fails due to spelling/typing mistake on coding sheet.
5. Correct error on coding sheet and start again at step 1.
:LOL: I missed the final "Finish" on a Fortran program and it read the next program too. As a result I got an error printout 6" thick back, all of it totally useless. The joys of Fortran... or otherwise.
 
cannot believe ive never spotted that in php. no intention of using it but …. 1980’s calling.
 
Correct, some it's well over their heads, me included. May have well been written in Chinese. And the thing is i don't want to know.
 
I seem to remember that goto was about the only available loop structure in the original Sinclair BASIC. With IF to break out of the loop.

Subscribers  do not see these advertisements

 
cannot believe ive never spotted that in php. no intention of using it but …. 1980’s calling.
I didn't even think to look to see if PHP had a goto statement. I have been using PHP heavily since 1998 and never noticed.
It was added to V5.3 in 2009. WHY????
 
Oh and the big problem with GOTO for me is that if you goto something outside of the current stack frame without adjusting the stack the next RETURN will return to the wrong location and that bug would be extremely hard to track.
 
This thread reminds me of the late 70's when we used to go on our family summer holidays in our VW camper van to Port Grimaud. Dad used to pack his box of programming manuals first and we had to somehow find space for our things around it. We used to spend our days on the beach and Dad would be studying the manuals! 😊
 
Why do computer languages have such odd names like ANTHRAX or BOSTIK etc.?
The nice answer is that they were inventing things that had never been done before, so the names are bound to be a bit strange. If you think those are bad, you should see some of the modern mathematics stuff. The other answer is that they were invented by sad programming geeks, so what did you expect?

BASIC = Beginner's All-purpose Symbolic Instruction Code
ALGOL = ALGOrithmic Language
COBOL = COmputer Business-Oriented Language
C = the useful language developed from A and B.
C++ = A step improvement on C

ADA is named after Ada Lovelace, one of the first programmers, and PASCAL is named after Blaise Pascal, the French mathematician and philosopher.

JAVA was named after a type of coffee

Subscribers  do not see these advertisements

 
Last edited:
The nice answer is that they were inventing things that had never been done before, so the names are bound to be a bit strange. If you think those are bad, you should see some of the modern mathematics stuff. The other answer is that they were invented by sad programming geeks, so what did you expect?

BASIC = Beginner's All-purpose Instruction Code
ALGOL = Algorithmic Language
COBOL = Computer Business-Oriented Language
C = the useful language developed from A and B.
C++ = A step improvement on C

ADA is named after Ada Lovelace, one of the first programmers, and PASCAL is named after Blaise Pascal, the French mathematician and philosopher.

JAVA was named after a type of coffee

Don't call JAVA a programming language... It is an abomination :mad::LOL:
 

Join us or log in to post a reply.

To join in you must be a member of MotorhomeFun

Join MotorhomeFun

Join us, it quick and easy!

Log in

Already a member? Log in here.

Latest journal entries

Back
Top