Chapter 1

All Languages are Good

The problem was never the language. It was how they taught you to use it.
Demo: Call stack depth: Spring Boot request vs function pipeline
☠ Spring Boot: GET /api/users/42
Stack depth: 0
Total ns: 0
✦ Function pipeline: GET /users/42
Stack depth: 0
Total ns: 0
0
Max stack depth
0
Max stack depth
0
Nanoseconds (framework)
0
Nanoseconds (your code)

What you just saw

The left panel is a Spring Boot request. Before your code runs, the framework pushes ten stack frames: the servlet container, the dispatcher, the filter chain, the exception resolver, the transaction proxy, the AOP interceptor. Each frame is machinery the framework needs to orchestrate the request. Your actual business logic runs at the bottom of that stack, nested inside framework code you did not write and cannot see without a debugger.

The right panel is a function pipeline. The HTTP handler calls validate, then query, then respond. Three frames. Each one is your code. There is no framework between you and the request. The call stack is a precise description of what is happening: parse, validate, query, respond.

The language is the same in both cases. Java can do either. So can Python, TypeScript, C#, and every other language in the selector on the landing page. The depth of the call stack is a choice made by the architecture, not a property of the language.

How this works: This demo visualizes the execution difference between dishonest and honest code. Timing is proportional to real captured nanosecond costs. Instrumented source code, Dockerfile, and raw trace data: github.com/adamzwasserman/honest-code-traces
← Home Ch.2: Classes Considered Harmful →