[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: My First Computer
Anders Carlsson <anders.carlsson@mds.mdh.se> writes:
> pausch@saaf.se (Paul Schlyter) writes:
>
> > while( printf("Hello\n"), 1 );
>
> I also found out that __ for(;printf("Hello\n");); __ works equally
> well as the while statement, although both will have a conditional
> to check for every loop.
for(;;printf("Hello\n"));
--- should get rid of the test, as well...
Anyway, using while() or for() to implement this is silly: C
*has* goto :-)
> By the way, speaking of readability in computer languages, there is
> some C implementation of a modem/network data decoding that uses a
> switch() statement as a piece of spaghetti art, running branches
> into eachother and stuff. I saw a few years ago, can't recall how
> it worked but it was non-trivial to follow.
Hum. "Duff's Device", I think?
--
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/