Solved

fixing variable names in code as per coding standard

Posted on 2010-08-30
10
251 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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