Re: Larkin, Power BASIC cannot be THAT good:
- From: dplatt@xxxxxxxxxxxx (Dave Platt)
- Date: Tue, 19 May 2009 16:32:57 -0700
In article <U9idnercWrf-rI7XnZ2dnUVZ_tednZ2d@xxxxxxxxxxxxx>,
Phil Hobbs <pcdhSpamMeSenseless@xxxxxxxxxxxxxxxxxx> wrote:
It isn't GOTO that's horrible, it's named labels. Every time I come
across a named label in code, I have to go figure out every single place
in the code where the jump could have originated. Ugly ugly ugly. For
a state machine, it would be very unlikely to come from more than 100
lines away, which is barely acceptable. A switch statement in a
while(1) loop [or for(;;), which is more idiomatic] is the way to go for
state machines. That way you know where the code begins and ends, and
the machine code is equivalent.
There was a joke article many moons ago proposing a COMEFROM statement,
which would silently put a jump anywhere you liked--not very different
from a named label!
It could be worse.
The FORTRAN "Assigned GOTO" was distinctly worse than a C "goto".
The worst such in a traditional language, I think, was the use of the
ALTER verb in COBOL, which could modify (at runtime!) the intended
target of a single-sentence GOTO paragraph. As a result, you couldn't
trust any such GOTO in COBOL to do what the source code said it did -
you had to check the rest of the program to see if it was ever
ALTERed.
about it.brrr<<... it gives me chills and a queasy stomach just thinking
The worst I've run into recently, is the control language for a
radio-repeater controller I've helped set up. The language has a
whole bunch of primitive op-codes (which take a variable number of
parameters) stored in "macros" (think "subroutines"). Macros can call
one another (up to a limited depth), and many are called automatically
by the controller under certain conditions (time, carrier received on
a radio channel, etc.).
No, this control language doesn't have GOTO. Nor, sadly, does it have
anything resembling IF/THEN/ELSE. The *only* method it provides to
alter the form of control, is for one macro to change the code in
another macro (deleting it entirely, inserting or deleting specific
opcodes in its list, or copying its contents from a third macro).
Yup.. the only way to do *any* conditional coding in this language, is
to use self-modifying code. It's like the ALTER verb on meth.
It's definitely a waltzing bear.
--
Dave Platt <dplatt@xxxxxxxxxxxx> AE6EO
Friends of Jade Warrior home page: http://www.radagast.org/jade-warrior
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!
.
- Follow-Ups:
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Phil Hobbs
- Re: Larkin, Power BASIC cannot be THAT good:
- References:
- Larkin, Power BASIC cannot be THAT good:
- From: Jan Panteltje
- Re: Larkin, Power BASIC cannot be THAT good:
- From: John Larkin
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Nobody
- Re: Larkin, Power BASIC cannot be THAT good:
- From: Phil Hobbs
- Larkin, Power BASIC cannot be THAT good:
- Prev by Date: Re: Larkin, Power BASIC cannot be THAT good:
- Next by Date: Re: PowerBasic rocks!
- Previous by thread: Re: Larkin, Power BASIC cannot be THAT good:
- Next by thread: Re: Larkin, Power BASIC cannot be THAT good:
- Index(es):
Relevant Pages
|