• 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
Refactoring tools was: Declarations near usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Refactoring tools was: Declarations near usage


  • Subject: Refactoring tools was: Declarations near usage
  • From: Keith Ray <email@hidden>
  • Date: Wed, 16 Oct 2002 17:41:51 -0700

On Wednesday, October 16, 2002, at 12:37 PM, Scott Anguish wrote:

On Wednesday, October 16, 2002, at 02:48 PM, James Hober wrote:

One thing I don't like about Objective C is that you have to declare variables at the top of a block. I think code that declares variables near their first use is much more readable. This is the norm in C++.

This is also the norm in Objective-C with the latest compiler (included with 10.2)


Two reasons to put declarations at the same place as first usage (initialization)
1. if you make a habit of it, it guarantees that variables are always initialized - bugs from uninitialized variables are nasty.
2. it makes refactoring easier <http://www.refactoring.com>

Is anyone aware of any refactoring tools for Objective-C++/Cocoa ?

--
C. Keith Ray
<http://homepage.mac.com/keithray/xpminifaq.html>
<http://homepage.mac.com/keithray/resume.html>
_______________________________________________
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.

  • Follow-Ups:
    • Re: Refactoring tools was: Declarations near usage
      • From: Georg Tuparev <email@hidden>
    • Re: Refactoring tools was: Declarations near usage
      • From: tibbetts <email@hidden>
References: 
 >Re: Declarations near usage (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Cocoa and PortAudio!
  • Next by Date: Re: A CFStringRef that throws EXC_BAD_ACCESS
  • Previous by thread: Re: Declarations near usage
  • Next by thread: Re: Refactoring tools was: Declarations near usage
  • Index(es):
    • Date
    • Thread