I have just been through the following paper and I found it extremely useful: http://www.objectmentor.com/resources/articles/Clean_Code_Args.pdf
I am looking for similar papers/books/tutorials/etc. that provide step-by-step practice on refactoring and/or correct class design. I have read Fowler's “Refactoring”, but I was looking for more substantial examples.
Refactoring is the process of restructuring code, while not changing its original functionality. The goal of refactoring is to improve internal code by making many small changes without altering the code's external behavior.
The best time for refactoring is before adding new features or updates to existing code. Doing so can help improve the product's quality. By cleaning the code base before adding new features or updates, it helps to make the product more robust and easier to use in the future.
To deliver business value with well-designed software in every short iteration, XP teams also use refactoring. The goal of this technique is to continuously improve code. Refactoring is about removing redundancy, eliminating unnecessary functions, increasing code coherency, and at the same time decoupling elements.
You probably won't find much resource about refactoring large examples step by step. Because you can never cover all types of example.
The reason Martin Fowler use small and easy example in "Refactoring", is because almost every large chunk of bad code are a combination of different bad smell. By learning how to recognize particular bad smell, you can fix the code gradually.
I will recommend you check Working Effectively with Legacy Code. It's a book that focus on the strategies to improve large legacy code. For class design, you probably want to read some books about design pattern.
Most important, try to apply things you learn in the book to your code.
The proof of the pudding is in the eating. Apply the principles you've learnt to the codebases you're working on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With