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.

BTaught by Brad Traversy
4.8
83 enrolled

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

BT

Brad Traversy

Founder of Traversy Media and an educator known for practical, project-focused web development courses.

Course content