Choosing a Frontend Framework

Beginner · 22 min

Why frontend frameworks exist, what React, Vue, Angular, and Svelte actually trade off against each other, and how to pick without guessing.

Before thisLinting, Formatting & Code Quality

Fireship · 22 min

Choosing a Frontend Framework

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by FireshipReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • A frontend framework exists to manage the relationship between application state and the DOM, a problem that gets unmanageable by hand past a handful of interactive elements.
  • React, Vue, Angular, and Svelte agree on the core idea — describe the UI as a function of state — and differ mainly in syntax, how much structure they impose, and where the update work happens.
  • Vanilla JavaScript is still the right choice for small, mostly-static pages where a few lines of DOM manipulation solve the whole problem.
  • Picking a framework is a team and ecosystem decision as much as a technical one — hiring pool, existing codebase, and available libraries usually matter more than micro-benchmarks.
  • None of the major frameworks is strictly "best"; each one made a different bet about where complexity should live, and the right pick depends on what you're building and who's building it.

The problem before the frameworks

Open a web page with no framework at all and you have an HTML document and a handful of DOM APIs. If you want a counter to go up when someone clicks a button, you write document.getElementById, grab the element, read its text, parse it, increment it, and write it back. That’s fine for one counter. Now add a shopping cart that needs to update a total, a badge in the nav, a list of line items, and a “checkout enabled” flag — all from the same piece of state. Every place that state shows up on screen is now a line of manual DOM-syncing code you have to remember to call, in the right order, every time the state changes. Miss one, and the UI silently lies about what’s actually true.

This is the problem frameworks exist to solve: keeping a growing number of on-screen representations in sync with a single source of truth, without hand-writing the sync logic every time. The core idea underneath nearly every modern framework is to describe the UI as a function of state — view = f(state) — and let the framework figure out what actually needs to change on the page when state changes. You stop writing “update this text node,” and start writing “here’s what the UI looks like given this data,” over and over, as the data changes.

Why there isn’t just one framework

If that idea is shared, why do React, Vue, Angular, and Svelte all exist separately, and why do people still argue about which to use? Because “describe the UI as a function of state” leaves a lot of design decisions open, and each framework answered them differently.

React treats the UI as plain JavaScript functions that return markup (JSX), and leans on the surrounding ecosystem — routing, state management, data fetching — rather than shipping all of it itself. That makes React flexible but also means a lot of early decisions are “which library do we add for this,” which is exactly why a separate deep-dive roadmap exists for it.

Vue keeps templates closer to regular HTML and bundles more decisions for you out of the box — reactivity, basic state, component structure — which tends to read as more approachable to newcomers while still scaling to large apps.

Angular is the most opinionated of the four: it’s a full platform with its own dependency injection, routing, forms, and HTTP client built in, using TypeScript as the default rather than an option. That structure is exactly what large engineering organizations often want, because it reduces the number of decisions every team reinvents.

Svelte takes a different approach entirely: instead of doing the state-to-DOM syncing work in the user’s browser at runtime, it moves that work into a compile step. Your component code compiles down to small, direct DOM-update instructions ahead of time, which means less code shipped to the browser and less work done at runtime.

None of these is a strictly better engineering decision than another — they’re different bets about where the complexity in your app should live: in a flexible core plus your own library choices (React), in a more batteries-included runtime (Vue, Angular), or in the compiler (Svelte).

When the answer is “no framework”

It’s worth saying plainly: plenty of pages don’t need any of this. If you’re building a marketing page, a documentation site, or something with a couple of buttons and a form, reaching for a framework and its build tooling is often more setup cost than the page is worth. A <script> tag with a few querySelector calls and event listeners gets you there faster, ships less JavaScript, and has nothing to configure. The state-synchronization problem frameworks solve only becomes painful once you have enough interdependent, changing state that manual tracking becomes error-prone — and a lot of real pages never cross that line.

How to actually choose

In practice, the choice rarely comes down to “which one renders fastest in a benchmark” — the major frameworks are all fast enough for the overwhelming majority of real applications. What tends to actually decide it:

  • Team and hiring. If your team already knows React, or the local hiring pool is overwhelmingly React developers, that’s a real cost to fight against, not a minor preference.
  • Ecosystem maturity. Does a library already exist for the specific thing you need — a particular charting library, a specific form of server-side rendering, a design system — in that framework’s ecosystem?
  • Existing codebase. Rewriting a working app to switch frameworks is rarely worth it purely for the framework; the migration cost usually dwarfs any marginal benefit.
  • How much structure you want imposed. A large team of many engineers often benefits from Angular’s opinionated structure, because it reduces bikeshedding; a small team moving fast might prefer React’s or Svelte’s lighter footprint.

The rest of this group treats concepts — components, routing, rendering strategies — as ideas that show up, under different names, in every one of these frameworks. The goal isn’t to crown a winner here; it’s to understand the landscape well enough that whichever one you end up using on a given job, you already know why it made the choices it did.

Check yourself

  1. 01What problem do frontend frameworks solve that plain JavaScript DOM manipulation doesn't?

    They keep the UI in sync with changing application state automatically, instead of making you manually track every element that needs to update whenever data changes.

  2. 02What do React, Vue, Angular, and Svelte have in common despite looking so different?

    They all let you describe the UI as a function of current state and handle updating the real DOM for you, rather than making you issue manual DOM commands.

  3. 03When is it reasonable to skip a framework entirely?

    When the page is small and mostly static, with only a little interactivity — a few DOM queries and event listeners solve the problem faster than installing a build toolchain.

  4. 04What usually matters more than raw performance when a team picks a framework?

    Ecosystem maturity, hiring pool, and fit with the team's existing codebase — these determine long-term velocity more than small differences in benchmark numbers.

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark