Re: C
Re: C
- Subject: Re: C
- From: Gregory Weston <email@hidden>
- Date: Sun, 31 Aug 2003 21:36:37 -0400
On 8/31/03 at 11:49 AM, Jeff wrote:
>
On Sunday, August 31, 2003, at 12:31 AM, Clark Cox wrote:
>
>
> When I see extra parentheses, it makes me think "gee, this person
>
> wanted something other than the default behavior". But then, when I
>
> see that they actually wanted the default behavior, it usually makes
>
> me think that they missed something, I then have to scour the calling
>
> code to see if that's what they *really* wanted. If, on the other
>
> hand, the code is written with the language's rules in mind, I know
>
> that parentheses mean "I've changed the order for some reason".
>
>
This strikes me as an odd reaction, especially since parentheses are
>
all part of order precedence, which should simply reinforce its
>
meaning. Minimal precedence coding seems to be no virtue in and of
>
itself. To each their own, of course. I tend to come from the school of
>
thought that comments are to supplement code which could not be made
>
more clear on its own.
If I may be so presumptuous, I suspect what Clark is getting at is that he
doesn't see virtue in redundancy. Parentheses _are_ part of the precedence
scheme, but they're meant more as an override than as an operator in the
traditional sense. From a certain point of view,
z = w + (x * y);
might be considered just as obnxious as
z = w + x; /* Set z to the sum of w and x. */
You look at it and some part of the brain says: "Well, duh."
Parentheses do have value in disambiguating overly complex expressions, but an
alternative reaction to complexity - which I think Clark suggested - is to just
decompose the expression. If you've filled a 70-character line with a single
expression involving single-letter variables, I wouldn't say parentheses are the
answer.
G
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
- Follow-Ups:
- Re: C
- From: Jeff <email@hidden>