Archives for Uncategorized

The case for keeping dead code

I was reading Martin Van Aken’s great post on how dead code rots a codebase. To be clear up front, I completely agree with him and he makes some wonderful points. In previous teams that I’ve worked with, I’ve had this conversation countless times, which usually results in the forceful removal of both commented-out and [...]

Let sleeping dogs lie: the political issues with refactoring

I was recently reading some of our project’s code before adding in a new feature. As is typically the case, I felt the burning desire to make the existing code easier to understand. However, refactoring code without a specific purpose can be a controversial topic. Here’s my take: generally speaking, it’s a Good Thing to [...]

Refactoring as you go makes it hard to identify the important changes

I’ve always been a big fan of improving code as I read it (though this opinion is controversial). This typically happens when I’m trying to understand some code I’ve never seen before (or code that I’ve written long enough ago to have forgotten it). If I see an opportunity to simplify or clarify the code, [...]

Where the icons used in Visual Studio come from: Babel Icons

This is a fairly low-content post, but today I learned that the source for many of the icons in Visual Studio comes from the Babel package: The Babel Package comes with a collection of icons that are used in the IntelliSense completion lists and in the drop-down bar used for quick navigation. Most of these [...]

When .FirstOrDefault() doesn’t return null

I ran into an interesting bit of code recently that made use of the FirstOrDefault() method. The original developer had the intention of handling the case where the collection didn’t have a value, but made an incorrect assumption about the return value of FirstOrDefault(). Here’s an example of what was being done: DateTime? theDate = [...]