Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

fixing variable names in code as per coding standard

Posted on 2010-08-30
10
Medium Priority
?
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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