/Refactoring

Don’t Refactor Like Uncle Bob. Please

tl;dr: The author critiques an example refactoring from "Clean Code" by Robert Martin, arguing that Martin's changes introduce unnecessary complexity and side effects. The original function is split into a stateful class with unclear naming and fragmented logic. The author provides alternative refactorings that aim for simplicity and clarity over dogmatic adherence to certain principles.

featured in #524


Don’t Refactor Like Uncle Bob. Please

tl;dr: The author critiques an example refactoring from "Clean Code" by Robert Martin, arguing that Martin's changes introduce unnecessary complexity and side effects. The original function is split into a stateful class with unclear naming and fragmented logic. The author provides alternative refactorings that aim for simplicity and clarity over dogmatic adherence to certain principles.

featured in #523


The Ten Commandments Of Refactoring

- Armand Halbert tl;dr: Thou shalt: (1) Have a comprehensive suite of tests. (2) Take small steps. (3) Run tests frequently. (4) Use continuous integration. (5) Not add extra functionality while refactoring. (6) Refactor often. (7) Automate refactoring. (8) Not prematurely optimize. (9) not suffer duplicated code. (10) Not suffer excessively long functions, or excessively large classes. 

featured in #480


Avoid Rewriting A Legacy System From Scratch, By Strangling It

- Nicolas Carlo tl;dr: Instead of starting from scratch (1) have the new code direct to the old (2) re-implement each behavior on the new codebase (3) slowly delete the old code. Nicolas gives an example of this in action.

featured in #174