views:

69

answers:

1

As a growing dev team we are beginning to encounter the problem of rewriting functions that behave in similar/identical ways.

We are all guilty of failing to write documentation as time is a limiting factor, however the idea of gathering all current functions (duplicates and all) and using that list along with applied key words and the methods summary to identify current methods before we rewrite them has been suggested.

Now before I go and write a solution I just wanted to make sure there isn’t a perfectly good solution out there, I've already done the obvious and searched a little, but googling Visual Studio + return function list and other variations surprisingly returns not a whole bunch.

Any suggestions would be much appreciated.

+2  A: 

One option would be to mark a suspect function with the Obsolete attribute and counting the warnings that are thrown. Repeat for the redundant function. Using this you can find out which method is called more and save yourself the effort of updating it in more locations. This of course assumes that the functions have different signatures and that a simple find-and-replace operation didn't solve your problem.

As with any large undertaking, you probably shouldn't try to do it all at once. As suspect functions are found, deal with them one at a time and gradually refactor the excess code out of your system. That way you aren't spending too much time up front, but are making continual progress.

Jason Z
clever. I have never thought to set this compilation option on a user defined function.
J.J.