#Refactoring
Every post that touches Refactoring, newest first.
Primitive Obsession: When a Float Isn't a Temperature
A float can hold any number, which is exactly the problem. Primitive obsession is why the same validation keeps reappearing, and value objects are the fix.
Clean Code28 viewsDependency Injection: Stop Building Your Own Dependencies
The moment a class builds its own collaborators, it quietly turns untestable and rigid. Dependency injection is the small habit that fixes both.
Design Patterns68 viewsThe Strategy Pattern in Plain Code: Kill Your if/else Chains
A growing if/else chain that switches on a type is a design pattern in disguise. Here's how the Strategy pattern turns it into small, swappable pieces.
Design Patterns33 viewsComposition Over Inheritance, Explained With a Real Example
Inheritance looks tidy until the hierarchy fights you. Here's the concrete point where 'is-a' breaks and 'has-a' scales, shown with real code.
Design Patterns22 viewsGuard Clauses: How to Stop Nesting Your Code Five Levels Deep
Deeply nested if/else blocks are hard to read and easy to break. Guard clauses flatten your logic with early returns so the happy path stays obvious.
Clean Code41 views
