C style peeve and knowing the rules
Jim Harkins
jharkins at sagpd1.UUCP
Tue Mar 27 10:31:04 AEST 1990
In article <19356 at megaron.cs.arizona.edu> robert at cs.arizona.edu (Robert J. Drabek) writes:
>I require my students to use the absolute minimum number of parenthesis
>until they have ALL the rules down pat. After leaving my courses (or in
>the privacy of their own PC) they'll do whatever feels good, but I will
>have done my job as well as I can by getting them to understand these
>details.
My God I hope I never ever run into one of your students. Pray tell, what
does
x = *a->b++ + ++z / 3 << 9^6 + 3 >> 2 ^ 5 <= 98 *~ c % d--;
evaluate to? And is it really what the programmer intended? Are you sure?
Why penalize a student for trying to make his code both more readable and
maintainable? And are you sure they don't get the code working using
parens, then re-edit it to remove the 'unneeded' parens? I sure would!
--
jim jharkins at sagpd1
We are all aware of the high cost of alcohol abuse. To help solve this problem
take this signature to your local liquor store for $1.00 off your next purchase.
More information about the Comp.lang.c
mailing list