The BCL (still) not including a Set<T> class is among my highest pet peeves - it's a constant top 10 on product feedback. That Java's had it since Dec 1998 when Playground shipped with the Collections framework just makes things worse, arguably.
One of the other classes I miss (like Set, easy to make by hand, just annoying that it's not in the BCL) is LinkedHashMap which let you iterate over the keys in a hash in insertion order. To a much lesser extent, I kind of miss BitSet and WeakHashMap but those aren't as big of a deal to me. There are places where LinkedHashMap would be nice because you can't (for instance) serialize a hash because you're not sure what the right ordering is for the key/value pairs. Having a LinkedHashMap would fix this, since there's now an ordering associated with the hash.
Which classes/features do you miss? They don't have to be collections necessarily (and make to check out Power Collections if you want some very powerful collections in your .NET 2.0 development), but anything that you feel really should be in the BCL. If you get a chance, after you add a comment here, go ahead and make sure your entry is represented (add it if not) and voted for @ the product feedback center! 🙂
To be fair, there are things I really love about the BCL (and to an extent, the CLR's implementation and the C# compiler). A few:
- "real" generics (not just added compile-time type checkin) - a List<int> or Stack<int> isn't storing boxed objects. (check Anders' comments for details)
- IEnumerable<T> is a wonderful thing. Once you've had a problem where it's the right fit and you do a method with yield return, you'll wonder how you lived without it (think before and after owning your TiVo, for instance).
- IDisposable and using - while the particular pattern is still up for debate, and it's not brain-dead simple just yet, it's at least useful syntax sugar over try/finally's everywhere. Check out Andy's related blog entry for some background.
- String's overloads with StringComparison enum. This will cause religious wars and people will have love/hate relationships with these overrides, but I like the explicit-ness of it. String handling is something that's notoriously easy to write code that's simple, efficient, and wrong.
- SafeHandles - These are a great approach to encapsulating your unmanaged resources. It makes your development life a lot easier in my experience, and I'm looking forward to seeing how they're used by developers.
- BindingList<T> - data binding is already very cool, but BindingList<T> makes it so much simpler to make a custom object and have it bound to a DataGridView. Very useful stuff.
- BackgroundWorker - It's a great way of doing stuff on background threads. I already love that the CLR has its own threadpool (that the JVM didn't have one always surprised me), and now it's that much easier to use in a simple, easy-to-understand way (which arguably BeginInvoke and IAsyncResult was not)
And other 2.0 features in general:
- MSBuild - Yeah, the claims of "Ant rip-off" will be a-plenty, but having it as the file format for VS projects helps unify the worlds and makes it much easier on developers IMHO.
- ClickOnce - I haven't had a chance to really kick the tires yet, but from my Java WebStart days, it looks like a really slick implementation and I have a lot of hope for it.
- ASP.NET 2.0 - plentiful new features - it's very slick.
- All the entries in the System.Net.NetworkInformation namespace, like the NetworkInterface class.