Articles by Mark Looi
- Summary and Criticism of Fowler’s “Refactoring”
In this article, Mark summarizes Martin Fowler's book "Refactoring: Improving the Design of Existing Code". The book has become a vital resource in the field of software engineering for over two decades. Refactoring, the practice of improving existing software code without changing its functionality, is explained in the book with numerous examples and patterns. The article emphasizes the importance of regular refactoring to prevent code deterioration and maintainability issues. Code can atrophy due to changing environments or the need for additional functionality, leading to decreased effectiveness and increased complexity. Mark provides an example from the book that demonstrates the refactoring process. Fowler suggests breaking up large functions, decoupling data processing from printing and calculation, and using polymorphism to simplify conditional logic. The article also mentions the significance of automated testing to ensure the code remains functional after each refactoring step. Mark concludes by acknowledging some criticisms of the book and the need for a nuanced discussion on challenges and functional programming principles in refactoring.