Using advanced features in the real world
Many of the new features of C# 2.0 seems to be targeted toward a very spesific problem. Here is a short list of the things that I've seem. It just the feature, the target it's used for, and what I am using it for in a real project. When I'm talking about the intended usage, I'm talking about the main problem this feature is aimed to solve, and I deduct that simply by looking at where the most examples of it are.
Feature | Problem it is solving | What I am using it for |
Generics | Strongly typed Collections without custom classes. Casting hell. |
|
Anonymous delegates | Signle line event hanlders requiring their own method. |
|
Nullable types | Database persistance for value types |
|
Yield return | Simplifying iterations over complex graphs |
|
Just to clarify, I don't think that I'm doing anything special, but I do think that I'm putting some of the features to use in different context than what most people expect. So far I didn't have any problem in explaining my logic to other people, and I feel that it certainly help in encapsulating a whole lot of trouble in really elegant ways.
What unusual things are you doing with the new features?
Comments
Comment preview