On Oct 2, 2009, at 4:05 AM, Gregory Weston wrote:

It would be a good idea to get into the habit of initializing your local variables at the point of declaration.

At the risk of starting a religious debate, I disagree. It makes the code somewhat bigger and slower, and worse, it can mask uninitialized- variable errors that the compiler can otherwise catch for you (if you turn on the right warning flag, which unfortunately only works in optimized builds.)

I prefer to declare variables only at the point where they're first used, which means that most variables get initialized anyway with non- redundant values.

In the case here, initializing the variable doesn't actually help, as Bill pointed out.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to