Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hplisa!hplvli!boyne From: boyne@hplvli.HP.COM (Art Boyne) Newsgroups: comp.lang.c Subject: Re: Re: C style peeve and knowing the rules Message-ID: <340020@hplvli.HP.COM> Date: 27 Mar 90 16:03:09 GMT References: <19356@megaron.cs.arizona.edu> Organization: Loveland Inst. Div Lines: 24 hascall@cs.iastate.edu (John Hascall) writes: > Operator precedence and associativity in C is quite complicated > and somewhat non-intuitive. An understatement. ggg@sunquest.UUCP (Guy Greenwald) writes: >For once, I agree with Robert J. Drabek. If you read his article carefully, >you'll see he's making a pedagogic point. A student who is required to use >the minimum number of parentheses will have to understand C's precedence >rules. Phooey - certain of the precedence are so counter-intuitive that after 6-1/2 years of programming in C, I still have a copy of K&R1's precedence chart taped to my wall. Trying to make a student learn it, and be able to reproduce it for a test, is ridiculous. As an employer, I am far more concerned about whether the student understands what a>b ? x : y does than whether he writes it as (a>b) ? (x) : (y). In industry, it costs a *lot* more to find a bug created by omitting a needed pair of parenthesis than it ever will to pay for the keystrokes to put in a pair in a doubtful situation. Art Boyne, boyne@hplvla.hp.com