Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of Hungarian notation in C# code in automated manner?

I have a large codebase that uses Systems Hungarian for most variable names, which basically means I have lots of objQueue's, objCommon's, dtDataSet's et cetera.

Is there any way to convert most of them? Especially, I want to get rid of irritating obj ones that have absolutely no sense, make variable names seem similar and the code completely unreadable.

There was a similar question but it was asking whether it's worth to do the replace.
Answers like “leave it as is” are not of any use to me because I'm definitely sure I need to do this.

The codebase is really large, and I don't want to rename variables one by one. Neither do I want to run Find & Replace because I'll get false hits and mess up code even further.

Is there any automated tool to make such replacements in Visual Studio? Some addin for Resharper, whatever?

like image 906
Dan Abramov Avatar asked Feb 22 '11 18:02

Dan Abramov


2 Answers

Alas, but it seems like there is no bulk rename tool for C#.
Please correct me if I am wrong.

like image 109
Dan Abramov Avatar answered Sep 22 '22 05:09

Dan Abramov


One solution would be to use something like Visual Assist's rename feature.

Other than that, a very careful search'n'replace (with a build between each modification followed by a check-in into source-control).

like image 44
Max Avatar answered Sep 20 '22 05:09

Max