Best way to get rid of hungarian notation?

前端 未结 20 1146
萌比男神i
萌比男神i 2021-01-18 20:52

Let\'s say you\'ve inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in th

20条回答
  •  囚心锁ツ
    2021-01-18 21:10

    What would I do? Assuming that I just have to maintain the code and not rewrite it any significant way? Leave it well alone. And When I do add code, go with the existing style, meaning, use that ugly Hungarian notation (as dirty as that makes me feel.)

    But, hey, if you really have a hankerin' fer refactorin' then just do a little at a time. Every time you work on it spend ten minutes renaming variables. Tidying things up a little. After a few months you might find it's clean as a whistle....

提交回复
热议问题