Welcome to MSDN Blogs Sign in | Join | Help

Kathy Kam

Reflection on the CLR and .NET
API Naming - Most debated name on the BCL are...

So.. in my previous post, I asked "which two names wa the most debated names on the BCL". Well, the types that got the most debate for its name are:

Nullable<T>
Collection<T>

Surprised? Not suprised? Do you think they are named appropriately?

<Editorial Coment>
Why is there only 2? Shouldn't you tell me "Top 3"?
"Hardest API to name #3" should be available in the next Orcas CTP. So I won't let the cat out of the bag just yet. :)
</Editorial Coment>

Posted: Monday, October 09, 2006 8:00 AM by KathyKam
Filed under:

Comments

Ayende Rahien said:

Can you say what were the options, and what was the argument about?
# October 9, 2006 12:10 PM

me said:

What is so controversial about those two types? They seem appropriately named. There are parts of the design that I do not like (especially in Collection), but the names seem very appropriate.
# October 9, 2006 2:37 PM

Jonathan Allen said:

I don't get it. Maybe Collection is a little to generic, though I don't see where, but Nullable seems dead-on.
# October 9, 2006 8:21 PM

KathyKam said:

Krzsyz talks about some difficulty in designing Collections here:

http://blogs.msdn.com/kcwalina/archive/2005/03/15/396086.aspx

# October 10, 2006 6:22 PM

TheMuuj said:

As a C# developer, I don't really mind Nullable<T>, since I tend to use T? anyway.  It's a shame VB developers have to put up with Nullable(Of T) for now.  Then again, they put up with the verbose casting syntax.

Collection<T> is pretty good, too.  I wouldn't like CollectionBase<T> as much because it's not a clean name when used directly (without inheriting from it).

The nice thing about Collection<T> is you can have an internal class FooCollection that inherits from Collection<Foo>, but expose your collection property as Collection<Foo>.  If you were certain you were never going to add any public methods, this makes for a very clean API (no cluttering the namespace with collection classes that nobody ever codes against directly).

Still, I tend to use FooCollection anyway since it versions better.  I'm not sure, but changing a non-virtual read-only property to a derived type is still a breaking change.  Maybe co/contra-variance needs to be added to runtime versioning support.

# October 16, 2006 11:28 AM

Kathy Kam said:

Once again, I am very excited that the new CTP is available. :) My second feature for Orcas is available

# October 30, 2006 5:57 PM

David Nelson said:

Collection<T>, although a useful class, is horribly named. "Collection" is a very general term for a structure which holds things (see ICollection and ICollection<T>). Collection<T> is essentially a List<T>, with some overrides included for customizing the behavior if desired. That means it is basically a slightly MORE specific version of List<T>. But it has a LESS specific name. Am I the only one who thinks this makes no sense whatsoever? What was the justification for calling it Collection<T> in the first place?

# May 2, 2007 3:35 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker