• 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: is this badly written code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is this badly written code?


  • Subject: Re: is this badly written code?
  • From: Ferhat Ayaz <email@hidden>
  • Date: Tue, 15 Apr 2008 06:05:30 +0200


On Apr 15, 2008, at 4:53 AM, Adam Gerson wrote:

In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [[[[[self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];


If you have to embed a lot of messages, you should really consider to redesign your code. At least since you have to send message to objects far far far away from your actual object, it is a signal to refactor :)


Ferhat





_______________________________________________

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: 
 >is this badly written code? (From: "Adam Gerson" <email@hidden>)

  • Prev by Date: Re: Subclassing NSArrayController
  • Next by Date: [Moderator] Re: "hooking" into another app
  • Previous by thread: Re: is this badly written code?
  • Next by thread: Re: is this badly written code?
  • Index(es):
    • Date
    • Thread