Re: GOTO's
From: Ken Smith (kensmith_at_green.rahul.net)
Date: 01/19/05
- Next message: Kryten: "Re: Cambridge (UK) engineer seeking job and home in Cambridge"
- Previous message: Dirk Bruere at Neopax: "Re: Magnetic Field Q"
- In reply to: Rich Grise: "Re: GOTO's"
- Next in thread: Rick Thompson: "Re: GOTO's"
- Reply: Rick Thompson: "Re: GOTO's"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 15:16:44 +0000 (UTC)
In article <pan.2005.01.19.06.23.14.112876@example.net>,
Rich Grise <richgrise@example.net> wrote:
[...]
>And a "GOTO" at the end of it destroys your continuity. A Wend closes the
>loop.
"WEND" is short for "What the hell did that END" You have to put a comment
on it to say what it ended.
> A GOTO can go anywhere, and is more likely to leave crap on the
>stack from the call it's pooping out of.
Someone more expert in C will have to comment on this for C but in Pascal,
no you can't. Jumps out of context are not allowed. Algol had the
"thunk" method to handle the jump out of context. It is quite a good
idea.
> It's a serious bug hole, and
>hellishly difficult to debug.
Given any program that uses GOTOs, you can recode it as one using a loop
enclosing a "switch" statement with the index of the switch being
reasigned within the cases. Thus it is proven that the ability to assign
to a variable is as bad as the ability to assign to the program counter.
-- -- kensmith@rahul.net forging knowledge
- Next message: Kryten: "Re: Cambridge (UK) engineer seeking job and home in Cambridge"
- Previous message: Dirk Bruere at Neopax: "Re: Magnetic Field Q"
- In reply to: Rich Grise: "Re: GOTO's"
- Next in thread: Rick Thompson: "Re: GOTO's"
- Reply: Rick Thompson: "Re: GOTO's"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|