Enjoy Newsletter #63.

Simplify your code with functional core, imperative shell

This entry in the “Tech on the Toilet” series on the Google Testing Blog, written by Arham Jain, introduces the Functional Core, Imperative Shell design pattern. A common problem in software is mixing business logic with side effects like database queries, network requests, or sending emails, which makes code hard to test, reuse, and reason about. The solution is to split code into two layers: a functional core made up solely of pure functions with no I/O and no external state mutation that operate strictly on their inputs; and an imperative shell that handles all side effects and delegates decision-making to the core.

The article’s example starts with a sendUserExpiryEmail function that loops over database users, filters expired accounts, and sends emails all in one place. After refactoring, the core contains two pure functions—getExpiredUsers (filtering expired, non-free-trial users) and generateExpiryEmails (producing the list of recipients and email bodies)—while the shell shrinks to a single email.bulkSend(...) call. Now the core can be unit-tested in isolation without mocks, the shell is easy to swap out, and adding a feature like a five-day advance reminder only requires writing one new pure function and reusing getExpiredUsers. The post also links to Gary Bernhardt’s original talk on the pattern.

RDEL #94: How do experienced engineers actually review code?

This issue of RDEL summarizes a qualitative study that observed 10 experienced engineers performing 25 real-world code reviews across open-source and internal projects, paired with semi-structured interviews. The findings show that reviewers work through three phases: building context from the PR title and description (observed in 84% of reviews), inspecting details by reading, running code, or asking questions, and finally reaching a decision. Throughout a review, engineers simultaneously hold three mental models in their heads: the actual code in the PR, the expected change, and an ideal implementation; gaps between these three models are what trigger questions or change requests. Rather than trying to understand every line equally, they actively scope their attention based on complexity and risk, sometimes asking the author for a live walkthrough when a change is especially intricate.

Beyond the PR diff itself, reviewers consult issue trackers (44%), prior discussions (40%), external tools, and their own institutional knowledge of the system and team conventions. Understanding is built collaboratively over time rather than by reading code in isolation. Based on these findings, the post recommends that engineering managers support reviewing by commit, file, or feature, require high-quality PR descriptions explaining the “what” and “why,” and automate low-value checks like formatting via linters and CI so human reviewers can focus on architecture and logic.

The Great Software Quality Collapse: How We Normalized Catastrophe

Writing on Tech Trenches, Denis Stetskov warns that software quality is in severe decline and extreme resource bloat has been normalized: Apple’s Calculator leaking 32GB of RAM, VS Code leaking 96GB over SSH, Microsoft Teams pinning 100% CPU on a 32GB machine, Discord eating 32GB during screen sharing, and Spotify consuming 79GB on macOS. The July 2024 CrowdStrike outage is the costliest example: a missing array bounds check in a configuration parser crashed 8.5 million Windows machines, causing an estimated $10 billion in damages. AI coding tools are amplifying the problem, exemplified by Replit’s AI assistant ignoring explicit instructions, wiping a production database, and fabricating fake data to cover it up; cited research found AI-generated code contains 322% more security vulnerabilities.

The author argues that software is hitting physical limits: stacked abstraction layers (React, Electron, Chromium, Docker, Kubernetes…) multiply overhead 2–6x, and data centers consume 200 TWh per year while power grids struggle to keep up. Big tech companies spend $364 billion on infrastructure rather than fixing root causes. The most worrying long-term consequence is slashing junior roles: without juniors today, there are no seniors tomorrow. His prescription is to prioritize quality over velocity, measure actual resource consumption, strip away redundant abstraction layers, and return to fundamentals like bounds checking and memory management.

Building an Agent That Leverages Throwaway Code

Armin Ronacher (creator of Flask) proposes building agents that solve even non-programming tasks by having the AI write throwaway code instead of relying on a fixed set of predefined tools. The key building block is Pyodide, a Python interpreter compiled to WebAssembly that can install compatible packages via micropip—including pure-Python packages or Pyodide builds—to process documents and images; Ronacher recommends running Pyodide inside a Web Worker so execution can be interrupted if needed. For safe resource access, the agent interacts with a virtual filesystem: file reads and writes are intercepted and translated into external API calls, so the sandbox never needs direct network access.

Because an agent run can span many steps, he uses a simple durable execution mechanism: snapshotting state into a key-value store after every step so retries can resume from where they left off without recomputing earlier work. Alongside the Python interpreter, the agent gets a Describe tool to reason over artifacts produced by its code and a Help tool to look up documentation or query a RAG index. His mini-agent repo demonstrates the idea: the agent reads an IP address from a virtual network drive and renders an illustration. In Ronacher’s view, this approach is simpler than wiring MCP servers into an interpreter, and similar patterns are emerging in Anthropic’s Claude Skills and Cloudflare’s Code Mode.

Measuring Engineering Productivity

Can Duruk shares the engineering productivity measurement system he built at Felt, a SaaS company that grew from 2 to 25 engineers and ships up to 25 deployments a day. The core principle is that managers absorb most of the “paperwork” rather than pushing it onto engineers. Daily, engineers post an async standup in #standups on Slack covering yesterday, today, and blockers, taking just 5–10 minutes. Weekly, managers compile a changelog from GitHub, categorizing PRs by engineer and into product features, bug fixes, or developer experience; 1:1s center on people, product, and process with shared notes in Notion; and each team gets a few minutes to demo weekly wins at All-Hands. In real time, merged PRs automatically post to Slack, and engineers verify their own changes in production and sign off with an emoji reaction.

Duruk advises starting small (the full system took two years to evolve), tailoring practices to your organization’s context, setting clear expectations with concrete examples, and continuously gathering feedback through 1:1s and retros. He rejects vanity metrics like lines of code or commit counts, while emphasizing that measurement itself isn’t the enemy—bad measurement is. Numbers serve as a diagnostic tool to sanity-check a manager’s intuition and ground tough conversations, not as a weapon to grade individuals.

Scripts I wrote that I use all the time

Evan Hahn tours the collection of personal shell scripts he has accumulated over more than a decade in his dotfiles, hosted publicly on Codeberg. The scripts fall into several categories: clipboard utilities (copy and pasta wrapping clipboard operations, pastas watching clipboard history, cpwd copying the current directory path); file operations (mkcd to create and enter a directory, tempe to open a temporary directory, trash to move files to the trash instead of permanently deleting them, mksh to scaffold a new shell script); internet utilities (serveit to spin up a local web server, getsong, getpod, and getsubs wrapping yt-dlp, url to parse URL components); and text processing (scratch to open a scratch buffer, straightquote to normalize curly quotes, markdownquote to format blockquotes).

He also shares media scripts like tunes, pix, radio, speak, and boop (playing a sound effect based on whether the previous command succeeded or failed), system helpers like theme to toggle light/dark mode, sleepybear to hibernate, murder to kill processes, and bb to detach background processes cleanly, plus quick lookup tools like emoji, httpstatus, and alphabet. For newer developers, it’s great inspiration to start automating repetitive daily tasks with small scripts; the full source is available in his dotfiles.

SQL Anti-Patterns You Should Avoid

Writing on Data Methods, Jordan Goodman rounds up six common SQL anti-patterns that make queries slow and hard to maintain. First, overusing CASE WHEN to translate status codes inline across views creates duplication and inconsistency; instead, create a dimension table or view sourced from the canonical status table. Second, wrapping indexed columns in functions like UPPER() can prevent the database from using an index seek on the base column; depending on the DBMS, use expression indexes or computed columns instead, making sure any rewritten predicate preserves exact comparison semantics. Third, using SELECT * in views makes downstream dependencies brittle when schemas change and pulls in unnecessary columns; always list required columns explicitly.

Fourth, slapping DISTINCT onto a query to hide duplicate rows usually masks a broken join condition; the real fix is correcting the join logic. Fifth, stacking views on top of views makes query optimization and debugging painful; periodically flatten transformation layers and materialize heavy logic. Sixth, deeply nested subqueries are hard to read and debug; refactor them into CTEs. The author stresses treating SQL like production application code—with version control, code review, and performance tuning—investing in clean design upfront to avoid technical debt, and recommends Bill Karwin’s book SQL Antipatterns for a deeper dive.

Build Your Own Database

This interactive tutorial guides readers through building a key-value database from scratch to demystify how LSM Trees work under the hood. It starts with a plain file, where in-place updates require expensive data shifting, motivating a switch to an append-only log: records are immutable, every write appends to the end of the file, and deletes write a special tombstone marker. To keep the file from growing forever, the log is split into fixed-size segments that are periodically compacted in the background to discard superseded records. Next, an in-memory hash table maps each key to its byte offset in the file for fast lookups without full-file scans, trading a bit of write speed for fast reads.

Once segment data is stored in sorted order, we only need a smaller sparse index in memory because any key’s position can be narrowed down between two known index entries. To maintain sorted order while keeping writes fast, incoming writes go into a memtable (an in-memory balanced tree) backed by an append-only write-ahead log for crash recovery; when the memtable fills up, it flushes to disk as an immutable SSTable (Sorted String Table) with its own index. Combining the memtable, write-ahead log, and SSTables gives you an LSM Tree—the foundation of large-scale key-value stores like Google’s LevelDB and Amazon’s DynamoDB, whereas relational databases like PostgreSQL typically use B-trees for indexes (with table rows stored in heaps).


This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.