[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: My First Computer
pausch@saaf.se (Paul Schlyter) writes:
> In article <86el6ggyeo.fsf@raw.grenland.fast.no>,
> Raymond Wiker <Raymond.Wiker@fast.no> wrote:
>
> > Anyway, using while() or for() to implement this is silly: C
> > *has* goto :-)
>
> Apparently you're a supporter of "spaghetti programming"..... :-)
No, I'm not. On the other hand, I'm not a supporter of
mindlessly following other peoples (mis)conceptions about programming.
In other words, I use goto whenever that makes for simpler code.
That said, I wouldn't use goto for an infinite loop, even
though that is clearer than misusing "while" or "for" :-)
> Yes, C has goto, and there are valid uses for goto in C, however
> replacing a while or for loop is not one of them.
while(1) and for(;;) are the idiomatic forms of an infinite
loop in C. That is the only reason they may be preferable to using
goto...
--
Raymond Wiker Mail: Raymond.Wiker@fast.no
Senior Software Engineer Web: http://www.fast.no/
Fast Search & Transfer ASA Phone: +47 23 01 11 60
P.O. Box 1677 Vika Fax: +47 35 54 87 99
NO-0120 Oslo, NORWAY Mob: +47 48 01 11 60
Try FAST Search: http://alltheweb.com/