Skip to the content ForoHackers
Log inJoin

Web frameworks: start here

Web frameworks
#3429 · · Quote · Report

A web framework is a library of ready-made structure for building web applications: routing, templates or components, forms, database access, authentication. It gives a team a shared way of working in exchange for following its conventions. Frameworks exist for servers and for browsers, and they come and go, so learn the ideas beneath them.

Key concepts

  • Routing: mapping a URL and method to the code that handles it.
  • Templates and components: turning data into HTML on the server, in the browser, or in both.
  • Convention over configuration: sensible defaults let you skip decisions, until you need to override them.
  • Middleware and lifecycle: hooks around each request or each rendered component.
  • Inversion of control: the framework calls your code, instead of your code calling a library.

Vocabulary

  • MVC: model, view, controller, a common way to divide an application.
  • Server-side rendering: producing the HTML on the server before it reaches the browser.
  • Scaffolding: generating the starting files of a project or feature.
  • Micro-framework: a small framework that gives routing and little else.

What to study, in order

  1. Write a tiny framework yourself: a router, a template function and a request handler.
  2. Build one real app with a server-side framework in a language you know.
  3. Build the same app with a browser-side component framework and compare the effort.
  4. Read the framework's own documentation on its request lifecycle and its security defaults.
  5. Upgrade the app across a major change and see what coupling to the framework costs.

Related tags

#frontend #backend #design-patterns #architecture

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply