Inconsistency in Style -> Unreadable Code

Kevin Braunsdorf agt at pucc-k
Sat Jul 27 07:26:56 AEST 1985


    All: I am a Computing Center Consultant at Purdue so I see more
different styles of coding per week than most programmers do in a year:
in my view the only bad style is an inconsistent one, eg:

	kp = ++i * j;
	j += 1;

	should be any of:
	i++;			i += 1;		kp = ++i * j++;
	kp = i * j;		kp = i * j;
	j++;			j += 1;

	or even:
	kp = (i += 1) * j;
	j += 1;

    Anything that I can notice a set pattern to will help me read the code:
as to the formatting of the code, I personally use
	while (exp) {
	    ...
	}	/* line close curly with while	*/
    but
	while (exp) {
	    ...
	    }	/* indent curly too		*/
    works for me too, as long as
	fnx()
	    {
	    ...
	    }
    is used too!

						:wq
						Kevin Braunsdorf



More information about the Comp.lang.c mailing list