Re: Why does NSArray count return NSUInteger?
Re: Why does NSArray count return NSUInteger?
- Subject: Re: Why does NSArray count return NSUInteger?
- From: Scott Ribe <email@hidden>
- Date: Mon, 30 May 2011 09:08:51 -0600
On May 30, 2011, at 7:31 AM, Roland King wrote:
> No. I am saying that semantically the 'size' of an array is a non-negative integer and thus the correct way to represent it is with a data type which represents non-negative integers.
While that is certainly correct, the counter argument is that it is widely considered "good hygiene" in C to only use unsigned ints where you really need unsigned, because of the high potential for "hilarity" if one ever forgets and makes a simple subtraction where one shouldn't. It's really not worth the picky semantic correctness to use a type which can so easily cause so many bugs.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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