• 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: Inviting to comment on Cocoa categories
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inviting to comment on Cocoa categories


  • Subject: Re: Inviting to comment on Cocoa categories
  • From: Graham Cox <email@hidden>
  • Date: Mon, 10 Nov 2008 10:07:59 +1100


On 10 Nov 2008, at 5:47 am, Tommy Nordgren wrote:

//  TN+NSAffineTransform.h
@interface NSAffineTransform (TNGraphics)


A comment on naming conventions. It doesn't matter that much especially if you are just using them privately, but there's an inconsistency here. Usually I name category files primarily by the class they are a category on + the name of the category:

NSAffineTransform+TNGraphics.h

This seems to be a widely adopted convention.

Doing this allows you to see at a glance that the file contains functions which extend NSAffineTransform, which you might miss if the name doesn't start with the class. I tend to work with a narrowish files column in Xcode which truncates long filenames, so I find this helps there too.


+(NSAffineTransform *) transformRotatedAroundPoint:(NSPoint) p degrees:(CGFloat) deg;


A handy method, but I wonder if it could be named to be more readable with respect to its actual function, for example:

+ transformWithPoint:rotatedByDegrees:

this way each section of the method name is a functional description in its own right, whereas degrees: isn't (though in this case it's easy to guess what is wanted there). Also, it's not the transform that is rotated, so +transformRotatedAroundPoint: is not an accurate description of what the method returns. However I'm sure this could be improved upon further, just my first thought.

--Graham
_______________________________________________

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


  • Follow-Ups:
    • Re: Inviting to comment on Cocoa categories
      • From: Tommy Nordgren <email@hidden>
    • Re: Inviting to comment on Cocoa categories
      • From: Bill Bumgarner <email@hidden>
References: 
 >Inviting to comment on Cocoa categories (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Cocoa and NSLog
  • Next by Date: Re: NSGraphiteControlTint in app
  • Previous by thread: Inviting to comment on Cocoa categories
  • Next by thread: Re: Inviting to comment on Cocoa categories
  • Index(es):
    • Date
    • Thread