• 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: Why does NSArray count return NSUInteger?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Why does NSArray count return NSUInteger? (From: julius <email@hidden>)
 >Re: Why does NSArray count return NSUInteger? (From: Roland King <email@hidden>)
 >Re: Why does NSArray count return NSUInteger? (From: Roland King <email@hidden>)

  • Prev by Date: Re: Referencing struct fields in C
  • Next by Date: Problem using data in a distributed object
  • Previous by thread: Re: Why does NSArray count return NSUInteger?
  • Next by thread: Re: Why does NSArray count return NSUInteger?
  • Index(es):
    • Date
    • Thread