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>

Comments (7)

  1. Can you say what were the options, and what was the argument about?

  2. me says:

    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.

  3. Jonathan Allen says:

    I don’t get it. Maybe Collection is a little to generic, though I don’t see where, but Nullable seems dead-on.

  4. KathyKam says:

    Krzsyz talks about some difficulty in designing Collections here:

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

  5. TheMuuj says:

    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.

  6. Kathy Kam says:

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

  7. David Nelson says:

    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?

Skip to main content