• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Good Habits (was: Re: C question for you old guys ;-))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Good Habits (was: Re: C question for you old guys ;-)) (From: Oscar Morales Vivó <email@hidden>)

  • Prev by Date: Re: C question for you old guys ;-)
  • Next by Date: Re: C question for you old guys ;-)
  • Previous by thread: Re: Good Habits (was: Re: C question for you old guys ;-))
  • Next by thread: Re: Good Habits (was: Re: C question for you old guys ;-))
  • Index(es):
    • Date
    • Thread