I recently worked on a module that is a part of our product. The entire module was so badly designed and implemented that no good developer would want to own such a crappy code! I proceeded to use the same code and went on fixing and fixing and fixing and fixing issues. This was a mistake.
I really think sometimes scrapping such code and re-writing it is the best option. Not only will you be able to avoid all the issues, you will also be doing a big favor to your fellow good developers to read and understand it at a later stage. But it is important to realise that such complete scrapping is not always a feasible solution. If the code you’re dealing with involves only a few classes and related files, then you would be better off re-writing it if you are sure & convinced that there is a whole lot better way to get the work done. Any comments/experiences related to this anyone?