Newsgroups: comp.os.msdos.djgpp From: manni DOT heumann AT gmx DOT de (Manni Heumann) Subject: Re: BREAKing out of a nested loop Distribution: world References: <005a01bffd43$030a3520$0500007b AT brk> <3989d7e4_1 AT news DOT uni-bielefeld DOT de> <3989f2c4 DOT 3822910 AT news DOT wins DOT uva DOT nl> X-Newsreader: News Xpress 2.01 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 04 Aug 2000 08:01:13 GMT NNTP-Posting-Host: dhcp33-228.uni-bielefeld.de Message-ID: <398a784a$1_1@news.uni-bielefeld.de> X-Trace: 4 Aug 2000 10:01:14 +0200, dhcp33-228.uni-bielefeld.de Lines: 42 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com eglebbk AT dds DOT nl (Evert Glebbeek) wrote: [SNIP] >>building the whole nest in a function and return? >No, this is the way to do it. I always split my code in small >functions that perform logical tasks, collision detection would be one >of these. >>Picture yourself reading that code! >Doing it all the time. Actually, I find something like > >if (sprites_collide(sprite1, sprite2)) > do_mega_big_explosion(); > Ok, I can see that. But what you have here is an example of how easy programming can be if you use exceptionally good libraries like Allegro. All you have to supply to that function are two tiny arguments, that already contain all the information you will need in that function. But often you will find yourself passing endless arguments back and forth. [SNIP] >Well, all I can do is explain why I don't use goto. If you >really feel you *have* to use goto, sure, go ahead. > Can we settle on this: Generally discouraging the use of goto would be going to far, just like demanding a goto in each and every case of breaking out of a nested loop. I guess what got me so worked up in the first place, was the statement that goto is evil and you should never ever use it. Just like that, no reason given. -- Manni "Life would be much easier if I had the source code."