Refactoring to Command Pattern

I've spent the last two weeks reading another refactoring famous reference. After Refactoring, I decided to read Refactoring to Patterns, which is also very good, and today I'll share one sample of book's refactoring catalog: Replace Conditional Dispatcher with Command. In this example, you will be able to see some of book's approach and how this practice … Continue reading Refactoring to Command Pattern

Refactoring: write code that humans can understand

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." This is a famous phrase from Martin Fowler and one of the most relevant motivations for refactoring. Martin defines refactoring as "a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior". … Continue reading Refactoring: write code that humans can understand