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: Oscar Morales Vivó <email@hidden>
- Date: Mon, 9 Jun 2003 19:13:08 +0200
On Monday, Jun 9, 2003, at 18:26 Europe/Madrid, Joe Osborn wrote:
On Monday, Jun 9, 2003, at 10:45 US/Central, Oscar Morales Vivs wrote:
What "good habits" does anyone else have?
...
- Use comments in then and else clauses if the condition is not
specially trivial. Like:
if(<very complex expression>)
{
// This means Jupiter is in the house of Libra.
...
}
else
{
// Jupiter is not in the house of Libra.
...
}
I would take this a bit farther, if possible.
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...).
_______________________________________________
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.