Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Monday, 18 November 2013

Visual Studio 2013

I cannot believe it has been nearly six months since my last post. Time flies really fast. For you out there, Visual Studio 2013 has been launched. It comes packed with so many interesting features. If you are interested and want to explore, book yourself a couple of hours and watch the following short movies that were published on channel 9 as part of the launching campaign.

What's New in Visual Studio 2013 Integrated Developer Environment (IDE)

Introducing Visual Studio 2013 for Windows Store Developers building HTML App

Creating Quality Applications Using Microsoft Application Lifecycle Tools

Introducing Visual Studio Online

What's New for Web Developers in Visual Studio 2013

Enjoy :)

Friday, 19 April 2013

Visual Studio Features: Code Analysis, Code Metrics, and Code Clones

In this post I am going to introduce 3 Visual Studio features that are very interesting and helpful; but, alas, may not be that popular. I came to discover them recently and I instantly fell in love with them! I am sure you will love them too after you get to know and try them out. 

They are, namely: Code Analysis, Code Metrics, and Code Clones.

Code Analysis

The Code Analysis feature of Visual Studio examines the code by performing static code analysis to detect common pitfalls, defects, and violations of good programming practices. Thus helping developers identify potential design, globalization, performance, interoperability, and other issues in their code.   

The tool works to raise warnings that differ from compile errors and warnings; because the tool mainly searches for code patterns that are “logically” valid, though may still cause problems on the long run for you or for people who may check/use your code later.

Code Analysis can be run manually on a snippet of code, or even setup to automatically run as part of a Team Build or check-in policy for TFS [Team Foundation Server].  

Learn more about Code Analysis, What's New in Visual Studio 2012, and how to run Code Analysis on your system here.    

Code Metrics

Another feature that I truly like in Visual Studio 2012 is Code Metrics. Code Metrics is a tool introduced within Visual Studio that measures the evolvability and maintainability of a software system by calculating five important metrics. This helps the development team identify potential risks, understand the current state of their project, and track progress during software development.

The five metrics are:
  • Maintainability Indexa value between 0 and 100 that represents the relative ease of maintaining the code. Higher values indicate better maintainability.
  • Cyclomatic Complexity: this metric is a measure of the structural complexity of the code; it calculates the number of different code paths in the flow of the program. The actual value of this metric differs from one Visual Studio version to another. But a rule of thumb is that no individual method or property should have a Cyclomatic Complexity that is greater than ten.
  • Depth of Inheritance: it indicates the number of class definitions that extend to the root of the class hierarchy. The deeper the hierarchy the more difficult it might be to maintain and understand the code. However, a high depth of inheritance can also indicate a greater level of code reuse. So it is difficult to judge what a good depth is.
  • Class Coupling: this one measures the coupling to unique classes through parameters, local variables, return types, method calls, and other types in the source code. High values of coupling limit the value of a type to be reused; so a lower value [lower than ten] is what you should aim for.
  • Lines of Code: a value indicating the approximate number of lines in the code. A very high number indicates that the method/type is trying to do too much and should be split up. It may also indicate that the type/method is hard to maintain. 

More about this important topic and how to generate Code Metrics in Visual Studio 2012 can be found here and here

Code Clones

A personal favorite! It is a new feature introduced in Visual Studio 2012 that detects ALL code fragments that are copied throughout the solution. The tool detects the separate fragments of code that are very similar. Usually, code clones make it hard to change your application because you have to look for each fragment to update. Now it is easier as Visual Studio helps you find these clones so that you can refactor or modify them. Or just get to know the amount of “potential” copy/paste used in the system you are working on! :)

More about this, here

Sunday, 24 March 2013

Visual Studio 2012 Update Guide

Robert McLean has put together this awesome update guide for VS2012 and related tools/extension upgrade guide. If you're using VS2012, bookmark his page. I am sure you and your colleagues are going to need it one of these days.

Enjoy.

Wednesday, 20 March 2013

Image Tool Extension for Visual Studio

Greg Duncan highlights the Image Tools Extension for Visual Studio available from the Visual Studio Gallery which provides a number of simple actions for working with images within the IDE. Please refer to this article for more details.

Wednesday, 13 March 2013

Visual Studio Keyboard Shortcuts

It is often more easier to use keyboard keys to perform a specific task rather than using the mouse and trying to locate the exact menu item or function. I am a big fan of shortcut keys and I rely on them a lot during my daily development work.

There are a number of sites with detailed lists of useful keyboard shortcuts. Well today I am giving you the lists I found really useful. 

Happy coding.

Visual Studio 2010 Shortcuts

Visual Studio 2012 Shortcuts