RE: Delusions of Programming

I read a post by Jonathan Edwards recently called Delusions of Programming. Where he makes a few interesting points about the importance of IDE support. As someone who is a big fan of Boo I can definitely attest to the truth of his words. In my own words I have come to a similar lesson: good tooling can make even a bad language powerful and vice versa. As much as I love Boo and as powerful as it is, I’m still far more productive in C#. If Boo had the same quality of IDE tooling, and error messages it would blow C# out of the water… but it doesn’t. The actual language itself is probably less than 50% of the whole story.

Rant Of The Day

Close All But This

close all but this

The only time I ever select this command is so I can close all the documents. But then I have to go and close this one too. Why didn’t they just make a Close All command instead? When does anyone really want to Close All But This? Never is when.

Solution

power commands

Install Power Commands extension. And Productivity Power Tools while you’re at it (do it, it’s better than resharper). And uninstall resharper while you’re at it. Yuck.

 

close all

Very Handy Addition to Linq

I have found this custom extension method to be extremely useful when working with linq:

public static IEnumerable<T> Cast<T>(this object value)
{
    var enumerableOfTValue = value as IEnumerable<T>;
    if (enumerableOfTValue != null)
        return enumerableOfTValue;

    var enumerableValue = value as IEnumerable;
    if (enumerableValue != null)
        return Enumerable.Cast<T>(enumerableValue);

    return Enumerable.Cast<T>(new[] { value });
}

Basically it lets you turn any object into an IEnumerable<T>. Its especially handy when working with an object and you don’t know if it’s a single object or a set.