Re: Good Habits (was: Re: C question for you old guys ;-))
Re: Good Habits (was: Re: C question for you old guys ;-))
- Subject: Re: Good Habits (was: Re: C question for you old guys ;-))
- From: Joe Osborn <email@hidden>
- Date: Mon, 9 Jun 2003 15:23:52 -0500
if([jupiter isInHouseOf:libra])
{
}
...
Well, if the code is that clear by itself, I don't bother commenting
it. It's just a good habit to have for when the conditions start
getting complex (I do have a habit of building 4-line conditions for
if clauses...).
That's what I'm saying-- make it this clear if possible. Turn
if ( (class_getClassMethod(aClass, @selector(description)) != NULL)
&& (class_getClassMethod(aClass, @selector(conformsToProtocol:))
!= NULL)
&& (class_getClassMethod(aClass, @selector(superclass)) != NULL)
&& strcmp (aClass->name, "WOResourceManager")
&& strcmp (aClass->name, "NSSimpleNumberFormatter")
)
//aClass is a valid class for our purposes.
into
if([self isValidClass:aClass])
_______________________________________________
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.