Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/28/84; site lll-crg.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!gymble!lll-crg!brooks From: brooks@lll-crg.ARPA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Re: condition convention 'if (10 == j)...' Message-ID: <557@lll-crg.ARPA> Date: Sun, 28-Apr-85 20:51:18 EDT Article-I.D.: lll-crg.557 Posted: Sun Apr 28 20:51:18 1985 Date-Received: Tue, 30-Apr-85 02:36:19 EDT References: <137@bocklin.UUCP> <1456@amdahl.UUCP> <2140@sun.uucp> Organization: Lawrence Livermore Labs, CRG group Lines: 24 > What do you mean, any criticisms? This is one of the most ugly > perversions of C I've ever seen! I tend to read this in terms of > "if variable equals constant" and try to figure out how the value > "10" is ever going to change! YUCK YUCK YUCK!!!! > > People that write "if (10 == j)" probably also write "while (1)". > What do you mean, "while 1"??? Are you expecting "1" to change??? > Everyone knows this should be written "for (;;)", read "forever". > > Bill Shannon I will agree with a claim that (10 == j) is not very pleasing to the eye when you first see it. To claim that it is a perversion of C is going a little too far. It legal C and usage has a definite purpose for the error prone. To then claim that while(1) is wrong and that the proper way to do the same thing is for(;;) is going even further. Beauty is in the eye of the beholder. I understand what is being done with while(1), the compiler understands what is being done with while(1), even YOU understand what is being done with while(1). Hence its good C and does not deserve to be called wrong. For(;;) is not quite as clear to me and I would have to check the manual first. So lets cool the flame on a good suggestions that have the origin in the solution for a problem that bites many.