Tuesday, October 21, 2008

Interesting Article - Future Creep

I ran across an interesting article through Digg on the 37Signals site. The comments are definitely worth the time to review and raise good points about the words "always" and "never." I agree with the article's main point but I also agree that there are times when planning for the future are necessary. When you have a moment, take a read: Beware of Future Creep.

Tuesday, October 07, 2008

Sorting a Generic List of Strings in C#

I've been looking around at how to implement a descending sort for a generic list of strings (List). After looking at several options of implementing IComparable, converters, and all sorts of other madness, it turns out the List object has a very easy way of doing this. So easy, in fact, that I'm sort of embarrassed I didn't just know it. In case there is anyone else who is in need of this simple solution, here is a short example.

List myList = new List();
myList.Add("AAAA");
myList.Add("ZZZZ");
myList.Add("MMMM");

myList.Sort();
myList.Reverse();

Painfully easy.