Improving Your Visual Studio Workspace

Click. Click again. Start up your file browser. Search it. Drag it. Find a file inside the solution. Find the function with the name xyz. Do it again. When you are a developer working on larger projects, you wonder why you have to do this manually, the boring and repetitive way. There must be a few tools that can work seamlessly. Today we bring you the best modifications/add-ons for one of the most-used developer tools: Visual Studio from Microsoft.

The vast majority of developers will tell you a single name when you ask them for a reliable and quality IDE they use for writing code, and as soon as they are finished, to compile and execute it. This is Visual Studio from Microsoft. Although there are a few alternatives on the Internet, other than "Netbeans" for the Java Development side, nobody else has really managed to grab significant market share from the Redmond giant.

At least this is what the situation appears to be on the Windows operating system. According to the statistics from the World Wide Web Consortium, the Microsoft counterparts represented by Mac OS X and Linux have together 12 percent (eight and four respectively). Therefore, we can conclude that Microsoft Visual Studio is the dominant software developer tool/environment today.

However, with version nine arriving at the end of 2007 with Visual Studio 2008, the product is still far from perfect. Once you’ve deeply entered into working with it, you will soon feel that this could be done so much more easily, and if this would work like this or like that, everything would be much simpler.

Luckily for us, the Microsoft Visual Studio team learned from their earlier experiences. Watching the popularity of the Firefox browser due to its ability to be expanded (i.e. its plug-in system), they left a door open for developers brave enough to modify the tool for their own needs and, at request, extend it.

Now during this article I will not discuss how to do that. Instead, I will present a couple of great tools that will speed up your coding, eliminate repetitive, boring work and let you focus on the algorithm/code itself rather than on how you write it down.

First, I will look at the re-coloring the environment, and follow that with presenting a set of tools that helps you create, extend and maintain your code snippets. I am talking about add-ons to Visual Studio that will add new functions and make wonders happen with a click. In the end, I will present one of the two most comprehensive and famous add-on packages on the market currently:  Resharper from JetBrains and Visual Assist from Whole Tomato Software. We will focus on the latter one.

{mospagebreak title=Playing with the colors}

The colors of the text editor inside Visual Studio are white-based. I mean that the background is white, while the code inside the field is colored in a variety of ways that will let you distinguish a class name from a function and so on. At least, in  theory, this is how it should be.

Moreover, the most basic fonts we use for our web pages fail to provide a clear difference between the characters. Just think about the frustration caused by a mismatched O letter with the zero (0). Someone realized that this is intolerable in programming. Therefore, programming fonts were born. 

These were built with programmers in mind. Most of them focus on making each character as different as possible from the others. The creators of such fonts were programmers themselves, and they published their work on their personal web sites or in their personal blogs. You can find a nice collection of them here.

Another important trait of programming fonts is that these are monospace types. This means that every character will occupy the same amount of space, ensuring that the code is aligned perfectly inside the IDE. You can see a good comparison with images here. The new fonts improved the overall viewing experience; nevertheless, something was still missing.

Many people said that in practice, the white background is more limiting, and besides, it lights up your room. It is hard to distinguish keywords from variables, the contrast between objects is too small and enumeration can go on and on. Considering that the syntax recognizing part of it works well, it only required a little tweaking inside the options at the Fonts and Colors Tab.

The dark side, although a more dull color, offers greater liberty in choosing colors that will literally jump out at you. Soon enough, a "join the dark side" wave crashed over the net and the blogs of developers. Here is a comparison of the default settings and modifications based on the dark flourish:

 

You can transform the upper image into the one below:

 

This is certainly a dramatic improvement if you stay in front of monitors for hours. At least it will work well until you mix your code writing with sessions of reading and writing in tools that are all designed with a white background (like reading PDFs and using OneNote from Office Suite). If this is the case, switching between them can turn out to be a painful task if you have sensitive eyes.

If you have little time to waste with finding a good contrast yourself, or you are simply not in the mood to play around with the configuration tab, you can reuse the settings already made by others. The "Import and Export Settings…" menu from Tools is the place to search once you want to save or import color settings. Around the web you will find countless settings, most of the time on the blogs of fellow programmers.

For starters, look at the following blogs here, here, here or here. As for myself, I like the following two. The first has the merit of giving a greater contrast, while the second one offers more relaxing, yet distinguishable colors. Which one you prefer is up to you. I invite you to query the following menu and come up with your own ideas, and once you are done, come back and share them with us.

 

{mospagebreak title=The Tools}

We will split this category into two sections. There are the little add-ons that accomplish some trivial — yet so useful – jobs that you wonder why Microsoft did not add it when they created Studio. Secondly, there are the ones that try to automate and redefine the way you code. These tend to cost some heavy sum of money, as they require a much greater investment of time and effort. The earlier ones are free to download, as most of the time fellow community members offer their own time to create it.

Let’s get started. Aware of the importance of offering continuous support for extending the software and the capabilities of your software, Microsoft offers two places for these kinds of services/extensions at the MDSN download center. Loot to Visual Studio Gallery for the tools directly related to the Studio, and you can find open source projects over the CodePlex.

The Visual Studio Gallery contains more than 800 extensions grouped into 16 sections. The CodePlex offers close to 600 work items closed. With so many tools on offer, it’s hard to believe that a tool you might want to use has not yet been made; however,  if that is the case, you can add your own tool at CodePlex as long as you pair it with the source code.

The CodePlex features several programs related to different areas. The good thing is that here, all programs are published along with their source code. This is a perfect starting place to learn how to make professional applications. Text editors; extensions for software; a little tool allowing WOW players to optimize their cat, Bear, whatever — you name it, you will find a good example of how to do it here.

Now let’s see a couple of prime examples among the most useful items.  PowerCommands is a collection of handy little commands that should already be in Studio out of the box. We all know the solution explorer, and ever since I got my first glance at it, I’ve been asking myself where an open folder inside explorer command is. Capabilities similar to this are added to Studio with this add-on.

 

Collapse the entire solution, copy references from a project and paste them into another one, eliminating the precious time needed to do this for multiple solutions, is also a remarkable thing. Clear the recent project list, edit the project file on the fly or just undo the close pane; these are further options added to  Studio once you install PowerCommands.

There are many cooler features, like the ability to format the document on save to a clearer, more readable output. You can copy and paste classes and do a number of additional things, for which you will have to download PowerCommands and see for yourself. As a down side, many users complained of a few bugs — for example, some said that Studio closes for no apparent reason once you start to work with aspx and/or xaml files.

Another great addition is the Flat Solution Explorer. This will create files from inside the solution and allow you to sort them according to the names or the path. Additionally you can filter them through the text you enter into a textbox, making it a lot easier to manage large projects. 

Is it hard for you to find the dependencies inside a solution? It should be no problem once you install the Dependency Visualizer, which will draw a nice diagram of these. You can even take it one step further and install the Project Description. This will allow you to graphically design .Net Configuration Settings and generate the code along with the schema definitions for them.

I found it fun to build the relation UML between my coded classes with just a click.

 

Ora is a tool that intends to redefine the concept of regions, or even better, eliminate the need for them. This works only with C# projects, of course; nevertheless, that makes sense, because regions have not yet been introduced for other languages. 

The tool in its basics provides an instant grouped overview of the class, interface or struct you are viewing or editing. Because you choose the order of the items, you can see instantly whatever attracts your interest. You can order the items by Interface, Polymorphism, access and kind.

If you are in the business of C#, VB.Net and Managed C++ coding you may also want to try out TytanNET. It offers a good collection of tools for capturing debug logs and editing/visualizing the system variables right from the IDE. Code generation, known under the name of refactoring, and a nice registry viewer with search option inside Studio will get your attention.

Finally, there are extensions that may redefine the resources you use for creating applications. These offer an entire package of already-made graphic GUI segments, and you can create your application by simply editing an XML file and doing a little script writing, as is the case with the DirectUI GUI Library. Alternatively, you can use a built-in tool with which you can create with the mouse — modern looking software, as is the case with the SkinFeature GUI library.

For those of you who like to compress and do everything inside the IDE even more, a sticky note add-on may be just the thing. For a fast start-up of your project from the Vista Side-bar, you can pin your solutions once you install this extra. You are encouraged to eliminate even the last sign of duplicated code snippets with the Clone Detective.

{mospagebreak title=Packages} 

There are packages that promise to increase you productivity by 100 percent and even more. They offer a good part of what the tools manage to do on the previous page, and of course extend it with a personal touch. Most of them are quite costly. Nevertheless, once you’ve spent some time coding with one of them you will rapidly realize that they are worth every cent.

There is a free alternative, sort of, under the name DPack. This on its own manages to impress, however once you try either Resharper or Visual Assist it will appear pale in comparison. Still, for those of you who cannot afford one of the previous packages, this is a "must have" addition to the Visual Studio.

The advantage of Assist is that Resharper does not work with C++, and Assist does. You are free to download it and try it out, as there is a trial period of 30 days. First, it will let you further improve the coloring of the IDE as you can choose with what color to display classes, variables and so forth, giving you an even better view of the code. 

 

 

The add-on offers a large set of tools. I will not enumerate each one of them; instead, I’ll present you with a picture of the menu. My personal favorites that I think MS should absolutely implement inside Visual Studio 2010 are the Open Corresponding File, Open File in Solution (a sort of Flat Solution Viewer, but more fancy) and the spell check.

 

The refactoring options are also diverse and will save you much time that you would have otherwise spent doing it manually. The rename option is also priceless, allowing you to use a shorter name while you are developing; when you are finished, you can just use rename again to give it a more descriptive handle. 

  

Still, one of the best things I found in all of this is the internal Intellisense. As much as Microsoft tried to make it work close to perfect, I find that many times, inside complex solutions, Intellisense simply refuses to work. Pretty soon posts appear on forums with the topic title "I Hate Intellisense."

I have never had this kind of problem with Visual Assist. Even after all this, the most powerful part of the package remains the VA Snippets. Using this, you can bind specific code generation scenarios to certain texts. Consider it Intellisense on steroids.

For example, you can create a VA snippet for the code #f. Whenever you enter this, Intellisense will come up and offer you the option to insert the previously defined text. Inside the text, some system variables will allow the entering of the current time, date, user and so on.

In a similar way, you can define various class creation methods after entering the keyword class. The option to input text inside a textbox for on-the-fly written text is also available, as you can see from the picture below. The sky is the limit; it is all about using your imagination to get the most out of this tool. 

  

With this, we’ve arrived at the end of the article. I invite you to share with us what great add-on and/or tool you have just discovered or use on a daily basis. For this, the blog following the article will serve, and if you liked the article, please rate it. And you can always join our friendly forum at DevHardware and express  your thoughts there. Live With Passion!

2 thoughts on “Improving Your Visual Studio Workspace

  1. “that makes sense, because regions have not yet been introduced for other languages.”

    This is not true I use Regions inside VB.Net apps all the time, if you mean inline regions IE:Within a code block this is true then.

    Good article!

  2. Yes, sort of. I was speaking in general. I know this is present in some programming languages, however in others like C++ this is still just a dream or at a project status. Glad to here you liked the article!

[gp-comments width="770" linklove="off" ]