C style peeve and knowing the rules

Buster Irby rli at buster.irby.com
Wed Mar 28 03:41:57 AEST 1990


robert at cs.arizona.edu (Robert J. Drabek) writes:

>In article <340018 at hplvli.HP.COM>, boyne at hplvli.HP.COM (Art Boyne) writes:
>> jgk at osc.COM (Joe Keane) writes:
>> >Here's my biggest C style peeve.  For some reason, many C programmers insist
>> >on always putting parentheses around return values, even when they're not
>> >required
>> Also, 'while', 'for', 'if', etc.,
>> all *require* parenthesis, so it's a reasonable habit to acquire.

>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.

Correct me if I am wrong, but the most import thing you can teach
a student is how to *analyze* and *solve* a problem using *all*
of the tools at his(her) disposal.  Instead, what your students
are learning is how to get eye strain trying to figure out which
operator takes precedence. 

You job is to point out all of the features of the language, both
good and bad.  However, you should not be forcing your *opinion*
of whether or not to use those features on your students.  After
all, aren't you trying to teach them how to make their own
decisions?

Do you also force your students to write programs that are not
indented?  Remember, the extra white space used to indent a
program is not necessary for the compiler, this feature only
applies to the humans.  By the way, have any of your students 
won the Obfuscated C Contest lately?  I thought so!  :-)

-- 
Buster Irby  buster!rli



More information about the Comp.lang.c mailing list