The Mental Models That Frame Everything
"The client is untrusted territory, the network is volatile, and the server and what you as a developer are what you can reasonably control."
CSE 135 — Full Overview
The Internet is infrastructure. The Web is one application running on it.
HTTP is an application-layer protocol — it delegates delivery and routing to the layers below.
| Layer | What | Question It Answers |
|---|---|---|
| Application | HTTP, HTTPS, FTP, SMTP, DNS | "What do I want to say?" |
| Transport | TCP (reliable) or UDP (fast) | "How do I ensure delivery?" |
| Internet | IP (IPv4 / IPv6) | "Where does it go?" |
| Link | Ethernet, WiFi, fiber | "How does it physically travel?" |
The client asks, the server answers. The server never initiates.
~15 steps from keypress to pixels — the single most important mental model in this course.
| Phase | Steps | What Happens |
|---|---|---|
| Resolution | 1–2 | URL parsing, DNS lookup |
| Connection | 3–4 | TCP handshake, TLS handshake (HTTPS) |
| Request | 5–6 | HTTP request sent, server routes it |
| Processing | 7–8 | App code runs, database queries |
| Response | 9–10 | HTTP response sent back via TCP/IP |
| Rendering | 11–15 | HTML parsing, CSS, JS, layout, paint, display |
| Phase | Where | Course Connection |
|---|---|---|
| Resolution | Client + DNS | URL Overview |
| Connection | Client ↔ Server | Network Stack (S2) |
| Request / Response | Client ↔ Server | HTTP Overview |
| Processing | Server | Execution Models (S17) |
| Rendering | Browser | Architecture Generations (S19) |
HTTP + HTML + URLs — everything else builds on these three.
| Pillar | Role | Analogy |
|---|---|---|
| HTTP | The protocol — how client and server communicate | The postal system |
| HTML | The content — what gets displayed | The letter itself |
| URLs | The addresses — where things are | The mailing address |
Everything else — CSS, JavaScript, databases, frameworks, APIs — builds on top of these three.
The web is a system of named, addressable, linked resources.
Anything with a URL can be:
A resource is the concept. A representation is the format delivered.
The client signals preference via Accept header (including Accept-Language). The server responds with Content-Type. This is content negotiation.
<a href> connects resources into a traversable graph. The link is arguably the web's most important invention.
Architecture, Coding, Hosting, Design, Content/Visuals — where does each topic fit?
| Pillar | What It Covers | This Course? |
|---|---|---|
| Architecture | Client-server, REST, MVC, HTTP, TCP/IP | Primary focus |
| Coding | PHP, Node.js, Python, SQL, JavaScript, HTML | Primary focus |
| Hosting | Apache, Nginx, Linux, Docker, cloud, DNS | Primary focus |
| Design | CSS, responsive design, UX, accessibility | Mentioned |
| Content/Visuals | Images, video, typography, data viz | Mentioned |
Developers, Owners, and Users shape every technology decision with different priorities.
| Group | Cares About | Common Conflict |
|---|---|---|
| Developers | Clean code, modern tools, DX, interesting problems | May over-engineer or choose tools for resume appeal |
| Owners | Cost, time-to-market, reliability, compliance, ROI | May cut corners or resist upgrades |
| Users | Speed, ease of use, accessibility, privacy | Rarely consulted; needs assumed not measured |
The web runs on open standards that anyone can implement. No single company owns it.
| Domain | Standard | Body |
|---|---|---|
| Transport | HTTP, TLS, TCP, DNS | IETF (RFCs) |
| Markup | HTML Living Standard | WHATWG |
| Styling | CSS | W3C |
| Scripting | ECMAScript (JS) | TC39 |
| Accessibility | WCAG | W3C WAI |
| Encoding | Unicode / UTF-8 | Unicode Consortium |
IETF = plumbing. WHATWG = markup. W3C = styling + accessibility. TC39 = language. Together = the platform.
What makes the developer's job easier vs. what makes the user's experience better.
| DX Choice | User Impact |
|---|---|
| 2 MB JS bundle for a blog | Slow load, broken without JS, drains battery |
| Client-side rendering for static content | Blank page until JS loads, poor SEO |
| CSS-in-JS libraries | Larger bundle, slower rendering |
Where should logic run — in the browser or on the server?
| Aspect | Thick Client (Browser) | Thin Client (Server) |
|---|---|---|
| Examples | React SPA, Gmail, Docs | Wikipedia, Craigslist |
| Initial load | Slow (large JS bundle) | Fast (ready HTML) |
| Works without JS | No | Yes |
| SEO | Difficult | Easy |
| Security | Logic exposed in client | Logic on server |
| Complexity | High | Low |
Four stacked layers, each building on the one below.
:hover, transitions). HTML has built-in interactivity (<details>, <dialog>). But layered dependencies help you reason about what breaks when a layer fails.
Content-dominant sites and interaction-dominant apps need different architectures.
| Characteristic | Site-like | App-like |
|---|---|---|
| Primary content | Documents, articles, media | Interactive features, real-time data |
| Navigation model | Page-to-page (1 URL = 1 page) | State-based (views within a shell) |
| JavaScript role | Enhancement (optional) | Essential (won't work without it) |
| Rendering approach | Server-side / static | Client-side / hybrid |
| SEO importance | High | Often low (behind auth) |
| Caching strategy | Aggressive (content rarely changes) | Complex (real-time data) |
HTML is the content layer of the Web — structure, meaning, and remarkable browser forgiveness.
| Feature | HTML5 | XHTML |
|---|---|---|
| Tag case | <DIV> = <div> | Must be lowercase |
| Closing tags | <br> (optional close) | Must self-close: <br /> |
| Attributes | checked (boolean OK) | checked="checked" |
| Error handling | Browser guesses & recovers | Parser stops on first error |
The original mechanism for sending data from client to server — and still foundational.
/search?q=javascriptfetch(), before XMLHttpRequest — forms were the only way to send data. Progressive enhancement starts with forms.
Every client-side "security" measure is trivially bypassable.
maxlength, readonly, disabled — all trivially removed via DevTools. UX conveniences, not security.| Zone | Who Controls It | Trust Level |
|---|---|---|
| Client | User (and extensions/scripts) | Zero — can modify anything |
| Transit | ISPs, routers, proxies | HTTPS encrypts; HTTP is plaintext |
| Server | You (developer/operator) | Trusted — validation lives here |
| Third-party | Someone else | You're trusting their code in your page |
How code runs shapes why different languages feel different to deploy.
| Model | Examples | Key Trait |
|---|---|---|
| Fork/Exec (CGI) | CGI scripts, early PHP | New process per request. Simple but expensive. |
| Server-Side Scripting | PHP, ColdFusion, Classic ASP | Interpreter in server process. Drop a file, it runs. |
| Embedded Container | Java Servlets (Tomcat/Jetty) | Runtime inside server. App stays loaded in memory. |
| Embedded Native | Apache Modules, ISAPI | C/C++ compiled into server. Max performance, min portability. |
| Code-as-Server | Node.js, Deno, Bun | Your code is the server. You own the lifecycle. |
| Model | Examples | Status |
|---|---|---|
| Helpers | External apps (Acrobat, Winzip) | Still used for MIME types |
| Client-Side Scripting | JavaScript, WASM | The winner |
| Applets | Java Applets | Dead |
| Plug-ins | ActiveX, Flash, NaCl | Dead |
| Native Wrapping Web View | Electron, Capacitor | Active (compromise) |
| Native Code Calling Web | Swift/Java using HTTP | Active |
Two competing philosophies — the choice reveals whether you're building a site or an app.
The biggest architectural decision: who builds the HTML that the user sees?
| Aspect | SSR | CSR | Hybrid |
|---|---|---|---|
| First load | Fast (HTML ready) | Slow (JS loads first) | Fast |
| Navigation | Slow (full reload) | Fast (client routing) | Can be fast |
| SEO | Excellent | Poor | Excellent |
| Without JS | Works | Blank page | Works (degraded) |
| Complexity | Low | High | Very high |
| Generation | Era | Approach |
|---|---|---|
| Gen 1: Server-Side | ~1993–1999 | Thin client, server renders everything. 1 URL = 1 page. |
| Gen 1.5: Enhanced | ~1997–2004 | Client-side validation, DHTML effects. Server still controls flow. |
| Gen 2: Ajax | ~2005–2012 | XMLHttpRequest, in-place updates. Broke then fixed 1 URL = 1 resource. |
| Gen 3: Native Apps | ~2008–present | iOS/Android. Native perf, but platform lock-in. |
| Gen 4: PWAs | ~2015–present | Offline-first, service workers. Speed of native + web distribution. |
| Current: SSR+Hydration | ~2018–present | Static snapshot fast, then hydrate with JS. Best of both, complexity is the cost. |
The decision process:
The wrong choice in either direction — over-engineering a brochure site or under-engineering a complex app — creates unnecessary pain.
The web toolbox is too vast to master. The better strategy: understand how it fits together.
Key takeaways from all 21 sections.