As I am waiting for Reflector to load and my browser to unfreeze, I thought maybe if I write down all the things that cause me friction when attempting to be productive, I may just feel a little less frustrated by it all.
So here it goes:
- Lotus Notes takes up to 20 seconds to redraw itself when returning from my VM
- SameTime can also take this long
- SharePoint Development Requirements - Lots of RAM and Windows Server OS
- SharePoint GAC Deployment - Recycling of App Pools gets old
- Getting distracted writing this blog post after Reflector finished loading 5 minutes ago
- Visual Studio Add Reference Dialog (can’t wait to get my whole team over to VS 2010 to cross this one off the list)
- Misleading WCF Add Service Reference Error Messages
- Did I mention Lotus Notes
- Web Meetings and Teleconferencing
- Two-factor authentication with a 5 minute timeout (Explanation: I am working for a defense contractor)
On the other hand, there are certain things that just plain allow me to be productive:
- My Wife Sarah
- GMail
- Google Reader
- Google Chat
- Visual Studio Intellisense
- FireBug
- Notepad++
- My Colleague Winston’s MindTree application
- Pencil and Paper (not the name of some app, I mean physical pencil and paper)
- Whiteboards
So what is causing you friction?
The title should say it all. Not sure why this didn’t make it into the System.Linq.Enumerable class, but this seems like a no-brainer. You need to sort a collection, but whether you sort ascending or descending is determined by a boolean argument instead of having to call a different method for each scenario. Add this to your collection utilities class immediately:
/// <summary>
/// Sorts the elements of a sequence according to a key.
/// </summary>
/// <exception cref="System.ArgumentNullException">source or keySelector is null.</exception>
/// <typeparam name="TSource">The type of the elements of source.</typeparam>
/// <typeparam name="TKey">The type of the key returned by keySelector.</typeparam>
/// <param name="source">A sequence of values to order.</param>
/// <param name="keySelector">A function to extract a key from an element.</param>
/// <param name="descending">if set to <c>true</c>, sorts the elements in descending order; otherwise in ascending order.</param>
/// <returns>An System.Linq.IOrderedEnumerable<TElement> whose elements are sorted according to a key.</returns>
public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, bool descending)
{
if (descending)
return source.OrderByDescending(keySelector);
return source.OrderBy(keySelector);
}
Recent Comments