Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Andy Lee <email@hidden>
- Date: Wed, 11 Jun 2003 11:39:20 -0400
At 10:50 AM -0400 6/11/03, Robert Palmer Jr wrote:
what does:
"a is b" mean?
Seriously if I hadn't been told, this would NOT be obvious.
Don't forget this construct would only be used where a boolean is
expected, like "if (a is b)" or "while (a is b)". At least for me,
this would make it pretty obvious. Especially after having read this
long thread ;).
I personally think "a is b" or "a plus b" is much harder to read
than "a == b" or "a + b"
I don't think we're talking about using #defines for operators in
general -- just for a thoughtfully selected few cases where typos are
easily made and hard to spot. I would agree that using "plus" for
"+" would make me wonder why the programmer bothered with such a
contrivance. But if I saw "if (a is b)" I would figure out pretty
quickly what the intention was: to protect against a common typo.
- for this simple reason: my eye will track to the operator
And it might be even easier to spot the operator if it is emphasized
by your editor's syntax highlighter. But I don't think tracking to
the operator would be a problem for me personally. (Of course, if
you have a configurable editor, you could get "is" to be highlighted
as a keyword...)
I hope you'll accept what I fell are pretty objective observations.
Some of them seem pretty subjective to me, but reasonable.
--Andy
_______________________________________________
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.