Explore
Module 1 · Part 1 of 12 · Free preview

Part 1

Chapter 1: The Broken Windows--–- It was 2:47 AM when the page finally loaded. Not the application – the pagerduty alert. Sarah, a senior developer with six years of experience, had been woken up for the third time this month. The e-commerce checkout flow was failing for 12% of users. Not crashing, just... failing. Silently. Customers would add items to their cart, proceed to payment, and then stare at an infinite spinner. Some would refresh. Most would abandon. The business was losing roughly $47,000 per hour.Sarah opened the logs. Nothing obvious. No stack traces. No red error messages. Just a single line repeated every few seconds: "Payment processing timeout after 30 seconds."

She checked the code. The timeout was set to 30 seconds. That wasn't a bug – that was a configuration. Someone had set it that way.She traced the call chain. The checkout service called the payment gateway, which called an internal fraud detection service, which called a customer history service, which called a database view that joined seven tables. One of those tables had 42 million rows and no index on the column being filtered. The query took 28 seconds. Add network latency, and you're at 29.5 seconds. The timeout fired at 30. Everything was working exactly as written. Nothing was "broken" in the sense of throwing an exception. And yet, the application was broken in the only way that mattered: it wasn't serving customers.Sarah fixed the missing index.

The query dropped to 200 milliseconds. The timeout stopped firing. The business stopped losing money. But as she closed her laptop at 4:15 AM, she wasn't proud. She was furious. Not at the database, not at the payment gateway, not at the developer who wrote the original query. She was furious at herself for not asking a simple question months ago: "Why does this take 30 seconds?"This chapter is about learning to ask that question before 2:47 AM. It's about moving from a mindset of "it works on my machine" to a mindset of pragmatic ownership. And it starts with three mental models that will reshape how you see every line of code you write, every bug you encounter, and every decision you make as an application developer.The Myth of the Perfect SpecificationEvery developer has heard some version of this complaint: "If only the requirements were clearer."

Keep reading — free

Sign in with your SamEnrico account to read the whole of lesson 1.

Sign in