Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Scott Ellsworth <email@hidden>
- Date: Mon, 9 Jun 2003 18:21:27 -0700
On Monday, June 9, 2003, at 01:46 PM, John C. Randolph wrote:
On Monday, June 9, 2003, at 01:26 PM, zauhar wrote:
I can't tell you how many times I have typed '=' when it should have
been '=='. Likewise '&' instead of '&&'.
I think those macros are a very good idea.
I notice that the reaction to them here is about the same as when I
first mentioned them on comp.lang.c in 1985 or so. ;-)
I used to use macros like that, right about the era you mention. I
eventually stopped when _nobody_ I was training could read my code, and
I spent hours defending them in code reviews.
For a personal C project, I still use them. I find foo is "bar" a lot
more readable than "bar".equals(foo).
For Java, I put up with it, and try to find refactoring IDEs that have
decent warnings.
This is not a construct I love about C (or Java), but it is common as
heck, so I seek warnings to protect me. Sort of like
if (foo);{
}
should be caught by a typical warning. Sure, the syntax is _valid_,
but I have never knowingly written it.
Scott
_______________________________________________
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.