The Dot Net Framework Is Wonderful, Period

time to read 2 min | 275 words

Yes, it is about time that I woke and smelled the coffee, isn't it?

I'm doing some fairly low level work right now, on stuff that ranges everything from reflection on generic types inference to handling nullable types appropriately to integrating anonymous delegates containers with some fancy stuff sprinkled on the top.

The nice thing is that the whole thing feels consistent even if you go into the bowels of the system. A generic type like typeof(IList<int>) is identical to any normal type, which means that quite a bit of code that is written to work against 1.1 can work unmodified against generic types. NHibernate has no code to handle Nullable types (int?), but it doesn't have to know. The CLR takes care of everything for it.

But I didn't get to the best part yet.

The best part is that you get so much information in the framework itself.

I had more than a bit of a struggle to get generic type inference to work. This mean that given a IFoo<T> and a typeof(User), I can generate a FooService<User>, and resolve any outstanding dependencies (like a dependency of ICache<T> to MyCache<User>, etc), this is not quite trivial. The really good part is that the CLR was very helpful in pointing that I did this or that wrong.  ("No, for the Nth time, you can't build a generic type without all the parameters, honest!")

From top to button, it is looking remarkably nice and consistent, and is usually a pleasure to work with.