Just added: Algorithms you can run and practice
Updated Jul 10, 2026 Edit on GitHub

Why Frameworks Exist

Phase 1 covered the difference between a library (you call it) and a framework (it calls you). Now the harder question: why hand over the keys at all?

Carry this through the phase: a framework is a pile of answers to problems other people already hit - painfully, repeatedly - so you don't have to hit them yourself. It's frozen experience. Someone built ten apps, got tired of writing the same plumbing, and packaged the solution so the eleventh app starts further down the road.

This is the case for frameworks, made in good faith. Phase 3 makes the case against.

Problem 1: you keep rebuilding the same plumbing

Any web app needs the same underlying pieces, no matter what it actually does:

  • Something to map a URL like /users/42 to the code that handles it (routing).
  • Something to read the request - headers, form data, JSON body (request parsing).
  • Somewhere to remember who's logged in (sessions).
  • A sane way to talk to the database (DB access).
  • A way to turn data into HTML (templating).
  • A way to catch errors so one bad request doesn't take the server down.
  • Defenses against the attacks every public app gets hit with (security).

None of that is your product. A recipe app, a payroll system, and a multiplayer game all need this exact list - and building from a bare language with no framework means writing all of it yourself, every time.

Without a framework, project #1:
  build routing → build request parsing → build sessions →
  build DB layer → build templating → build error handling → ...then start your actual app

With a framework, project #1:
  it's all there → start your actual app

💡 This is the single biggest reason frameworks exist. Routing, sessions, and the rest are solved problems - thousands of developers already argued out the edge cases. A framework hands you their conclusions.

Problem 2: too many decisions, made over and over

Building from scratch isn't just more typing, it's more deciding. Where do models live? What's the folder for page handlers called? Hundreds of small questions - and on a blank canvas you answer every one, then re-answer them differently on the next project.

📝 Convention over configuration: instead of making you specify every choice, the framework picks sensible defaults and a standard structure. Put your models here, your routes there - and it wires itself together. You only override the rare unusual case.

The payoff is bigger than saved keystrokes:

  • Any developer who knows the framework can open your project and know where things live.
  • Onboarding a teammate takes days, not weeks - the framework is half the documentation.
  • The team stops bikeshedding over folder names. The framework already decided.

Problem 3: the dangerous stuff is easy to get subtly wrong

⚠️ Security is a set of traps laid throughout your app, invisible until someone falls in. The classics:

  • SQL injection - a clever form input hands an attacker every password in the system.
  • XSS - a user's input gets shown to other users, but it's actually code that runs in their browsers.
  • CSRF - a malicious site tricks a logged-in user's browser into acting on your app without them meaning to.
  • Password storage - store passwords wrong and one database leak exposes everyone.

Hand-rolled code can look completely fine and still be wide open - you won't see the hole, the attacker will. A mature framework ships defenses for all of these on by default: escaping output so XSS can't fire, parameterizing queries so injection can't land, handling CSRF tokens and password hashing for you. You'd have to actively go out of your way to make it unsafe.

For most teams, this benefit alone justifies the whole framework. See the OWASP Top 10 and SQL Injection & XSS guides for what these attacks actually look like.

Problem 4: your time is the scarce resource

Every hour spent rebuilding routing or debugging hand-made session logic is an hour not spent on what makes your app yours. A framework lets you spend attention where it's rare and valuable: the unique part. This is why a small team with a good framework ships in days what would otherwise take months - not because they're smarter, but because they're not re-solving solved problems.

Problem 5: you're choosing a community, not just code

A popular framework brings a whole world with it:

  • Plugins and packages for almost anything, already built and battle-tested.
  • Documentation and tutorials, because enough people use it to make explaining it worthwhile.
  • Stack Overflow answers - whatever weird error you hit, someone hit it first.
  • A pool of developers who already know it, which matters when hiring or joining a team.

💡 A technically nicer framework with no users can be a lonelier, slower place to work than a slightly clunkier one with a million developers and an answer for every question. Adoption is a feature.

So what's the catch?

Read that back and frameworks sound close to free money - and for most projects, reaching for one is the right call. But "it calls you" cuts both ways: you also accept its rules, its assumptions, and its magic, and sometimes the magic gets in your way. Phase 3 reads that bill line by line.

Recap

  • A framework is accumulated experience: answers to plumbing problems thousands of developers already solved, so you don't re-solve them.
  • Every web app needs the same plumbing - routing, request parsing, sessions, DB access, templating, error handling, security - and without a framework you rebuild all of it every project.
  • Convention over configuration means sane defaults and a standard structure, so there's less to decide, faster onboarding, and less bikeshedding.
  • Frameworks ship safe-by-default handling of the dangerous stuff (injection, XSS, CSRF, password hashing) that's easy to get subtly wrong by hand - often reason enough on its own.
  • A popular framework brings an ecosystem: plugins, docs, answers, and developers who already know it. Choosing a framework is partly choosing a community.

Quick check

[
  {
    "q": "What does 'convention over configuration' mean?",
    "choices": ["You must configure every setting before the app runs", "The framework picks sane defaults and a standard structure so you don't decide everything yourself", "Conventions are mandatory and can never be overridden"],
    "answer": 1,
    "explain": "It means sensible defaults and a standard layout out of the box - less to decide, easier for others to read your project, and you only override the unusual cases."
  },
  {
    "q": "Why is the security benefit of frameworks such a big deal?",
    "choices": ["Frameworks make apps run faster, which is more secure", "Hand-rolled security code can look fine but still be wide open; mature frameworks ship safe-by-default handling of injection, XSS, CSRF, and password hashing", "Security is only a concern for very large companies"],
    "answer": 1,
    "explain": "The dangerous stuff is easy to get subtly wrong by hand, and the holes are invisible to you but not to attackers. Safe-by-default handling is often reason enough to use a framework."
  },
  {
    "q": "What's meant by 'choosing a framework is partly choosing a community'?",
    "choices": ["You have to join an online forum to use any framework", "A popular framework brings plugins, docs, answers, and a pool of developers who already know it - its ecosystem is part of its value", "Frameworks are voted on by community members each year"],
    "answer": 1,
    "explain": "A technically nicer framework with no users can be slower to work in than a clunkier one with a huge ecosystem. Adoption itself is a feature."
  }
]

Before the quiz: without looking back, say (or jot down) the core idea of this phase in your own words.

Check your understanding 3 questions

1. What does 'convention over configuration' mean?

2. Why is the security benefit of frameworks such a big deal?

3. What's meant by 'choosing a framework is partly choosing a community'?