Contents tagged with Generics

  • A Quick refresher on List<T>

    I'm a big fan of .NET Generics. In fact, I can't believe I lived without them in .NET 1.1.  Generics are pretty much the most powerful feature for C# 2.0. They allow you to define type safe data structures. They give a huge boost in performance, and they allow us to move away from DataTables and DataSets when it comes to collections of standard data.

    Microsoft's MSDN has a great article that explains more about generics. You can find it here.

    What I intend to give you in this short blog is a quick refresher on the List<T>. I've always loved this strongly typed list, and I cannot work without it.

    Let's take the class Ninja (Now remember there's a whole lot more to Ninjas than just their age and name):
    *Note this isn't the best made class, so please don't quote me on this one :P