• 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: odd behavior with NSError?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: odd behavior with NSError?


  • Subject: Re: odd behavior with NSError?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 2 Oct 2009 12:56:12 -0700


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 (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


References: 
 >Re: odd behavior with NSError? (From: Gregory Weston <email@hidden>)

  • Prev by Date: Re: View shifted up on iPhone simulator
  • Next by Date: Re: View shifted up on iPhone simulator
  • Previous by thread: Re: odd behavior with NSError?
  • Next by thread: Re: odd behavior with NSError?
  • Index(es):
    • Date
    • Thread