Rewriting methods within a project

As a growing development team, we are starting to face the challenge of rewriting functions that behave the same / identical.

We are all guilty of failing to write documentation as time is a limiting factor, however the idea of ​​collecting all current features (duplicates and all) and using that list along with applicable keywords and method summaries to define the current methods before we rewrite them has been suggested.

Now, before I go and write a solution, I just wanted to make sure that there is no perfect solution in there, I already did the obvious and did a bit of searching, but googling the Visual Studio + return function list and other options unexpectedly returns not a whole bunch.

Any suggestions would be much appreciated.

+1


source to share


1 answer


One option is to mark the suspect function with the Obsolete attribute and count the warnings that were selected. Repeat this function for the redundant function. Using this, you can find out which method is named more and save the effort of updating it elsewhere. This assumes, of course, that the functions have different signatures and that a simple find and replace operation did not solve your problem.



As with any large enterprise, you probably shouldn't try to do everything at once. As you find suspicious features, process them one at a time, and gradually refactor excess code from your system. This way, you are not wasting too much time, but you are making constant progress.

+2


source







All Articles