You may say I’ve been reading a lot recently. And you can be right saying that
I’ve just read Refactoring: Improving the Design of Existing Code by Martin Fowler. I was really looking forward to reading it and I must say it was worth.
Mr Fowler started the book with an example of how to refactor poor code that is hard to read. He showed the refactoring process step by step pointing out the benefits of the changes. Only then did he start with the theory: definitions, why, when, what to refactor, possible problems, etc. What I liked was he admitted the importance of unit testing the changes (short introduction to JUnit), which can confirm they didn’t break existing logic.
But the real core of the book were the chapters that described in details different aspects and areas of refactoring: composing methods, moving features between objects, organizing data, simplyfing conditional expressions, making method calls simpler, dealing with generalization, and big refactoring. Each item was a separate chapter and contained a number of refactoring techniques. All techniques delivered in an easy to read form – motivation, mechanics, examples in UML and code).
I learned a lot and brushed up a lot. Even although some aspects seemed to be obvious and clear I got the naming and fresh look on them.