A Simple CSV Export?

The following programming anecdote was posted by a former colleague on his Facebook page today:

A couple of years ago a fellow developer was asked to take some data and export it to CSV format. He took some time and researched a library. After, the manager/architect/lead developer (all the same person), questioned why he took that time, and why he didn’t just string.Join() them together and move on. He rattled off a few special cases, escaping characters etc. and stood by his decision though the person questioning still thought it a poor one.   About once a month since then I hear a new story about home-grown, handmade CSV functionality breaking because it didn’t account for a case, character or something previously unexpected.

It’s a reminder to me that no matter how simple the task appears to be, a thought should be given to it’s longevity, future usage, and potential expectations long after the initial case for creation has been forgotten. A small investment now can go a long way.

“The only way to go fast is to go well”   For those curious, the chosen library at the time: http://kbcsv.codeplex.com/

Well said.

My Visual Studio Theme

So I’ve finally published my Visual Studio theme on the Studio Styles website. It’s a customized version of the Ragnarok Grey theme created by Tomas Restrepro. I darkened the background then had to make a few other subtle changes for readability due to the darker background.

Ragnarok Dark as I’ve chosen to call it can be found here: http://studiostyl.es/schemes/ragnarok-dark-grey-customized

And remember to rate it if you like it!

Now a bonus for those of you that use ReSharper. The following line pasted into the bottom of the items section in the XML downloaded from the site before you import will make those To Do Comments and Not Implemented Exceptions stand out.

<Item Name="ReSharper Todo Item" Foreground="0x0000FFFF" Background="0x02000000" BoldFont="Yes"/>

Visual Studio Add-ons

I’ve been getting the same question a lot lately. What plugins, enhancements, extensions, etc. do you use in Visual Studio? So here’s the surprisingly short list:


The ReSharper website says:

ReSharper is a renowned productivity tool that makes Microsoft Visual Studio a much better IDE. Thousands of .NET developers worldwide wonder how they’ve ever lived without ReSharper’s code inspections, automated refactorings, blazing fast navigation, and coding assistance.

I can tell you the “.NET developers worldwide wonder how they’ve ever lived without ReSharper” is completely true. Once you learn to use it, you’ll never want to code without it. I remember the first week I used it I was angry at myself for waiting so long to get my hands on it.



The official product description reads:

StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project. StyleCop has also been integrated into many third-party development tools.

The ability to run a tool and have it tell you where to fix your styling is invaluable. Create a custom configuration file (agreed upon by the team of course) and then share it with your team or even better integrate it into you build server. This will ensure that a field is formatted like a field should be consistently in every file. No more style switches per file.

Oh and by the way, the latest release works with ReSharper to allow for quick cleanup of any errors found.


Search References

(Note: This is built into VS 2012 and beyond) How and why the functionality of this gallery extension isn’t built into Visual Studio completely baffles me. This simple extension adds a search box to the top of the .Net tab on the Add References dialog.


Snippet Designer

If you write code that is structurally the same over and over again, you should learn to build snippets. If you want to build snippets, you want to take a look at this extension. Snippet Designer allows you to highlight code and export as snippet. It has a great GUI for adding in replacement sections, setting the properties of your snippet, etc.

Here is a screenshot of Snippet Designer being used to edit my null coalescing operator snippet.