One more point regarding = and == (more flamage)

Byron Rakitzis byron at archone.tamu.edu
Sat Mar 23 00:49:37 AEST 1991


In article <3182 at inews.intel.com> bhoughto at pima.intel.com (Blair P. Houghton) writes:
-In article <13603 at helios.TAMU.EDU> byron at archone.tamu.edu (Byron Rakitzis) writes:
->the first instance is rendered UNAMBIGUOUS by the addition:
->b)	while ((*foo++ = *bar++) != 0)
-
-Or by the additions:
-
-	/* mommy:  please hold my hand */
-	while ((*foo++ = *bar++) != 0)
-
-Basically, if you're worth the meager pittance they direct-deposit
-into your debt with the Company Store, the comments will have
-existed long before you wrote the code.  Put those in, and make
-them accurate, and it doesn't matter how much the code obfuscates.
-
-It's called top-down design, and involves _thinking_ before
-you start making mistakes.
-

Using comments to explain away obfuscation when a simple alternative
is possible is *very* poor practise, in my view. How about:


	i++;

and

	/* increment the value of i, when i is nonzero (but if you look
	   at the code 2 lines above, you'll see that i is never zero at
	   this point) */
	i -=- i/i;



More information about the Comp.lang.c mailing list