in reply to Re: reworking a large program
in thread reworking a large program

I have just finished reading this book. I bought it because I have just inherited a mountain of shoddy perl code and I was hoping it could help.

I found it to be the biggest waste of my time ever. The author has a tendency to "talk down" to the reader, and furthermore, spends most of his time bragging about himself and his friends. I found the writing style to be very annoying.

Once I got past that and into the "meat" of his "refactorings," it seemed like all he wanted to do was place labels on things that are (or should be?) common sense. He refers quite a bit to various "patterns" which of course can be found in other books. It seems like he wants his "refactorings" to be remembered as people remember the patters from these other books. Unfortunately, while I did find a lot of the patterns useful (or at least interesting), none of his refactorings seemed to have any basis in reality, or if they did, they were so blatantly obvious that it seems pointless to devote 6 pages to it.

For example, many of his refactorings are things like "move method" or "move field" - and of course he spends pages and pages discussing how to move a method. COME ON.

Of course there are probably a few meaningful and useful things in this book. His insistence that you edit in small steps and test regularly to make sure things keep working is of course a great thing to do.

I think something more useful would be to think of how you would design the program if you were starting from scratch. Thus, read up on program design and separation of business logic from presentation and object design and what have you. Once you have an idea of how you would program it were you to start from scratch, start examining what you have so far and think of what small steps you could take to bring your current "design" in line with your ideal design.