Software Design Principles in JavaScript
Learn to structure code that survives change: separation of concerns, coupling and cohesion, SOLID, composition, dependency injection, and the patterns worth knowing, all applied to real JavaScript you restructure yourself.
Start learning
Build real skills one lesson at a time
Explore the complete curriculum below, then start with the lesson that is right for you.
About this course
Most courses teach you how to make code work. This one is about what happens next, when the code has to change and somebody has to read it first. That somebody is usually you, six months later.
Every challenge hands you a program that already runs. You restructure it without changing a character of what it prints, which is the constraint real refactoring works under. All of it happens inside one small help desk, kept deliberately ordinary so your attention goes to the design rather than to the business.
This is a course about judgement rather than an API surface, so every principle arrives with its cost attached, and more than once the right answer is to leave the code alone.
What you'll learn
- Naming, single-purpose functions, pure functions, and guard clauses
- Separation of concerns, then measuring cohesion and coupling
- DRY, KISS, and YAGNI, including when duplication is the right call
- Composition over inheritance, and the contract behind a shape
- The SOLID principles, in the form they actually take in JavaScript
- Boundaries, invalid states, immutability, and errors as part of your API
- Dependency injection and code you can test without a pile of mocks
- Strategy, Decorator, Factory, Adapter, Observer, and Repository
It ends with a capstone: one seventy-seven line function taken apart a move at a time, then the same feature request made twice, before and after, so you can measure what the work actually bought.
Prerequisites
- Comfortable with JavaScript: functions, objects, classes, and modules. Take Intermediate JavaScript (opens in a new tab) first if that feels shaky.
- Some experience maintaining code you did not write. Every challenge starts from somebody else's working program, and that is the skill this course leans on hardest.
Course instructor
Brad Traversy
Founder of Traversy Media and an educator known for practical, project-focused web development courses.
Course content
- 1.1. WelcomeVideo
- 1.2. How to read a ticketReading
- 1.3. Design is about change, not beauty10XPReading
- 1.4. Put the knowledge in one place20XPCoding
- 1.5. Add a feature to code that fights you50XPCoding
- 1.6. The same feature, designed for20XPCoding
- 1.7. Complexity and code smells10XPReading
- 1.8. Quick check20XPQuiz
Keep learning
More programming courses
Beginner course
Learn Git
Understand Git through short terminal drills and a live view of the working tree, staging area, branches, and history.
View courseAdvanced course
TanStack Start Fundamentals
Take React full-stack with TanStack Start. Learn type-safe file-based routing, data loading with route loaders, URL search params, and server functions, then bring it all together in a complete full-stack project.
View courseBeginner course
JavaScript Basics
Learn the JavaScript language fundamentals (variables, types, control flow, arrays, objects, and functions) by running small programs in the console.
View course

