May 3, 2013

Visual Studio 2012 must have extensions for cleaner code

I'm a huge supporter of clean coding (writing good code using principals, patterns and practices). Below is a list of some must have extensions for visual studio to help you code better and write cleaner code.

Resharper http://www.jetbrains.com/resharper/

Resharper is a developer productivity tool that enhances VS with a bunch of features to make you more productive. Not only that, Resharper helps you adhere to basic coding standards thru powerful code editing helpers and code generators, and helps eliminate errors and code smells, which ultimately lead to cleaner code. Some of my favorite features include:

  • Coding Assistance/Analysis

  • Refactorings

  • Code Generation

  • Enhanced Navigation




Agent Mulder http://hmemcpy.github.io/AgentMulder/

If your practicing clean coding and are programming to interfaces (like you should be) instead of concrete implementations, then I highly recommend Agent Mulder. Although Agent Mulder is not actually a VS extension (its actually a plug-in for Resharper), it integrates nicely with VS and Resharper to see your dependency injection container's registrations and help you navigate them.

[caption id="attachment_391" align="alignnone" width="410"]Agent Mulder Visual Icon Agent Mulder Visual Icon[/caption]

[caption id="attachment_390" align="alignnone" width="297"]Agent Mulder Navigation Agent Mulder Navigation[/caption]

Agent Ralph http://code.google.com/p/agentralphplugin/

Agent Ralph is another Resharper plug-in. This plug-in will help you keep your code DRY (Don't Repeat Yourself) by scanning your code and detecting functional duplicates, and offering the appropriate method to replace the offending code.

[caption id="attachment_392" align="alignnone" width="550"]Agent Ralph Agent Ralph detecting duplicate functional code[/caption]

GhostDoc http://submain.com/products/ghostdoc.aspx

GhostDoc is an awesome extension that automatically generates XML documentation comments for methods and properties. If your practicing clean coding techniques then you know your documentation is your code (prose). This is not always acceptable, especially in the enterprise, so if your going to be documenting in code, then automate it so its consistent. The added benefit of this extension is that it will make you name your methods and parameters better since it uses those names in the documentation.

[caption id="attachment_393" align="alignnone" width="585"]GhostDoc XML Documentation GhostDoc XML Documentation[/caption]

Indent Guides http://visualstudiogallery.msdn.microsoft.com/e792686d-542b-474a-8c55-630980e72c30

Indent Guides adds vertical lines to your code at each indent level. Its a great tool that can be styled and helps you see where you are in your code.

[caption id="attachment_395" align="alignnone" width="351"]Indent Guide Indent guide lines[/caption]

Productivity Power Tools 2012 http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd

Like Resharper, this one is packed with features. Some features overlap with Resharper so you may want to take a look at the settings after installing to turn them off. Some of my favorite features:

  • Custom Document Well that allows you to change the behavior of document tabs, including the ability to sort tabs alphabetically or by project

  • Format Document on Save

  • Email Code Snippet and HTML Code Copy

  • Align Assignment statements


[caption id="attachment_396" align="alignnone" width="672"]Productivity Power Tools 2012 options Productivity Power Tools 2012 options[/caption]

Team Foundation Server Power Tools http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f

The Team Foundation Server Power Tools extension is a very powerful and handy tool if you use TFS. Basically, its a set of tools and utilities that enhances TFS by exposing some of its features to VS and windows. For example, the tool provides an Alert explorer that provides a GUI to subscribe to alerts based on different scenarios and exposes a TFS context menu that can be used in Windows Explorer. In addition, the tool improves your teams use of TFS thru Custom Check-in Policies and a Best Practices Analyzer.

[caption id="attachment_397" align="alignnone" width="775"]TFS Power Tools TFS Power Tools context menu[/caption]

[caption id="attachment_398" align="alignnone" width="851"]TFS Power Tools Best Practices Analyzer TFS Power Tools Best Practices Analyzer[/caption]

Well thats it. I didn't mention it earlier, but Resharper will set you back about a $100 bucks; professionally, its a great investment. All the other extensions are free!

Any recommendations? Something I might have missed? Let me know.

No comments:

Post a Comment