Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!sun-barr!newstop!texsun!texbell!nuchat!buster!rli From: rli@buster.irby.com (Buster Irby) Newsgroups: comp.lang.c Subject: Re: C style peeve and knowing the rules Message-ID: <1990Mar27.174157.18800@buster.irby.com> Date: 27 Mar 90 17:41:57 GMT References: <2205@osc.COM> <340018@hplvli.HP.COM> <19356@megaron.cs.arizona.edu> Organization: Buster irby Lines: 36 robert@cs.arizona.edu (Robert J. Drabek) writes: >In article <340018@hplvli.HP.COM>, boyne@hplvli.HP.COM (Art Boyne) writes: >> jgk@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