Deconstructing a mess
-
Hi all, I've recently inherited a couple of projects that I am having a terrible time getting my head around. As I stare at a method of 600+ lines that is doing all manner of unrelated things, trying to make sense of it I wonder: Is there a formal name for what I am doing here? Surely this has a name, surely thousands of people have done this sort of thing before, surely there are resources to be had. Any pointers I could get here? A generic approach maybe? Point me in a direction? blah, -Jack
-
Hi all, I've recently inherited a couple of projects that I am having a terrible time getting my head around. As I stare at a method of 600+ lines that is doing all manner of unrelated things, trying to make sense of it I wonder: Is there a formal name for what I am doing here? Surely this has a name, surely thousands of people have done this sort of thing before, surely there are resources to be had. Any pointers I could get here? A generic approach maybe? Point me in a direction? blah, -Jack
Is this a .NET project? If it is, you can refactor it - there are tools that help. You could look at Resharper or Refactor!Pro to help you out.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Hi all, I've recently inherited a couple of projects that I am having a terrible time getting my head around. As I stare at a method of 600+ lines that is doing all manner of unrelated things, trying to make sense of it I wonder: Is there a formal name for what I am doing here? Surely this has a name, surely thousands of people have done this sort of thing before, surely there are resources to be had. Any pointers I could get here? A generic approach maybe? Point me in a direction? blah, -Jack
Hi Jack, here is my basic approach: - write initial documentation (basic design and information flow) - write unit tests (at least a few, because you will need them after next step) - refactor (there are many books about it, see also code refactoring[^]) - test extensively that functionality is still working and you haven't broken anything - complete your documentation (to the extend needed) Now you are ready to redesign and extend where needed. Btw, in some cases it is easier to just rewrite the whole mess from scratch, in any case keep the outer interfaces in the first refactoring round so you don't end up rewriting the whole application. Hope this helps! :) /M
Chat in Europe :java: Now with 24% more Twitter