Comfortably Dumb

Typical blog fare for family, work, gadgets, music, and games.

Resharper rocks!

In addition to all the awesome formatting and namespace management features, Resharper also detects certain coding issues like variables that gets assigned to and are never read but I was surprise to find out it even detects when a parameter won’t show up in a format string. Take the following snippet:

            foreach (ResourceScheduleDetail rsd in schedule.ScheduleDetails)
{
Console.WriteLine("AT={0};ASI={1};ASD={2};MRN={3};PtName={4};AD={3};", rsd.ApptStartTime,
rsd.ApptStatusInd, rsd.ApptStatusDesc, rsd.PtMRN, rsd.PtName, rsd.ApptDesc);
}

Resharper detects, and subtly notifies you through bolding and tool-tips, that the last field is improperly indexed as 3 instead of 5 causing the last parameter’s data to not be properly displayed in the console. While this is a trivial example finding hard to detect issues like this makes this an invaluable additional to your tool belt. Snap!

-CP

Published Monday, May 08, 2006 3:49 PM by Chris
Filed under:

Leave a Comment

(required) 
(required) 
(optional)
(required)