Goto [Was Re: Chown ???]

James Kosin jkosin at beta.intcomgrp.com
Fri Apr 10 17:58:32 UTC 2009


Dave Ihnat wrote:
> On Fri, Apr 10, 2009 at 11:07:00AM -0400, James Kosin wrote:
>> Actually, GOTO was very heavily in BASIC programming language.  There
>> was no idea of statement blocks back then.
>> It may be the only language at the time where it isn't considered taboo.
> 
> That's been a bone of contention for, literally now, decades.  "Goto"
> isn't _taboo_, as such.  It's misuse/overuse is taboo.
> 
> The purpose of deprecating use of goto was to avoid the spaghetti code
> that was so prevalent, especially in C.  HOWEVER, blind adherence to
> avoidance of the use of a strategically placed goto can result in
> equally obscure code.  This is typically seen in deeply nested if
> statements; I've seen nests 10 and 15-levels deep that would have been
> far more clear if a simple error-condition goto to the end of the nest
> had been implemented.
> 
> I remember a Master Chief Petty Officer in the Navy when I was a lowly
> Middie 3C.  He'd just done something that was Stricly Forbidden, and I
> asked him--very tentatively; you treat Master Chiefs with respect just
> below that of Captain, if that--if what he'd done was by the regs.
> 
> "Nope.  There are Rules, and they're good 'uns.  Follow them."
> 
> But...you just...
> 
> "Rules are good.  You gotta know when to follow 'em, and when not to.
> You don't know enough yet to know when not to follow 'em, so follow
> 'em."
> 
> It's been good advice for these past 30 years.
> 
> Cheers,
> --
> 	Dave Ihnat
> 	dihnat at dminet.com
> 
I'm not implying GOTOs are acceptable.  I'm only pointing out back then
they were common place for a different reason.
BASIC didn't have a method to put more than 1 statement in an [ if then
else ] without using either GOSUB or GOTO in some way.

James

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090410/8139cef8/attachment-0001.sig>


More information about the fedora-list mailing list