The Original Gay Porn Community - Free Gay Movies and Photos, Gay Porn Site Reviews and Adult Gay Forums

  • Welcome To Just Us Boys - The World's Largest Gay Message Board Community

    In order to comply with recent US Supreme Court rulings regarding adult content, we will be making changes in the future to require that you log into your account to view adult content on the site.
    If you do not have an account, please register.
    REGISTER HERE - 100% FREE / We Will Never Sell Your Info

    PLEASE READ: To register, turn off your VPN (iPhone users- disable iCloud); you can re-enable the VPN after registration. You must maintain an active email address on your account: disposable email addresses cannot be used to register.

Ok, be honest, who's a goto statement fan here?

silosybin

Porn Star
Joined
Nov 26, 2010
Posts
348
Reaction score
0
Points
0
Well, it's necessary in assembly, and maybe some older languages. They can also be useful if you're programming for microcontrollers where memory and processing speed are important. But anyone using gotos in anything remotely resembling a high-level language needs to have their programming licence revoked :P
 
I'm a fortran77 user, nuff said.

http://www.nsc.liu.se/~boein/f77to90/a2.html
Code:
Those statements we do not recommend have been indicated with the question mark "?" and in serious cases even with two question marks "??". 

Executable GOTO statements:

  GOTO snr1    - ordinary GOTO statement (jumps to the statement with
                 number snr1)

? GOTO (snr1, snr2, snr3), integer_expression
               - conditional GOTO statement. If the integer
                 expression is 1, 2 or 3, execution jumps to
                 statement number snr1, snr2 or snr3 (an arbitrary
                 number of statement numbers snr are permitted).

??GOTO statement_number_variable, (snr1, snr2, snr3)
               - an assigned GOTO statement, jumps to the statement
                 number that equals the statement
                 number variable (an arbitrary  number of
                 statement numbers snr are permitted).

??GOTO statement_number_variable
               - this is an assigned ordinary GOTO statement, it is a
                 combination of the first one, GOTO snr1, and
                 previous one, GOTO statement_number_variable without
                 a list of permitted alternatives.

??ASSIGN statement_number TO statement_number_variable
               - statement number variables can not be assigned with
                 an ordinary assignment of the type (integer
                 variable = integer expression), it has to be
                 done with the ASSIGN statement.  The statement
                 number variable can then be used for an assigned
                 GOTO statement and in the ordinary GOTO statement
                 and also in connection with FORMAT.

? IF (numerical_expression) snr1, snr2, snr3
               - arithmetical IF-statement, jumps to statement number
                 snr1 if the expression is negative,
                 snr2 if the expression is zero,
                 snr3 if the expression is positive

There's also the others that are Input-Output related, for instance if an end of file is reached, you can jump out of the read statement to execute a print statement which tells the operator of that condition, or don't bother and have the program halt and crash :)
 
In limited circumstances it is the cleanest, most straightforward thing to do.
Code:
...
    perform 0100-read-input thru 0100-exit.
....

 0100-read-input.
*Bypass all code '20' record types 

     read input-file into input-record 
             at end move 'Y' to eof-flag
                     go to 0100-exit
       not at end 
              if input-record-type = '20' 
                go to 0100-read-input 
              end-if 
     end-read. 
*Do some other stuff 
0100-exit.
    exit.
Yes, there are other ways to handle it but my rule is it's OK to go to an exit or go to the top of the paragraph. It is forbidden to go to another paragraph or to drop through an exit.
 
I have an old Fortran IV book, the title of which is self-explantory

"Fortran Techniques with special reference to non-numerical applications" by A. Colin Day, published by Cambridge University Press, ISBN 0-521-08549-7.

Here's is something programmers today would choke on.

attachment.php


attachment.php
 

Attachments

  • IMG000020.jpg
    IMG000020.jpg
    41.4 KB · Views: 96
  • IMG000019.jpg
    IMG000019.jpg
    22.9 KB · Views: 96
I think the last time I used a GOTO statement was in either a batch file or in qbasic..

Either way, it's been well over a decade.
 
The trouble with looking at old code - and i have looked at a lot of old code over the years.

Not only has philosophy changed over the years, but so have the entire dynamics of programming.

When i started - Computers CPU, storage were all very very expensive. In comparison, programmers were quite cheap.
Somewhere that totally changed.

Now one need not pay much attention to how much is taken up in storage.

In the old days, programmers used all kinds of tricks to save a byte here or a bit there.

I remember on programming language (apl) where we used to see how much could be written in a single line of code. Now apl was nearly unreadable - even to the original programmer - even weeks after writing the code. It was generally easier to rewrite a program than to debug it.

So, yeah - in today's world, "GOTO" is bad. But, i'll wager that 20 years from now - things we do today will seem just as antiquated.
 
A fan?

Not sure I'd call myself a "fan", but there are circumstances where judicious use of a goto can actually make the code easier to follow. It can eliminate a lot of complex conditional statements or weird logic.

Sometimes it can even result in elegance where there would otherwise be chaos.

Goto isn't a tool to be used imprudently or it will result in spaghetti code, but in certain circumstances, it's fabulous. ..|
 
Back
Top