[Info-vax] BASIC (and Horizon)

Arne Vajhøj arne at vajhoej.dk
Tue Jan 30 18:54:17 EST 2024


On 1/30/2024 2:06 AM, Dave Froble wrote:
> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>> On 1/29/2024 7:50 PM, kludge at panix.com wrote:
>>> I have worked with people who could write spaghetti Fortran in any
>>> programming language available.
>>
>> "A real Fortran programmer can write Fortran in any language"
>>
>> Every time this comes up I post this Fortran/Pascal code:
>>
>>       PROGRAM GOTOFUN(INPUT,OUTPUT);

> I'm amused every time the GoTo bashing begins.
> 
> Not only is there nothing wrong when using a branch operation, when 
> appropriate, just look at the assembler listings after compilation.  
> Branching is just about all assembler does, as required.
> 
> Now, I won't defend what I and most consider improper use of the poor 
> misunderstood GoTo statement.

The IT world 50-60 years ago had a GoTo problem.

The lack of structured constructs in assembler, Fortran 66,
original Dartmouth Basic etc. had resulted in a lot of
spaghetti code.

And as a result GoTo got a very bad reputation.

The IT world today does not have a GoTo problem.

Many languages does not support GoTo, but even in the languages
that do support GoTo it is typical not a common construct.

There are actual cases where GoTo (goto in case sensitive languages)
can result in more readable code than the structured approach.

In languages without exception support then a goto down to
cleanup code can be very readable.

In languages without labeled break then a goto out of an
inner loop can be very readable.

Arne






More information about the Info-vax mailing list