Yeah.. I agree with you in the point of view. But if we take a look at it from different angle, NSMakeRect is better, because it is more understandable due to its resemblance to spoken English.

NSPointInRect vs. CGRectContainsPoint is more subtle. Is it Rect- related method or Point-related method?

Whatever they are, it would be great if there is consistency or if the document mentions those in "related functions or methods." part.


On Mar 15, 2009, at 12:04 AM, Andy Lee wrote:

I noticed the differences too, and my guess was that it makes it easier to find functions related to CGRects, by searching the API for terms that contain "CGRect". I actually prefer it this way.

--Andy

On Mar 15, 2009, at 2:43 AM, JongAm Park wrote:

Hello, all

I'm just curious about the naming convention for Core Graphics and Foundation. For example, NSMakeRect and CGRectMake are similar but different about where the "Rect" is in its method name.
What is even worse is NSPointInRect and CGRectContainsPoint.
So, if a person is used to the Foundation convention, it is not intuitive to find proper method in Core Graphics.

Is there any reason they are named like that?

Thank you.




_______________________________________________

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