Re: Unnecessary Boolean Warning
Re: Unnecessary Boolean Warning
- Subject: Re: Unnecessary Boolean Warning
- From: Graham Cox <email@hidden>
- Date: Thu, 04 Aug 2011 11:51:08 +1000
On 04/08/2011, at 11:36 AM, glenn andreas wrote:
> More likely the somebody that interviewed you didn't have it correct in the first place, scarring you for life...
Well, that part's true :)
I seem to recall I failed that question, the only one I did. So I got the lecture and never questioned it. I did get that job anyway, though in hindsight I'd rather I hadn't, but that's another story...
I think the point they wanted to get across was that they didn't want to see code like this:
if( someFunction() && someOtherFunction()){ ... }
instead of:
if( someFunction())
{
if( someOtherFunction())
{
....
}
}
where (they claimed) in the first case someOtherFunction() may or may not run depending on compiler implementation, and not dependent on the result of someFunction().
On the other hand, this was easily 15 years ago, maybe I've just forgotten the question and what it was all about. It happens - I forget so much stuff these days.
--G._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden