Sign in
Cyrus' Blather
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Email Blog Author
Share this
RSS for posts
Atom
RSS for comments
Search
Tags
No tags have been created or used yet.
Archive
Archives
November 2005
(1)
October 2005
(2)
September 2005
(11)
August 2005
(3)
July 2005
(5)
June 2005
(17)
May 2005
(8)
April 2005
(36)
March 2005
(30)
February 2005
(5)
January 2005
(7)
December 2004
(4)
November 2004
(5)
October 2004
(6)
September 2004
(16)
August 2004
(25)
July 2004
(35)
June 2004
(77)
May 2004
(73)
Collections + Count property
MSDN Blogs
>
Cyrus' Blather
>
Collections + Count property
Collections + Count property
CyrusN
16 May 2004 4:45 PM
Comments
3
Do I want a Count property on my collections? If so, it seems like I'm fundamentally limiting my collections to represent collections of finite elements. What if i want something that represents the set of all rational numbers?
ISet
<Rational> would seem the best candidate. However, then there isn't a valid value for Count to return. I could have it try returning -1, however, that seems quite ugly and seems like it might definitely confuse people. I could also have it return an IOptional<int> (see
http://weblogs.asp.net/jaybaz_ms/archive/2004/05/06/127693.aspx
) which could return a None<int> to indicate that this collection had no count. hrmmm... I thin for now I won't include a count as it just seems too limiting.
3 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...