Clean Code and Refactoring
Naming, functions, code smells and safe refactoring techniques.
Taught by Anisha Rai · Senior Software Engineer
What you'll learn
- Choose names for variables, functions and classes that reveal intent without comments
- Break long functions into small, single-purpose units with clear inputs and outputs
- Identify common code smells such as duplication, long parameter lists and feature envy
- Apply catalogue refactorings in small, behaviour-preserving steps backed by tests
- Use SOLID principles pragmatically to decide where responsibilities belong
- Review code constructively and bring untested legacy code under control safely
About this course
This clean code and refactoring course is for developers with a year or two of experience who want to write code that colleagues can read, change and trust. You will learn practical principles for naming, small functions and clear control flow, learn to recognise the most common code smells, and apply safe refactoring techniques from the classic catalogue, such as extract function, introduce parameter object and replace conditional with polymorphism. You will meet the SOLID principles in a lightweight, pragmatic form, give and receive better code reviews, and work with legacy code using characterisation tests and small, reversible steps. Examples use JavaScript, TypeScript and Python, and the ideas apply to any language. You should be comfortable writing functions and classes and have written at least a few automated tests.
Course content
7 lessons- 1What Clean Code Means and Why It PaysWhy readability is a business concern, what clean code looks like in practice, and how technical debt builds up.Preview
- 2Naming That Explains ItselfChoose precise, searchable names for variables, functions and classes, and know when a comment still helps.
- 3Small, Focused FunctionsWrite functions that do one thing, stay at one level of abstraction and take few, clear parameters.
- 4Code Smells: Spotting Trouble EarlyRecognise the most common code smells, understand what each signals and decide which ones to fix now.
- 5Refactoring Safely, Step by StepApply catalogue refactorings in small, behaviour-preserving steps with tests and version control as a safety net.
- 6SOLID Principles Without the DogmaUse the five SOLID principles as practical guides for placing responsibilities and managing dependencies.
- 7Code Reviews and Legacy CodeGive and receive useful code reviews, and bring untested legacy code under control with characterisation tests.