Skip to content

Refactoring — From Zero to Hero

A standalone, beginner→advanced course on refactoring — improving the internal structure of code without changing what it does. Learn the discipline (small steps backed by tests), spot code smells, and apply a catalog of refactorings — each with a before→after in TypeScript, Python, Go, and Rust.

Intro & Principles

What refactoring is, why and when, small steps backed by tests, and reading code smells. Start →

Composing Methods

Extract & Inline Function, Extract Variable, Replace Temp with Query, Split Phase. Compose →

Moving Features

Move Function & Field, Extract & Inline Class, Hide Delegate / Remove Middle Man. Move →

Organizing Data

Encapsulate Variable & Collection, Replace Magic Literal, Replace Primitive with Object. Organize →

Simplifying Conditionals

Decompose & Consolidate, Guard Clauses, Replace Conditional with Polymorphism, Null Object. Clarify →

Simplifying APIs

Rename, Parameterize, Introduce Parameter Object, Remove Flag Argument, Factory. Refine →

Generalization & Inheritance

Pull Up / Push Down, Extract Superclass & Interface, Replace Inheritance with Delegation. Generalize →

Before → After, four languages

Every refactoring shows the messy code and its improved form in TypeScript, Python, Go, and Rust — synced tabs, so pick your language once.

Driven by smells

Each refactoring starts from the code smell it cures, so you know exactly when to reach for it.

Safe, small steps

The mechanics break each change into tiny, behavior-preserving steps you run tests between — refactoring without fear.

Bilingual + read mode

English and ไทย, quizzes with saved progress, and a distraction-free read mode.