Solved

fixing variable names in code as per coding standard

Posted on 2010-08-30
10
253 Views
Last Modified: 2013-12-17
Hi,

We have fairly large piece of code developed over past several months. We have now realized that naming convention of variables is not following the standards. As the code is quiet huge we are trying to understand how to go about expediting this fixing of variables names as per coding standards.

Please suggest what is the best way to address this problem. Are there any third party tools available which can assist in this.

We are using Visual Studio 2008 and coding langauge is C#.

Thanks for your help
0
Comment
Question by:Alok-Agarwal
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 14

Expert Comment

by:systan
ID: 33561594
The first thing to do is to change color and font size, it can be found at Tools menu, Options, Environment, Fonts and Colors, then maximize your adjustment.
0
 
LVL 5

Author Comment

by:Alok-Agarwal
ID: 33561670
Hi,

Sorry, I did not understand how change of font and color can fix my variable name. e.g. if I wanted my integer variable should have started with int but by mistake I have not started any of my integer variables with int then how do I go about changing all my int variables to start with int without spending lot of time. As I said I have thousands and thousands of lines of code and fixing each of these manually is now going to eat lot of time, which I cannot afford.
0
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 33561914
>>I did not understand how change of font and color
The quickiest way to fix your problem is to change the font and color, that enables you to look-out directly the changes you wanted too.

Goto your VS Menu, at the [menu]s, you will find Tools[menu], at Tools[menu], you will find Options[at the bottom of menu], then if you find it, goto Environment, Fonts and Colors, then maximize your adjustment to see directly your look-outs to be changed.

In the Font and Color, you will find to change the size of the string, number, comment, etc.,...


>>without spending lot of time.
You have to spend a time for that, have fun in changing,  first thing? follow my suggestions.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Expert Comment

by:JensMig
ID: 33562756
You could use FxCop to identify deviations. Its free and its from Microsoft.
You can configure this tool to accept your own standards if they should be that different. The default is MS standard which - at least I think - is quite good.

Read more here:
http://msdn.microsoft.com/en-us/library/bb429476%28VS.80%29.aspx
0
 
LVL 14

Expert Comment

by:systan
ID: 33563927
FxCop has nothing to do with the problem.
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 33564689
You can use Code Rush and Refactor Pro tool,
Its too good and this will help.
0
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33566307
The best of my knowledge where you want to clean up such things I suggest you to use StyleCop/FxCop (Free from MS) to identify files/classes where's the discrepancy and then you can use some 3rd Party Tools like Resharper (Not free) do rename the variables. Resharper is intelligent enough to update all the Usages of the variables.

VS too can rename the Refactor -> Rename (or F2) but it's not efficient.
0
 
LVL 1

Expert Comment

by:JensMig
ID: 33569972
FxCop is a solution to find all variables with bad names systan. I dont know what color changes should help me if I dont know where to look at all?

There is a free express edition of Resharper available, both for VS 2008 and VS 2010. But normally the VS refactoring is sufficient.
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 33570001
FX Cop is best tool but You can use Code Rush and Refactor Pro tool are too good and handy..

http://www.devexpress.com/Downloads/Visual_Studio_Add-in/index.xml
0
 
LVL 2

Expert Comment

by:sumeetsuvi
ID: 34282367
Fx Cop is free & do right things according to you as you want....
You can make ur own rules..
So it is easy & effective.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question