delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/04/05:45:20

From: jstacey AT plato DOT wadham DOT ox DOT ac DOT uk (J-P)
Newsgroups: comp.os.msdos.djgpp
Subject: (OFF TOPIC) Re: BREAKing out of a nested loop
Date: 4 Aug 2000 10:38:57 +0100
Organization: Wadham College Oxford
Lines: 27
Message-ID: <8me2vh$6o1$1@plato.wadham.ox.ac.uk>
References: <005a01bffd43$030a3520$0500007b AT brk> <4 DOT 3 DOT 2 DOT 7 DOT 0 DOT 20000803145250 DOT 00aa2310 AT mail DOT subdimension DOT com> <4 DOT 3 DOT 2 DOT 7 DOT 0 DOT 20000803161722 DOT 00aa8bf0 AT mail DOT subdimension DOT com>
NNTP-Posting-Host: plato.wadham.ox.ac.uk
X-Trace: news.ox.ac.uk 965381938 24298 163.1.164.74 (4 Aug 2000 09:38:58 GMT)
X-Complaints-To: newsmaster AT ox DOT ac DOT uk
NNTP-Posting-Date: 4 Aug 2000 09:38:58 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <4 DOT 3 DOT 2 DOT 7 DOT 0 DOT 20000803161722 DOT 00aa8bf0 AT mail DOT subdimension DOT com>,
Matt Lewandowsky  <djgpp AT delorie DOT com> wrote:
>I was just pointing out that getting into the habit of using goto makes it 
>far too easy to short-circuit things that the programmer *was* clueful 
>enough to do.

My point is that goto is an undeserving bete noire of programmers. If
you're clueful enough to use malloc() instead of static arrays, use
malloc() instead of static arrays. If you're clueful enough to use goto
instead of making your code potentially tortuous to get yourself out of,
say, an error, or a NULL-pointer return or some such, then use goto. If
you're not clueful enough to do either, consider retiring to Visual Basic.

Of course goto makes it more likely that you'll do something stupid. Using
C makes it so much likely anyway, though, that the extra tiny margin isn't
worth consigning a useful programming construct to the dumper for.

This is going to turn into a holy war, isn't it? goto always gets this bad
press, and whilst I always try and avoid its use, I don't mind using it if
need be. You're the atheist, I'm the utilitarian :)

Anyway, I'll put an "OFF TOPIC" up there so people can ignore it if they
want. And I'll put a quick "swear word" in here - damn - to stop it from
ending up in the mailboxes of people on the mailing list. I'm surprised
goto *itself* isn't a swear word :)

J-P

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019