<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Engineer’s Codex]]></title><description><![CDATA[Real-world software engineering explained simply.]]></description><link>https://read.engineerscodex.com</link><image><url>https://substackcdn.com/image/fetch/$s_!DSkX!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2baa3ff-3727-4dfa-a5c0-1b6f00b16d14_1024x1024.png</url><title>Engineer’s Codex</title><link>https://read.engineerscodex.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 03 Apr 2026 22:28:21 GMT</lastBuildDate><atom:link href="https://read.engineerscodex.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Engineer’s Codex]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[engineerscodex@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[engineerscodex@substack.com]]></itunes:email><itunes:name><![CDATA[Engineer's Codex]]></itunes:name></itunes:owner><itunes:author><![CDATA[Engineer's Codex]]></itunes:author><googleplay:owner><![CDATA[engineerscodex@substack.com]]></googleplay:owner><googleplay:email><![CDATA[engineerscodex@substack.com]]></googleplay:email><googleplay:author><![CDATA[Engineer's Codex]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Diving into Claude Code's Source Code Leak]]></title><description><![CDATA[Engineer&#8217;s Codex is a publication about real-world software engineering.]]></description><link>https://read.engineerscodex.com/p/diving-into-claude-codes-source-code</link><guid isPermaLink="false">https://read.engineerscodex.com/p/diving-into-claude-codes-source-code</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Wed, 01 Apr 2026 06:25:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CHy8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>On March 31, 2026, Anthropic accidentally shipped a <code>.map</code> sourcemap file inside a Claude Code npm update. In minutes, this was found and was going viral. The 600k lines of code were mirrored, analyzed, ported to Python and other languages, and uploaded to decentralized servers. </p><p>Claude Code is known to be notoriously closed down. Their Agent SDKs provide almost no insight into the internals of Claude Code, and Anthropic themselves do their best to keep the source as closed as possible.</p><div><hr></div><h2>How It Happened</h2><p>Anthropic accidentally included a <code>.map</code> sourcemap file in a Claude Code npm package. Boris Cherny, a Claude Code engineer at Anthropic, <a href="https://x.com/bcherny/status/2039168928145109343">confirmed it was plain developer error</a>, not a tooling bug. He <a href="https://x.com/bcherny/status/2039210700657307889">followed up</a> with more detail: &#8220;Mistakes happen. As a team, the important thing is to recognize it&#8217;s never an individual&#8217;s fault. It&#8217;s the process, the culture, or the infra.&#8221;</p><p><a href="https://sre.google/sre-book/postmortem-culture/">Blameless post-mortems</a>, popularized by Google&#8217;s SRE culture, focus on fixing the system rather than finding someone to fault. The goal is an environment where engineers report mistakes honestly instead of hiding them, which produces better fixes and fewer repeat incidents.</p><p>Chaofan Shou (<a href="https://x.com/Fried_rice/status/2038894956459290963">@Fried_rice</a>) was first to notice and posted a public link to the source. Within minutes the race was on.</p><div><hr></div><h2>Chaos and Legality</h2><p>The most popular fork was <code>claw-code</code><a href="https://github.com/instructkr/claw-code"> on GitHub,</a> created by @realsigridjin. He cloned the repo, ported it to Python from scratch (using OpenAI&#8217;s Codex!) to prevent legal issues, and pushed it. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CHy8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CHy8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 424w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 848w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CHy8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:136546,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://read.engineerscodex.com/i/192808869?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CHy8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 424w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 848w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!CHy8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F768ab99c-f2f5-4adf-bf91-072511a57a30_1912x1000.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The legal theory is that a clean-room AI rewrite cannot be touched by DMCA. Claw-code currently sits at 75,000+ stars and 75,000+ forks at the time of writing.</p><p><strong>The legal question nobody has an answer to yet:</strong> does a codegen clean-room rebuild violate copyright? </p><p>Traditionally: &#8220;A clean room build in software engineering is <strong>a methodology used to re-implement existing software or reverse-engineer a system without infringing on copyright</strong>. It involves two separate teams: one analyzes the original software to create specifications, while a second "clean" team creates the new product based <em>only</em> on those specifications, ensuring no proprietary code is copied.&#8221;</p><p>This takes months and costs real money. It used to be a meaningful barrier. Now anyone with a Claude Max plan can point an agent at a codebase&#8217;s tests and have the logic rebuilt overnight. The practice has never been challenged in court.</p><p><a href="https://x.com/GergelyOrosz/status/2038985760175505491">Gergely Orosz</a> put it bluntly: even if Anthropic tries to assert copyright, do they want the PR battle of suing an open source project for rebuilding their own AI-written product? And could they even prove it?</p><p>Meanwhile, <a href="https://x.com/paoloanzn/status/2039022418698907949">4nzn</a> uploaded a <a href="https://github.com/paoloanzn/free-code">stripped version</a> to IPFS with all telemetry removed, security guardrails removed, and all experimental features unlocked. Whether DMCA can reach content stored on IPFS is itself an unresolved legal question.</p><p>At the moment, <code>claw-code</code> is still up, but non-rewritten forks have been DMCA&#8217;d by Anthropic.</p><p>Here is an example DMCA request Anthropic sent to a source clone: <a href="https://github.com/github/dmca/blob/master/2026/03/2026-03-31-anthropic.md">https://github.com/github/dmca/blob/master/2026/03/2026-03-31-anthropic.md</a> </p><div><hr></div><h2>Inside the Source Code</h2><h3>KAIROS: Anthropic&#8217;s Response to OpenClaw</h3><p>Hidden behind feature flags called <code>PROACTIVE</code> and <code>KAIROS</code>, the codebase contains a fully built autonomous agent mode that has not been publicly announced.</p><p>KAIROS runs in the background, 24/7, without you asking. It&#8217;s similar to OpenClaw.</p><p>Every few seconds it receives a heartbeat prompt: &#8220;anything worth doing right now?&#8221; It evaluates what is happening and makes a call: act, or stay quiet. If it acts, it can fix errors, respond to messages, update files, run tasks. Everything Claude Code can already do, just without you initiating it.</p><p>It has three exclusive tools that regular Claude Code does not:</p><ul><li><p><strong>Push notifications</strong> so it can reach you on your phone or desktop even when the terminal is closed</p></li><li><p><strong>File delivery</strong> so it can send you things it created without being asked</p></li><li><p><strong>Pull request subscriptions</strong> so it can watch your GitHub and react to code changes on its own</p></li></ul><p>It keeps append-only daily logs of everything it noticed, decided, and did. It cannot erase its own history. At night it runs a process the code literally calls <code>autoDream</code>, where it consolidates what it learned during the day and reorganizes memory. It persists across sessions. Close your laptop Friday, open it Monday, KAIROS has been working the whole time.</p><p>The codebase also contains 44 hidden feature flags and 20+ unshipped features total: background agents running 24/7, one Claude orchestrating multiple worker Claudes, cron scheduling, full voice command mode, browser control via Playwright, and agents that sleep and self-resume.</p><p>The interesting architectural decision in all of this is the separation of initiative from execution. </p><p>Regular Claude Code is reactive: it only acts when you send a message. KAIROS introduces a proactive loop, which requires a fundamentally different trust model. The agent now needs to decide on its own what is worth doing, which means the quality of that judgment becomes far more important than it is in a simple request-response system. </p><p>That is a hard problem, and the fact that Anthropic has it fully built and gated suggests they have been working on it for some time.</p><h3>Anti-Distillation: Actively Poisoning Copycats</h3><p>Distillation is a process where a smaller, more efficient AI model is trained to mimic the behavior and knowledge of a larger, more powerful &#8220;teacher&#8221; model, allowing it to perform nearly as well while being much faster and cheaper to run.</p><p>Claude Code sends requests with <code>anti_distillation: ['fake_tools']</code> flags that inject decoy tool definitions into system prompts. The goal is to poison training data for any competitor trying to distill Claude Code&#8217;s behavior into their own model.</p><p>There is a second layer via <code>CONNECTOR_TEXT</code>: a server-side mechanism that buffers the assistant&#8217;s text between tool calls, summarizes it with cryptographic signatures, and returns only those summaries to API traffic recorders. Even if a competitor intercepts API traffic, they only get summaries, not the full reasoning chains.</p><p>What makes the fake tools approach interesting is where it operates. It targets the distillation attack surface at data collection time rather than at inference time. If a competitor routes requests through Claude Code to collect training data, they get poisoned tool schemas baked into every prompt, making any model trained on that data less reliable. </p><p>The author of <a href="https://alex000kim.com/posts/2026-03-31-claude-code-source-leak/">this breakdown</a> estimates a determined team could bypass both mechanisms within an hour using a MITM proxy or the <code>CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS</code> environment variable. The stronger deterrent is likely legal rather than technical.</p><div><hr></div><h4><a href="https://www.swequiz.com/">SWE Quiz</a>: Did you know what distillation was?</h4><p>Distillation is an important concept that comes up in interviews with any company working on their own AI model. Did you know what it was?</p><p><strong><a href="https://www.swequiz.com/">SWE Quiz</a> is the best way to figure out what you do and don&#8217;t know. It&#8217;s like Anki for System Design and AI/ML, with structured courses, quizzes, and case studies.</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://swequiz.com/&quot;,&quot;text&quot;:&quot;Join SWE Quiz&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://swequiz.com/"><span>Join SWE Quiz</span></a></p><div><hr></div><h3>Model Codenames</h3><p>The codebase is littered with internal codenames that were never meant to be public.</p><ul><li><p><strong>Capybara</strong> (also called Mythos): Anthropic is already on version 8. It has 1M context and a &#8220;fast mode.&#8221; The code notes it still has issues with over-commenting and making false claims.</p></li><li><p><strong>Numbat</strong>: tagged with a comment reading &#8220;@[MODEL LAUNCH]: Remove this section when we launch numbat&#8221;, an upcoming model with an announced launch window baked into the source.</p></li><li><p><strong>Fennec</strong>: speculated by multiple researchers to be Opus 4.6.</p></li><li><p><strong>Tengu</strong>: referenced in the undercover mode, which strips internal codenames from builds going to external repositories.</p></li></ul><p>The undercover mode (<code>undercover.ts</code>, 90 lines) has a critical design detail: there is no force-OFF. It is a one-way door. Claude Code operating in external repos cannot reference any of these names, internal Slack channels, or even call itself &#8220;Claude Code.&#8221;</p><p>The reasoning is straightforward from a product security standpoint: you want to guarantee internal codenames never escape into the wild, so you make suppression automatic and irrevocable rather than opt-in. But a side effect is that Anthropic employees using Claude Code to contribute to open source projects were not disclosing AI authorship in commits, and the tool was built to make sure that stayed the case.</p><h3>DRM Below the JavaScript Layer</h3><p>API requests contain placeholder values (<code>cch=ed1b0</code>) that Bun&#8217;s native HTTP stack, written in Zig, overwrites with computed hashes before transmission. This cryptographically proves a request originated from a genuine Claude Code binary rather than a third-party tool wrapping the API.</p><p>The reason this lives in Zig rather than in JavaScript is deliberate. JavaScript can be patched, monkey-patched, or proxied at runtime. Zig code compiled into the Bun binary cannot be inspected or overridden without recompiling from source. By pushing attestation below the JS layer, Anthropic made it much harder for third-party clients to spoof. </p><p>This is likely why tools like OpenCode ran into friction with Anthropic beyond just legal notices: they were being blocked at the API level too. The mechanism is gated behind a compile-time flag, which suggests it may not be active everywhere, but the design intent is clear.</p><h3>The Memory Architecture</h3><p>Claude Code&#8217;s memory system is far more sophisticated than &#8220;save a CLAUDE.md file.&#8221; It operates as a 3-layer index:</p><ol><li><p><strong>Index</strong> (always loaded): just pointers, ~150 characters per line</p></li><li><p><strong>Topic files</strong> (loaded on demand): actual knowledge</p></li><li><p><strong>Transcripts</strong> (never read, only grep&#8217;d): never loaded into context directly</p></li></ol><p>The write discipline: write to topic file first, then update the index. Never dump content into the index. If a fact can be re-derived directly from the codebase, it is not stored at all.</p><p>autoDream consolidates, deduplicates, and removes contradictions from memory in a forked subagent with limited tool access, which prevents it from corrupting the main context while it runs. Memory is treated as a hint, not as truth. The agent verifies before using it.</p><p>The core design insight here is bandwidth awareness. Most agent memory implementations load everything into context every turn, which is expensive and introduces noise. Claude Code treats the context window as a scarce resource: the index is cheap and always loaded, topic files are fetched only when relevant, and transcripts are never loaded directly. This keeps the model&#8217;s working memory clean without losing access to historical information. What they choose not to store matters as much as what they do store.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tg7G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tg7G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 424w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 848w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 1272w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tg7G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png" width="1456" height="873" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:873,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tg7G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 424w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 848w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 1272w, https://substackcdn.com/image/fetch/$s_!tg7G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F658d124b-b5d7-4075-af07-2bb850a42d32_1754x1052.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://x.com/himanshustwts/status/2038924027411222533?s=20">Source</a></figcaption></figure></div><h3>Magic Docs: Self-Updating Documentation</h3><p><a href="https://x.com/mattyp/status/2038988217102266669">One pattern worth borrowing</a> from the internal codebase: Anthropic employees can create files with a <code>MAGIC DOC</code> header. When an internal build of Claude Code is idle, it fires off a dedicated subagent that reads the file, updates the documentation for the specified feature, and writes it back. The subagent is restricted to editing that single file and nothing else.</p><p>The result is documentation that stays current automatically, without anyone having to remember to update it. The tool restriction is the key design choice: scoping the agent to one file prevents it from drifting into unrelated changes while still giving it enough access to do something useful.</p><h3>Summarizing the Harness</h3><p>Drop DeepSeek or Gemini into the same Claude Code harness with some optimization and you may get improved coding ability with those models too.</p><p>The harness includes:</p><ul><li><p>Live repo context loading on every single turn (git branch, recent commits, CLAUDE.md files reread every query)</p></li><li><p>Aggressive prompt cache reuse via a stable/dynamic prompt boundary, so Anthropic is not paying full token costs every turn</p></li><li><p>Dedicated Grep and Glob tools instead of shell commands, giving the model better-structured search results</p></li><li><p>LSP tool access for call hierarchies, symbol definitions, and references</p></li><li><p>5 distinct context compaction strategies, because context overflow is a central engineering problem</p></li><li><p>A 25+ event hook system letting you intercept and modify behavior at every stage of execution</p></li><li><p>Three subagent execution models (fork, teammate, worktree) with a prompt caching optimization: forked subagents inherit parent context as byte-identical copies, so spawning 5 agents costs barely more than 1</p></li></ul><p>One design decision worth understanding is the prompt cache boundary. Anthropic pays per token, and a long system prompt rebuilt from scratch every turn would be expensive at scale. By splitting the prompt into a stable front half and a dynamic back half via <code>SYSTEM_PROMPT_DYNAMIC_BOUNDARY</code>, they make sure the expensive static portions are cached and reused across sessions. Anything tagged <code>DANGEROUS_uncachedSystemPromptSection</code> is explicitly marked as cache-breaking, so engineers know the cost before they change it.</p><p>Much of this system prompting was embedded directly in the CLI package distributed via npm all along. It was always technically readable. The <code>.map</code> file just made it obvious.</p><p>The Claude Code team has talked about <a href="https://x.com/trq212/status/2024574133011673516">Prompt Caching in Claude Code before</a>.</p><h3>Easter Eggs and Human Touches</h3><ul><li><p><code>buddy/companion.ts</code> is an April Fools feature that generates a deterministic creature per user: 18 species, rarity tiers, 1% shiny rate, RPG stats deliberately encoded to evade grep checks</p></li><li><p>There are exactly 187 spinner verbs (Source: <a href="https://x.com/wesbos/status/2038958747200962952">Wes Bos</a>)</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!89DV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!89DV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 424w, https://substackcdn.com/image/fetch/$s_!89DV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 848w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg" width="1456" height="857" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:857,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!89DV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 424w, https://substackcdn.com/image/fetch/$s_!89DV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 848w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><code>print.ts</code> is 5,594 lines with a single function that is 3,167 lines long and 12 nesting levels deep</p></li><li><p>The code has LLM-oriented comments throughout, written for AI agents working on the codebase rather than human readers</p></li></ul><div><hr></div><h2>March 2026 Was a Security Disaster</h2><p>The leak did not happen in isolation. It landed one of the worst months in AI developer security on record.</p><p>In the same 30-day window:</p><ul><li><p><strong>Axios</strong> (100M weekly npm downloads): maintainer account hijacked, a remote access trojan deployed across macOS, Windows, and Linux. The malware self-destructs after execution and deletes itself from node_modules. <a href="https://cloud.google.com/blog/topics/threat-intelligence/north-korea-threat-actor-targets-axios-npm-package/">Google suspects its from North Korean bad actors.</a></p></li><li><p><strong>LiteLLM</strong> (97M monthly PyPI installs): backdoored with a three-stage attack: credential harvester sweeping SSH keys, AWS/GCP/Azure credentials, Kubernetes configs, crypto wallets, and every LLM API key; then Kubernetes lateral movement; then a persistent systemd backdoor. Live for three hours before PyPI quarantined it</p></li><li><p><strong>Railway</strong> (2M users, 31% of Fortune 500 as customers): CDN misconfiguration leaked authenticated user data to wrong users for 52 minutes</p></li><li><p><strong>Delve</strong>: YC-backed compliance startup allegedly generating fraudulent SOC 2 audit reports with identical boilerplate across 494 reports, fabricated board meeting evidence, and audit conclusions written before any client submitted evidence</p></li><li><p><strong>Mercor AI</strong>: alleged LAPSUS$ breach of 939GB source code and 4TB of total data via their TailScale VPN</p></li><li><p><strong>OpenAI Codex</strong>: command injection via branch names discovered December 2025, patched February 2026, disclosed March 2026. Attackers could steal GitHub auth tokens via unsanitized branch name parameters</p></li><li><p><strong>GitHub Copilot</strong>: injected promotional ads into 1.5M+ pull requests as hidden HTML comments without developer consent. GitHub VP confirmed it and said it was &#8220;the wrong judgement call&#8221;</p></li></ul><p>The Claude Code leak is, in some ways, the least technically dangerous item on that list. I&#8217;ll probably cover AI security next!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>What Engineers Building Agents Should Take Away</h2><p>The source code itself will probably get taken down, reposted, and litigated. </p><p>Some things stand out as directly applicable:</p><p><strong>Split your system prompt at a stable boundary:</strong> The <code>SYSTEM_PROMPT_DYNAMIC_BOUNDARY</code> pattern is a practical response to a real cost problem. Static instructions should never change between sessions. Dynamic context should live after the boundary. Getting this right means your prompt cache actually works and you are not paying to recompute the same tokens on every turn.</p><ul><li><p>Prompt caching might be obvious to anyone who works with agents daily, but if you don&#8217;t, know that it&#8217;s an extremely important concept for keeping costs low.</p></li></ul><p><strong>Magic Docs: </strong>Having self-updating documentation is one of those practices that can upgrade any codebase and isn&#8217;t that hard to do with agents today.</p><p><strong>Lots of comments:</strong> Generally, too many comments were considered too verbose when humans were the only readers and writers of code. But with agents, comments are useful when detailed, especially when they include decisions + reasoning (basically the stuff that&#8217;s obvious to humans but not to agents).</p><p><strong>Permission classification via side-query:</strong> Send the command to Claude as a separate query: &#8220;Is this command safe?&#8221; The model evaluates context, working directory, and user intent. This replaces brittle allowlists with adaptive, context-aware security. Cost is negligible vs. the risk of a false positive.</p><ul><li><p>This is known as the &#8220;critic&#8221; pattern.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Everyone is a Staff Engineer Now]]></title><description><![CDATA[Engineer&#8217;s Codex is a newsletter about real-world engineering.]]></description><link>https://read.engineerscodex.com/p/everyone-is-a-staff-engineer-now</link><guid isPermaLink="false">https://read.engineerscodex.com/p/everyone-is-a-staff-engineer-now</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Mon, 22 Dec 2025 19:52:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!o7G7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter about real-world engineering. I know I haven&#8217;t posted in a while! The last issue was <a href="https://read.engineerscodex.com/p/how-to-not-write-garbage-code-by">How to Write &#8220;Garbage Code&#8221; (by Linus Torvalds)</a>.</em></p><div><hr></div><p>Claude Code and other coding agents this year have taken a <a href="https://karpathy.bearblog.dev/year-in-review-2025/">massive leap in skill and ability.</a>  As a result, the nature of work for engineering has changed drastically.</p><p>When execution becomes cheap, the bottleneck moves elsewhere. Skills that once distinguished senior and staff+ engineers, such as architectural judgment, context management, and system-level thinking, are increasingly moving &#8220;up&#8221; the stack and are becoming expected earlier in an engineer&#8217;s career.</p><p>Historically, individual contributors split their time between implementation and higher-level work like planning and design. As agents take on more of the implementation, the engineer&#8217;s role shifts toward planning, architecting, reviewing, and deciding how to best utilize and steer these systems. This is similar to how search didn&#8217;t eliminate thinking, but rewarded people who learned how to search well as Google matured.</p><p>Writing code was never the hard part. Knowing <em>what </em>code to write, <em>where </em>to put that code, and <em>how </em>to design it was harder.</p><div><hr></div><h3>Introducing <a href="https://nucleate.dev">Nucleate</a> (Featured)</h3><p><a href="https://nucleate.dev">Nucleate</a> is a platform to prototype, build, and ship beautiful mobile apps with AI.</p><p>Past just coding with AI, it can integrate with your design tokens, be used as a Expo Snack replacement, and be used to generate different variants of screens.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NS7f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NS7f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 424w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 848w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 1272w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NS7f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png" width="1456" height="920" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:920,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:451311,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://read.engineerscodex.com/i/182065416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NS7f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 424w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 848w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 1272w, https://substackcdn.com/image/fetch/$s_!NS7f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9307098-eb21-44a7-96c9-0c8aa72a776e_2330x1472.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can use code <strong>ENGCODEX </strong>for <strong>50% off your first month.</strong> The team is rapidly shipping updates with backend + Supabase integration, Git integrations, Claude Code subscription usage, and more coming down the pipeline this month.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://nucleate.dev/?utm_source=engineerscodex&quot;,&quot;text&quot;:&quot;Visit Nucleate&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://nucleate.dev/?utm_source=engineerscodex"><span>Visit Nucleate</span></a></p><div><hr></div><h3><strong>Maintaining context across multiple domain and projects</strong></h3><p>When I first worked with any technical L7+ at FAANG, I was always surprised at how much knowledge they had of the stack of a huge product. They were deep in the details of how the product was built, yet still spent most of their time doing high-level architecting. The skill they had here was being able to <strong>maintain rich context across multiple domains and projects</strong>.</p><p>A senior staff engineer generally designs architectures, reviews docs and code, and generally doesn&#8217;t <em>write</em> as much code, as that&#8217;s delegated to junior and senior engineers. Now, AI becomes the junior engineer.</p><p><strong><a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/">Reading code is harder than writing it</a></strong><a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/">,</a> mostly because <a href="https://read.engineerscodex.com/p/clever-code-is-probably-the-worst">writing code fills in the &#8220;understanding&#8221; gap that reading doesn&#8217;t do as well.</a> It&#8217;s the same reason students are recommended to write down notes rather than just read the textbook, as writing things down commits things to memory in a different way.</p><p>Engineers who can understand system context and also add to that understanding <em>without having to write code themselves</em> will thrive.</p><blockquote><p><em>Consider an agent tasked with refactoring a backend service to simplify its data model. The change is clean, tests pass, and performance even improves.</em></p><p><em>What the agent doesn&#8217;t know is that another service relies on a subtle ordering guarantee in the original implementation. One that was never formally documented because it lived in shared team knowledge. After the refactor, everything still works in isolation, but downstream systems begin failing under load.</em></p><p><em>Nothing in the diff looks obviously wrong. Only someone holding context across services would recognize that a &#8220;correct&#8221; change violated an implicit contract. Yes, this is partly a human problem. But we live in a human world.</em></p></blockquote><p>The engineer now needs to understand how components interact, track constraints across domains, and notice when a &#8220;correct&#8221; change has subtle side effects.</p><h3><strong>Maintaining focus in an asynchronous workflow</strong></h3><p>With AI agents becoming more and more long-running, it can be tough to maintain focus. The topic of &#8220;flow&#8221; has been talked about extensively in being important for programming. Flow is useful when working focusedly on one task at a time, constantly thinking, writing code, and reviewing. However, AI agents work autonomously and present changes to you at the end. It doesn&#8217;t make sense to constantly watch them as they work, leading to issues maintaining focus.</p><p>An agent may take 5 minutes to complete a task, which is enough to check your phone, email, and lose 10+ minutes to distracted tasks. Getting back into gear is contextually expensive, and thus, a real productivity decrease.</p><p>Strong engineers will need new habits:</p><p>&#8226; batching agent requests,</p><p>&#8226; planning follow-up work in advance,</p><p>&#8226; treating agent runtime as <em>intentional gaps</em>, not distractions.</p><p>Managing attention is already tough enough outside of work, with distractions like social media everywhere, but now it&#8217;s part of the job.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o7G7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o7G7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 424w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 848w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 1272w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o7G7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png" width="519" height="402.2936507936508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:586,&quot;width&quot;:756,&quot;resizeWidth&quot;:519,&quot;bytes&quot;:126622,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://read.engineerscodex.com/i/182065416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o7G7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 424w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 848w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 1272w, https://substackcdn.com/image/fetch/$s_!o7G7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba92f70c-70e0-4be4-977b-7a2ac3ec4a39_756x586.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Being able to plan and steer AI agents effectively</strong></h3><p>As agents get better, being able to steer them is more and more important.</p><p>It&#8217;s generally accepted that the best way to find confidence in agentic programming is to have it generate a plan first, where you review it and update the plan as needed before implementation starts.</p><p>Part of being efficient is making this planning stage more efficient, and ideally, parallelizing multiple tasks at once where necessary. Another part of it is figuring out how to steer an agent correctly in the context you&#8217;re in. Building a new feature versus updating existing production infrastructure will require <em>drastically</em> different approaches.</p><p>As agents improve, the bottleneck isn&#8217;t execution speed. It&#8217;s <strong>clarity of intent</strong>. Engineers who can break work into parallelizable tasks and define clean boundaries will multiply their output.</p><p>This is also personal to everyone and requires you to understand how you work. Do you prefer planning extensively and using subagents for implementation? Do you prefer getting a prototype out first, then reviewing the code and doing a cleanup after?</p><p>Each person&#8217;s way of steering and working with AI is personal, and figuring out your own style is important to working effectively with AI.</p><h3><strong>Reviewing and reading code, over writing it</strong></h3><p>Reviewing and reading code is already a hard skill that takes practice to learn. Holding the model of the previous state of a system and the proposed state of a system through reading a PR isn&#8217;t easy. AI can make this easier by writing summaries, READMEs, and other plain language to explain its work - but it&#8217;s not always aware of side effects and subtle risks like humans are.</p><p>As code generation gets cheaper, <strong>reviewing becomes more expensive</strong>. Thus, reading and reviewing code is more important than ever.</p><p>It helps that AI can help review code - but it&#8217;s best if you act as the main line of defense and use AI as a safety net.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VA2S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VA2S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 424w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 848w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 1272w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VA2S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png" width="766" height="638" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:638,&quot;width&quot;:766,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:270939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://read.engineerscodex.com/i/182065416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VA2S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 424w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 848w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 1272w, https://substackcdn.com/image/fetch/$s_!VA2S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8bf7dc-eb66-4a22-9fc7-4cf8c51cfc04_766x638.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3><strong>Engineering is moving up the stack</strong></h3><p>The shift is clear: engineering work is moving up the stack. Each new model release feels like a new unlock. The skills that once separated senior engineers from junior ones, such as architectural thinking, context management, effective delegation, will now become baseline requirements.</p><p>Junior engineers now operate at what used to be senior-level abstraction. Senior engineers architect at scale previously only accessible to staff engineers.</p><p>The engineers who will thrive aren&#8217;t necessarily the ones who can prompt AI best, but the ones who can <strong>manage their own contexts</strong> the best.</p><p>Start by examining your own workflow. When do you reach for AI? When do you context-switch? Where do you lose focus? Your answers will reveal where to build new habits.</p><p>The tooling will keep improving. Your working style needs to improve with it.</p>]]></content:encoded></item><item><title><![CDATA[How to Write "Garbage Code" (by Linus Torvalds)]]></title><description><![CDATA[Linus Torvalds, Creator of Git and Linux, on reducing cognitive load]]></description><link>https://read.engineerscodex.com/p/how-to-not-write-garbage-code-by</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-to-not-write-garbage-code-by</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Fri, 12 Sep 2025 22:18:39 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5f355204-d5a6-4131-84bf-593ffe6eb9f4_722x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter about becoming a better engineer and clearer thinker through timeless engineering ideas.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Recently, Linus Torvalds, the creator of Git and Linux, <a href="https://lore.kernel.org/lkml/CAHk-=wjLCqUUWd8DzG+xsOn-yVL0Q=O35U9D6j6=2DUWX52ghQ@mail.gmail.com/">berated a Meta engineer on a PR they made recently.</a></p><blockquote><p><em>&#8220;No. This is garbage and it came in too late. I asked for early pull requests because I'm traveling, and if you can't follow that rule, at least make the pull requests good.</em></p><p><em>This adds various garbage that isn't RISC-V specific to generic header files.</em></p><p><em><strong>And by "garbage" I really mean it. This is stuff that nobody should ever send me, never mind late in a merge window.</strong></em></p><p><em><strong>Like this crazy and pointless make_u32_from_two_u16() "helper".</strong></em></p><p><em>That thing makes the world actively a worse place to live. It's useless garbage that makes any user incomprehensible, and actively WORSE than not using that stupid "helper".</em></p><p><em><strong>If you write the code out as "(a &lt;&lt; 16) + b", you know what it does and which is the high word.</strong> Maybe you need to add a cast to make sure that 'b' doesn't have high bits that pollutes the end result, so <strong>maybe it's not going to be exactly pretty, but it's not going to be wrong and incomprehensible either.</strong></em></p><p><em><strong>In contrast, if you write make_u32_from_two_u16(a,b) you have not a f^%$ing clue what the word order is.</strong> IOW, you just made things WORSE, and you added that "helper" to a generic non-RISC-V file where people are apparently supposed to use it to make other code worse too.</em></p><p><em>So no. Things like this need to get bent. It does not go into generic header files, and it damn well does not happen late in the merge window.&#8221;</em></p></blockquote><div><hr></div><p>(Disregarding the fact that this pull request <em>was</em> sent in <em>way too late</em>, I agree)</p><p>I think this is a good example of &#8220;Write Everything Twice&#8221; or &#8220;Yes, Please Repeat Yourself&#8221;, as<a href="https://read.engineerscodex.com/p/4-software-design-principles-i-learned"> I&#8217;ve written about before</a>. </p><p>Now that we have coding agents that are much better, I think the PRY principle here actually is more important than before. </p><p>But the main point Linus makes here is that good code <strong>optimizes for reducing cognitive load</strong>.</p><h2>Reducing Micro-Context Switches</h2><p>Today, code now has multiple readers: computers, LLMs, and software engineers. </p><p>Humans and LLMs have a limited amount of <strong>context</strong> they can store in their &#8220;context window&#8221; at a time. Having to go to a new file or function to understand it requires a slight context switch and requires extra brainpower (and tokens) to absorb that new information. An LLM now has to understand a new file, a new path, a new extra function. So, a function that uses 0 helper functions throughout requires less context and brainpower than a function with 5 helper functions.</p><p>Neuroscience shows <strong>switching tasks incurs measurable brain energy costs</strong>. Jumping across files is a micro&#8211;context switch. The more helpers/abstractions, the more &#8220;switch costs&#8221; pile up. </p><p>Humans have limited working memory capacity - let&#8217;s say the human brain can only store 4-7 &#8220;chunks&#8221; at at time. Each abstraction or helper function <em>costs a chunk slot</em>. Each abstractions costs more tokens. Too many layers means <a href="https://github.com/zakirullin/cognitive-load">cognitive overload</a>. Too many tokens used means a higher chance of error.</p><p>This means that sometimes, <strong>duplication is actually reducing cognitive load, because the &#8220;chunk&#8221; is self-contained.</strong></p><p>Sometimes, of course, it&#8217;s justified to have abstracted components and functions. For example, if you want to enforce a certain behavior across your codebase, a helper function is probably a good thing.</p><p>On the other hand, it&#8217;s <strong>fine to have reused code throughout</strong> for simple operations, even if reused. <em>Do you really need that helper file or abstracted class? </em></p><p>In fact, it makes code clearer, easier to understand, and most importantly, easier to iterate on. It&#8217;s much easier to point Claude Code or Codex to one file and ask it to make changes, rather than needing to DFS through 3-4 different files to fully understand the context of the &#8220;parent&#8221; file.</p><p>In performance engineering, &#8220;locality of reference&#8221; (keeping data/code close together) is necessary for efficiency. PRY is like a <em>cognitive </em>locality of reference.</p><p>Last, but not least, the cost of <em>premature optimization</em> has never been higher, especially in a world where, with modern IDEs and LLMs, code is cheaper to refactor than ever. The cost of duplication has dropped and will continue dropping moving forward.</p><h2>It doesn&#8217;t cost anything to be nice</h2><p><strong>One thing to </strong><em><strong>not</strong></em><strong> take from Linus&#8217;s point</strong>: the tone and general rudeness. Everyone works differently, obviously, but being nicer never hurts :). </p><p>Being rude makes committing code a risk. Nobody wants to write code and risk the chance of being berated publicly like above. <a href="https://substack.com/@abhinavupadhyay">Abhinav</a> put it well here:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Oa1l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Oa1l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 424w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 848w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 1272w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Oa1l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png" width="1180" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:1180,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Oa1l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 424w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 848w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 1272w, https://substackcdn.com/image/fetch/$s_!Oa1l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2285882-dac5-4847-bb21-b7806d9280c5_1180x490.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Optimize for reducing cognitive load.</strong></h4>]]></content:encoded></item><item><title><![CDATA[How Cursor Indexes Codebases Fast]]></title><description><![CDATA[Merkle Trees in the real world]]></description><link>https://read.engineerscodex.com/p/how-cursor-indexes-codebases-fast</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-cursor-indexes-codebases-fast</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Sat, 10 May 2025 16:28:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Cursor, the popular AI IDE that recently announced they hit $300M ARR, uses <strong>Merkle trees to index code fast. </strong>This post goes over exactly how.</p><p>Before diving into Cursor's implementation, let's first understand what a Merkle tree is. </p><h2>Merkle Trees Explained Simply</h2><p>A Merkle tree is a tree structure in which every "leaf" node is labeled with the cryptographic hash of a data block, and every non-leaf node is labeled with the cryptographic hash of the labels of its child nodes. This creates a hierarchical structure where changes at any level can be efficiently detected by comparing hash values.</p><p>Think of them as a fingerprinting system for data:</p><ol><li><p>Each piece of data (like a file) gets its own unique fingerprint (hash)</p></li><li><p>Pairs of fingerprints are combined and given a new fingerprint</p></li><li><p>This process continues until you have just one master fingerprint (the root hash)</p></li></ol><p>The root hash summarizes all data contained in the individual pieces, serving as a cryptographic commitment to the entire dataset. The beauty of this approach is that if any single piece of data changes, it will change all the fingerprints above it, ultimately changing the root hash.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lb0A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lb0A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lb0A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg" width="630" height="381.10103626943004" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:467,&quot;width&quot;:772,&quot;resizeWidth&quot;:630,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Merkle Tree | Suman Kundu&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Merkle Tree | Suman Kundu" title="Merkle Tree | Suman Kundu" srcset="https://substackcdn.com/image/fetch/$s_!Lb0A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Lb0A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e51d80-fe7d-4756-a47e-9b27b126bea4_772x467.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2><a href="http://swequiz.com">SWE Quiz (Sponsored)</a></h2><p><strong>Top software engineers know a lot. But how do you know what you </strong><em><strong>don&#8217;t know?</strong></em></p><p>SWE Quiz is a platform with roadmaps on system design fundamentals, like API design, databases, and more. There are three roadmaps launching in June: distributed systems, LLM fundamentals, and a React interview roadmap.</p><p>Get <strong>lifetime access</strong> to SWE Quiz, used by devs who have used the platform to get into companies like Google, Meta, and Airbnb.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://swequiz.com&quot;,&quot;text&quot;:&quot;Get SWE Quiz&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://swequiz.com"><span>Get SWE Quiz</span></a></p><div><hr></div><h2>How Cursor Uses Merkle Trees for Codebase Indexing</h2><p>Cursor uses Merkle trees as a core component of its codebase indexing feature. According to a post by <a href="https://forum.cursor.com/t/codebase-indexing/36">Cursor's founder</a> and the <a href="https://www.cursor.com/en/security">security documentation</a>, here's how it works:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dBf0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dBf0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 424w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 848w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 1272w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dBf0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png" width="1456" height="1092" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1092,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1573436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://read.engineerscodex.com/i/163255622?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dBf0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 424w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 848w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 1272w, https://substackcdn.com/image/fetch/$s_!dBf0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d7452a3-81c2-4788-bea7-a087cd2463da_6400x4800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Step 1: Code Chunking and Processing</h3><p>Cursor first chunks your codebase files locally, splitting code into semantically meaningful pieces before any processing occurs. </p><h3>Step 2: Merkle Tree Construction and Synchronization</h3><p>When codebase indexing is enabled, Cursor scans the folder opened in the editor and computes a Merkle tree of hashes of all valid files. This Merkle tree is then synchronized with Cursor's server, as detailed in <a href="https://www.cursor.com/en/security">Cursor's security documentation</a>.</p><h3>Step 3: Embedding Generation</h3><p>After the chunks are sent to Cursor's server, embeddings are created using either OpenAI's embedding API or a custom embedding model (I couldn&#8217;t verify this). These vector representations capture the semantic meaning of the code chunks.</p><h3>Step 4: Storage and Indexing</h3><p>The embeddings, along with metadata like start/end line numbers and file paths, are stored in a remote vector database (Turbopuffer). To maintain privacy while still enabling path-based filtering, Cursor stores an obfuscated relative file path with each vector. Importantly, according to <a href="https://forum.cursor.com/t/codebase-indexing/36">Cursor's founder</a>, "None of your code is stored in our databases. It's gone after the life of the request."</p><h3>Step 5: Periodic Updates Using Merkle Trees</h3><p>Every 10 minutes, Cursor checks for hash mismatches, using the Merkle tree to identify which files have changed. Only the changed files need to be uploaded, significantly reducing bandwidth usage, as explained in <a href="https://www.cursor.com/en/security">Cursor's security documentation</a>. This is where the Merkle tree structure provides its greatest value&#8212;enabling efficient incremental updates.</p><h2>Code Chunking Strategies</h2><p>The effectiveness of the codebase indexing largely depends on how code is chunked. While my previous explanation didn't go into detail about chunking methods, this <a href="https://blog.lancedb.com/rag-codebase-1/">blog post about building a Cursor-like codebase feature</a> provides some insights:</p><p>While simple approaches split code by characters, words, or lines, they often miss semantic boundaries&#8212;resulting in degraded embedding quality.</p><ul><li><p>You can split code based on a fixed token count, but this can cut off code blocks like functions or classes mid-way. </p></li><li><p>A more effective approach is to use an intelligent splitter that understands code structure, such as recursive text splitters that use high-level delimiters (e.g., class and function definitions) to split at appropriate semantic boundaries.</p></li><li><p>An even more elegant solution is to split the code based on its Abstract Syntax Tree (AST) structure. By traversing the AST depth-first, it splits code into sub-trees that fit within token limits. To avoid creating too many small chunks, sibling nodes are merged into larger chunks as long as they stay under the token limit. Tools like <a href="https://tree-sitter.github.io/tree-sitter/">tree-sitter</a> can be used for this AST parsing, supporting a wide range of programming languages.</p></li></ul><p><a href="http://swequiz.com/learn/what-are-llm-tokens-crash-course-on-llm-tokens/">For a crash course on </a><strong><a href="http://swequiz.com/learn/what-are-llm-tokens-crash-course-on-llm-tokens/">tokens, read this.</a></strong></p><div><hr></div><h2>How Embeddings Are Used at Inference Time</h2><p>After covering how Cursor creates and stores code embeddings, a natural question arises: <strong>how are these embeddings actually used once they've been generated?</strong> This section explains the practical application of these embeddings during normal usage.</p><h3>Semantic Search and Context Retrieval</h3><p>When you interact with Cursor's AI features like asking questions about your codebase (using @Codebase or &#8984; Enter), the following process occurs:</p><ol><li><p><strong>Query Embedding</strong>: Cursor computes an embedding for your question or the code context you're working with.</p></li><li><p><strong>Vector Similarity Search</strong>: This query embedding is sent to Turbopuffer (Cursor's vector database), which performs a nearest-neighbor search to find code chunks semantically similar to your query.</p></li><li><p><strong>Local File Access</strong>: Cursor's client receives the results, which include obfuscated file paths and line ranges of the most relevant code chunks. Importantly, the actual code content remains on your machine and is retrieved locally.</p></li><li><p><strong>Context Assembly</strong>: The client reads these relevant code chunks from your local files and sends them as context to the server for the LLM to process alongside your question.</p></li><li><p><strong>Informed Response</strong>: The LLM now has the necessary context from your codebase to provide a more informed and relevant response to your question or to generate appropriate code completions. </p></li></ol><p>This embedding-powered retrieval allows for:</p><ol><li><p><strong>Contextual Code Generation</strong>: When writing new code, Cursor can reference similar implementations in your existing codebase, maintaining consistent patterns and styles.</p></li><li><p><strong>Codebase Q&amp;A</strong>: You can ask questions about your codebase and get answers informed by your actual code rather than generic responses.</p></li><li><p><strong>Smart Code Completion</strong>: Code completions can be enhanced with awareness of your project's specific conventions and patterns.</p></li><li><p><strong>Intelligent Refactoring</strong>: When refactoring code, the system can identify all related pieces across your codebase that might need similar changes.</p></li></ol><div><hr></div><h2>Why Cursor Uses Merkle Trees </h2><p>Many of these details are security-related, and thus can be found in <a href="https://www.cursor.com/en/security">Cursor&#8217;s security documentation</a>.</p><h3>1. Efficient Incremental Updates</h3><p>By using a Merkle tree, Cursor can quickly identify exactly which files have changed since the last synchronization. Instead of re-uploading the entire codebase, it only needs to upload the specific files that have been modified. This is important for large codebases where re-indexing everything would be too expensive in terms of bandwidth and processing time.</p><h3>2. Data Integrity Verification</h3><p>The Merkle tree structure allows Cursor to efficiently verify that the files being indexed match what's stored on the server. The hierarchical hash structure makes it easy to detect any inconsistencies or corrupted data during transfer.</p><h3>3. Optimized Caching</h3><p>Cursor stores embeddings in a cache indexed by the hash of the chunk, ensuring that indexing the same codebase a second time is much faster. This is great for teams where multiple developers might be working with the same codebase.</p><h3>4. Privacy-Preserving Indexing</h3><p>To protect sensitive information in file paths, Cursor implements path obfuscation by splitting the path by '/' and '.' characters and encrypting each segment with a secret key stored on the client. While this still reveals some information about directory hierarchy, it hides most sensitive details.</p><h3>5. Git History Integration</h3><p>When codebase indexing is enabled in a Git repository, Cursor also indexes the Git history. It stores commit SHAs, parent information, and obfuscated file names. To enable sharing the data structure for users in the same Git repo and on the same team, the secret key for obfuscating file names is derived from hashes of recent commit contents.</p><h2>Embedding Models and Considerations</h2><p>The choice of embedding model significantly impacts the quality of code search and understanding. While some systems use open-source models like <a href="https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2">all-MiniLM-L6-v2</a>, Cursor likely uses either OpenAI's embedding models or custom embedding models specifically tuned for code. For specialized code embeddings, models like Microsoft's <a href="https://huggingface.co/microsoft/unixcoder-base">unixcoder-base</a> or Voyage AI's <a href="https://docs.voyageai.com/embeddings/models/">voyage-code-2</a> are good for code-specific semantic understanding.</p><p>The embedding challenge is made more complex because embedding models have token limits. OpenAI's <a href="https://platform.openai.com/docs/guides/embeddings">text-embedding-3-small</a> model, for example, has a token limit of 8192. Effective chunking helps stay within token limits while preserving semantic meaning.</p><h2>The Handshake Process</h2><p>A key aspect of Cursor's Merkle tree implementation is the handshake process that occurs during synchronization. Logs from the Cursor application reveal that when initializing codebase indexing, Cursor creates a "merkle client" and performs a "startup handshake" with the server. This handshake involves sending the root hash of the locally computed Merkle tree to the server, as seen in <a href="https://github.com/getcursor/cursor/issues/2209">Issue #2209 on GitHub</a> and <a href="https://github.com/getcursor/cursor/issues/981">Issue #981 on GitHub</a>.</p><p>The handshake process allows the server to determine which parts of the codebase need to be synced. Based on the handshake logs, we can see that Cursor computes the initial hash of the codebase and sends it to the server for verification, as documented in <a href="https://github.com/getcursor/cursor/issues/2209">Issue #2209 on GitHub</a>.</p><h2>Technical Implementation Challenges</h2><p>While the Merkle tree approach offers many advantages, it's not without implementation challenges. Cursor's indexing feature often experiences heavy load, causing many requests to fail. This can result in files needing to be uploaded several times before they get fully indexed. Users might notice higher than expected network traffic to 'repo42.cursor.sh' as a result of these retry mechanisms, as mentioned in <a href="https://www.cursor.com/en/security">Cursor's security documentation</a>.</p><p>Another challenge relates to embedding security. Academic research has shown that reversing embeddings is possible in some cases. While current attacks typically rely on having access to the embedding model and working with short strings, there is a potential risk that an adversary who gains access to Cursor's vector database could extract information about indexed codebases from the stored embeddings.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Metric-Driven Development and The Claude Effect ]]></title><description><![CDATA[Sometimes, feels have to be trusted over figures]]></description><link>https://read.engineerscodex.com/p/metric-driven-development-and-the</link><guid isPermaLink="false">https://read.engineerscodex.com/p/metric-driven-development-and-the</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Sun, 09 Mar 2025 22:45:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!DBBN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Anthropic, in their <a href="https://www.anthropic.com/news/claude-3-7-sonnet">release of Claude 3.7 and Claude Code</a>, wrote:</p><blockquote><p>"&#8230;in developing our reasoning models, <strong>we've optimized somewhat less for math and computer science competition problems, and instead shifted focus towards real-world tasks that better reflect how businesses actually use LLMs</strong>. Early testing demonstrated Claude's leadership in coding capabilities across the board: Cursor noted Claude is once again best-in-class for real-world coding tasks, with significant improvements in areas ranging from handling complex codebases to advanced tool use."</p></blockquote><p>It immediately reminded me of a Jeff Bezos quote from an interview he had:</p><blockquote><p>"<strong>When the data and the anecdotes disagree, the anecdotes are usually right.</strong> It's usually not that the data is being miscollected. It's usually that you're not measuring the right thing. If you have a bunch of customers complaining about something, and at the same time your metrics look like they shouldn't be complaining, you should doubt the metrics." <a href="https://articles.data.blog/2024/03/30/jeff-bezos-when-the-data-and-the-anecdotes-disagree-the-anecdotes-are-usually-right/">The full quote is great.</a></p></blockquote><p>Developers who have used all the popular AI tools (ChatGPT, Claude, etc), generally prefer Claude for coding over the rest. I recently ran a survey on developers wh</p><p>Though we have Google's Gemini and OpenAI's models topping the AI leaderboards in terms of benchmarks, Claude still remains the best coding tool in terms of the real world. (Yes, I know the benchmark for this is technically SWE-Bench). There's a reason why it's the default model for popular AI IDEs like Windsurf - no matter what the benchmarks say, there's a certain "vibe" to Claude that ends up passing for devs compared to the other models.</p><h2><strong>Devs prefer Claude in the real world</strong></h2><p>I recently ran a survey with 1370 devs who use AI often (at least once a day) during coding.</p><p>A vast majority of them preferred Claude 3.5 over any other:</p><ul><li><p>78% preferred Claude 3.5 as their #1 choice</p></li><li><p>13% chose OpenAI's o3 models</p></li><li><p>9% used other models, like Gemini</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DBBN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DBBN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 424w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 848w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 1272w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DBBN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png" width="761" height="507" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb814d42-8916-441e-b647-6783abb2d55b_761x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:507,&quot;width&quot;:761,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DBBN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 424w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 848w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 1272w, https://substackcdn.com/image/fetch/$s_!DBBN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb814d42-8916-441e-b647-6783abb2d55b_761x507.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This isn't isolated to AI tools. <a href="https://news.ycombinator.com/item?id=43163990">As one developer noted on Hacker News</a>:</p><blockquote><p>"<strong>Claude is the best example of benchmarks not being reflective of reality.</strong> All the AI labs are so focused on improving benchmark scores but when it comes to providing actual utility Claude has been the winner for quite some time. Which isn't to say that benchmarks aren't useful. They surely are. But labs are clearly both overtraining and overindexing on benchmarks."</p></blockquote><div><hr></div><h3><a href="https://swequiz.com/">SWE Quiz</a> (Sponsored)</h3><p>SWE Quiz is the easiest way to build your system design fundamentals through 500+ questions on concepts like authentication, databases, and more.</p><p>SWE Quiz has crash courses to get up to speed quickly, smart quizzes to fill in gaps of knowledge, interview readiness scores, and concept roadmaps. It is offering a lifetime payment for a limited time and new content is being added weekly.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://swequiz.com&quot;,&quot;text&quot;:&quot;Redeem SWE Quiz's Lifetime Offer&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://swequiz.com"><span>Redeem SWE Quiz's Lifetime Offer</span></a></p><div><hr></div><h2><strong>Metric-driven development can be a problem</strong></h2><p>When metrics become the goal rather than a tool for measurement, we enter dangerous territory. At its core, metric-driven development is meant to provide objective guidance for improvement. But too often, it creates a myopic focus that misses the forest for the trees. This is especially true for large FAANG-level companies, where the size of the company and incentives for rewards like promotion are usually numbers-based. Launching a half-baked feature/product to millions of pre-existing mobile DAUs lets you say &#8220;you gained millions of DAUs&#8221; on your promotion packet, regardless of whether the product is even liked by users or not. After that, it commonly becomes someone else&#8217;s problem to find a metric that correlates with how much users like the product and then work towards improving it.</p><blockquote><p>&#8220;A <a href="https://hbr.org/2019/09/dont-let-metrics-undermine-your-business">Harvard Business Review article</a> looked at Wells Fargo as a case study of how letting metrics replace strategy can harm a business. After identifying cross-selling as a measure of long-term customer relationships, Wells Fargo went overboard emphasizing the cross-selling metric: intense pressure on employees combined with an unethical sales culture led to 3.5 million fraudulent deposit and credit card accounts being opened without customers' consent. The metric of cross-selling is a much more short-term concern compared to the loftier goal of nurturing long-term customer relationships.&#8221; - <a href="https://articles.data.blog/2019/10/02/the-problem-with-metrics-is-a-big-problem-for-ai/">Data.Blog</a></p></blockquote><p>This pattern repeats in tech companies of all sizes. A developer from a FAANG company shared this revealing story:</p><blockquote><p>"At &lt;FAANG mega-corp&gt;, I used to work on an internal team which basically did nothing important, certainly nothing users ever think about. The problem that we were trying to solve, well, we had already solved it about 3 years ago, yet the team was still expanding, and our product managers kept spitting out new (mostly useless) project ideas. One of the main areas of focus was metrics. Leadership was obsessed with metrics, we measured everything."</p></blockquote><p>The contrast came when this developer moved to a smaller team with a clearer purpose:</p><blockquote><p>"One of the first things I said to my new product manager was 'so, what metrics do you care about? how do you measure success?' He was taken aback by my question. He seemed genuinely perplexed. He paused for a few seconds, then said 'metrics? What do you mean by metrics? I look at revenue, when the line goes up I'm happy'."</p></blockquote><p>This simplicity - focusing on actual outcomes rather than proxy measurements - cuts to the heart of the problem with pure metric-driven development.</p><h2><strong>Feels Over Figures, Vibes Equals Value</strong></h2><p>What's happening with Claude is something I&#8217;ve been casually calling &#8220;Feels over Figures&#8221; - when a tool's real-world feedback doesn&#8217;t necessarily match its overall benchmark performance. Yes, Claude does dominate SWE-bench, but in general, Claude has won over users because it delivers what they actually need in their workflow.</p><p>&#8220;The Claude Effect&#8221; here shows what&#8217;s missing - the human element, the "feel" of using a tool, and the general vibes of using a tool.</p><p>I suspect this is also why OpenAI chose to release GPT-4.5, which from a practical numbers perspective, doesn&#8217;t really make sense at all. It&#8217;s seemingly worse numbers wise on so many things, like reasoning and price. But they specifically denote the &#8220;EQ&#8221; of the model, which is presumably the optimization that they are hill climbing for here. If they&#8217;re going to take a note from DeepSeek, they&#8217;ll probably use GPT-4.5 to increase the EQ of the rest of their models.</p><p>If anything, especially when working on something as non-deterministic as LLMs, it makes sense to accept that there is extra human toil necessary to understand the &#8220;vibes&#8221; aspect when evaluating performance. This means having more human spot checks and collecting more <em>valuable</em> human qualitative feedback (and not necessarily grinding it down to a number or throwing it onto a Likert scale immediately). It also means prioritizing the non-technical aspects too - like design and user flows.</p><p>The gap between metrics and real-world value isn't going away, so rather, it's best to have methods to bridge them as close as possible. The Claude Effect teaches us that sometimes the most valuable aspects of a tool come from qualities that aren't easily quantified - the intuitiveness of its responses, how well it aligns with developer thinking patterns, or how seamlessly it fits into existing workflows.</p><p>One Hacker News commenter put it as the <a href="https://news.ycombinator.com/item?id=43163990">"gamedev mindset":</a> "Yes data is good. But I think the industry would very often be better off trusting guts and not needing a big huge expensive UX study or benchmark to prove what you can plainly see."</p>]]></content:encoded></item><item><title><![CDATA[5 Non-LLM Software Trends To Be Excited About]]></title><description><![CDATA[Innovations outside the AI spotlight]]></description><link>https://read.engineerscodex.com/p/5-non-llm-software-trends-to-be-excited</link><guid isPermaLink="false">https://read.engineerscodex.com/p/5-non-llm-software-trends-to-be-excited</guid><dc:creator><![CDATA[Engineer's Codex]]></dc:creator><pubDate>Tue, 12 Nov 2024 07:31:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!WJEA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>LLMs have been all the rage in tech since ChatGPT&#8217;s release in November 2022. It feels crazy to think that it was released almost 2 years ago! Yet, in that same timeframe, there have been many other exciting advancements in software engineering that haven&#8217;t received the hype they may have deserved because of the LLM hype.</p><p>It&#8217;s true that LLMs are revolutionary, and while I work with LLMs daily, there are so many other things that are fascinatingly progressing. I go over some topics below and provide a host of links for each topic for those interested in learning more. I see these topics as trends that are only growing as time goes on.</p><h1>Local-first software</h1><p>Local-first software has been around for decades, but it seems that the past few years have seen increased activity in making the developer experience around local-first software better. Local-first software prioritizes storing and processing data on a user&#8217;s local device rather than relying solely on remote servers.&nbsp;</p><p>The best intro to the local-first software paradigm is by Ink and Switch: <a href="https://www.inkandswitch.com/local-first/">Local-first software: You own your data, in spite of the cloud</a>.&nbsp;</p><p>Companies and packages like React-Query, PouchDB, InstantDB, Legend-State, PowerSync, ElectricSQL, and more focus on making the sync process easier between client and server.</p><p>Local-first is the natural next step of user experience. Making things persist locally allows for near-zero latency for interactions, better user experiences, and more resilient clients in low-to-no internet connections. I predict this will become particularly important as user expectations for software continues to rise in the future.</p><p>Some interesting work in this space is conflict resolution. Conflict resolution is needed when there are local changes and server-side changes that conflict with each other, and thus, need resolution. I wrote up a quick summary of the most common conflict resolution methods below. (Note: Some systems combine multiple strategies, like using CRDTs for simple data types and three-way merging for more complex documents.)</p><h4><strong>CRDTs (Conflict-free Replicated Data Types)</strong></h4><p>CRDTs are data structures designed to be merged automatically and deterministically without conflicts. They use mathematical principles to ensure that no matter the order in which changes are applied, all replicas will eventually converge to the same state. CRDTs are great for collaborative applications like text editors, shared to-do lists, or any system where users make frequent updates offline.</p><p>The best articles I&#8217;ve seen for CRDTs are <a href="https://jakelazaroff.com/words/an-interactive-intro-to-crdts/">An Interactive Intro to CRDTs</a> and <a href="https://vlcn.io/blog/intro-to-crdts">A Gentle Introduction to CRDTs</a>.</p><p>Another article that argues against CRDTs for certain experiences is <a href="https://zknill.io/posts/collaboration-no-crdts/">You don't need CRDTs for collaborative experiences</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WJEA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WJEA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WJEA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png" width="1456" height="1082" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1082,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WJEA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!WJEA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d7e0f9b-fc89-4bd6-8c00-c5ddd149a9c9_1477x1098.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Operational Transforms (OT)</strong></h4><p>Operational Transforms are also commonly used in collaborative text editors like Google Docs. OT involves transforming operations (like insertions or deletions) on shared documents to ensure that concurrent edits are applied in a consistent way. OT allows for real-time collaboration while maintaining data consistency, even when multiple users are editing simultaneously across devices.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Buko!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Buko!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!Buko!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!Buko!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!Buko!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Buko!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png" width="1456" height="1082" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1082,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Buko!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!Buko!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!Buko!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!Buko!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7919562-57cb-4d13-b1ae-e1d73bbcc9f3_1477x1098.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Last-Write-Wins (LWW)</strong></h4><p>This is a simpler approach where, in case of conflict, the most recent change (based on timestamp) is accepted as the final version. While this strategy is straightforward and easy to implement, it may lead to data loss if conflicting changes are made almost simultaneously. It's best suited for scenarios where the latest update is usually the correct one or the preferred one.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!boua!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!boua!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!boua!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!boua!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!boua!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!boua!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png" width="1456" height="1082" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1082,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!boua!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 424w, https://substackcdn.com/image/fetch/$s_!boua!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 848w, https://substackcdn.com/image/fetch/$s_!boua!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 1272w, https://substackcdn.com/image/fetch/$s_!boua!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6d5ebb-6084-41cd-84d0-e94e68e62c4a_1477x1098.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Three-Way Merging</strong></h4><p>Inspired by version control systems like Git, this method involves maintaining a base version of the data along with changes from different devices. If conflicts are detected, the system attempts to merge them or prompts the user to resolve them. This approach provides flexibility but may require user intervention, so it&#8217;s best used in cases where it&#8217;s okay to have input from the user to resolve data. Still, this merge does its best to auto-merge everything. There is a &#8220;simpler&#8221; non-merge solution where conflicts are simply shown to the user, who can then pick the correct side themselves.</p><h4><strong>Event Sourcing</strong></h4><p>Instead of storing the current state, the system stores a series of events that led to that state. When conflicts occur, the system can replay events to determine the most accurate or meaningful resolution. Event sourcing provides an audit trail and allows for complex conflict resolution strategies, but it can be more complex to implement.</p><p>&#8212;</p><p>Links to read:</p><ul><li><p><a href="https://www.inkandswitch.com/">Ink and Switch</a></p></li><li><p><a href="https://www.localfirstnews.com/">Local First News</a></p></li><li><p><a href="https://localfirstweb.dev/">Local-First Software</a>&nbsp;</p></li><li><p><a href="https://news.ycombinator.com/item?id=34857435">Local-First Web Development | Hacker News</a>&nbsp;</p></li></ul><h1>WebAssembly</h1><p>WebAssembly is a binary instruction format that allows code to run directly in the browser with near-native speed.&nbsp;</p><p>The possibilities of WASM are super exciting:</p><h4><strong>In-built code execution in the browser</strong></h4><p>WASM allows developers to run complex applications within the browser itself, bypassing the need for server-side processing. This is awesome for tools like code editors, development environments, and real-time simulations that can now operate entirely client-side.&nbsp;</p><h4><strong>SQLite in the browser</strong></h4><p>By running a <a href="https://sqlite.org/wasm/doc/trunk/index.md">SQLite database directly in the browser with WASM</a>, web apps now have an alternative to IndexedDB and LocalStorage to store and query data locally. This opens up new possibilities for offline functionality and data caching. This connects really well with the local-first movement along with SQLite growing in popularity in general. (I talk about this more below, but <a href="https://www.notion.com/blog/how-we-sped-up-notion-in-the-browser-with-wasm-sqlite">Notion uses WASM SQLite</a>).</p><h4><strong>Faster user experiences</strong></h4><p>WASM supports caching of compiled code, resulting in faster load times on subsequent visits. This means faster, better user experiences. It also lets applications deliver sophisticated functionality on par with native apps, without the need to repeatedly re-download code. This is a great article on this: <a href="https://v8.dev/blog/wasm-code-caching">Code caching for WebAssembly developers &#183; V8</a>&nbsp;</p><h4><strong>AI in the Browser&nbsp;</strong></h4><p>Yes, I know that I said this was a list of exciting non-AI innovations, but this one is very relevant and particularly promising. WASM has made it possible to run machine learning models directly in the browser, without needing a backend server. This lets AI-driven features, such as image recognition or text analysis, to function quickly and privately on users&#8217; devices without any cloud costs. Projects like TensorFlow.js with WASM backends enable running AI models with improved performance compared to pure JavaScript implementations. Google Chrome had a great talk on this: <a href="https://developer.chrome.com/blog/io24-webassembly-webgpu-1">WebAssembly and WebGPU enhancements for faster Web AI, part 1</a>.</p><h1>SQLite&#8217;s Renaissance</h1><p>Most developers, when thinking about what database to use, think about MySQL/Postgres (relational) or Mongo/Dynamo (NoSQL). For many production grade applications, it&#8217;s probably a good idea to use one of these for the foundation of your database.</p><p>But it&#8217;s not always necessary. Kent Dodds argues that<a href="https://www.epicweb.dev/why-you-should-probably-be-using-sqlite"> you could probably just use SQLite in production</a>. <a href="https://fractaledmind.github.io/2023/12/23/rubyconftw/">So does Stephen Margheim at the Ruby Conf.</a> Regardless of whether you agree or not, the points they makes in favor of SQLite are valuable:</p><ul><li><p>zero latency</p></li><li><p>simplified setup</p></li><li><p>easy multi-instance replication</p></li><li><p>can handle massive databases (more than you think)</p></li><li><p>much easier to develop and test with.</p></li></ul><p>But in reality, SQLite simply has<a href="https://avi.im/blag/2024/sqlite-bad-rep/"> tradeoffs</a>. My favorite quote from the founder of SQlite is simply that: </p><blockquote><p>"Think of SQLite not as a replacement for<a href="http://www.oracle.com/database/index.html"> Oracle</a> but as a replacement for<a href="http://man.he.net/man3/fopen"> fopen()</a>.".</p></blockquote><p>SQLite has recently been seeing a lot of renewed activity in terms of hype too. Why? It&#8217;s probably because of cycles. Dev tools go through cycles of hype and usage, and now that there&#8217;s more commercial force behind SQLite&#8217;s usage, we&#8217;re seeing a <a href="https://blog.wesleyac.com/posts/consider-sqlite">lot more public writing pushing to use it</a>. That&#8217;s not to say SQLite was some infrequently used database before.</p><p>Hacker News has some <a href="https://news.ycombinator.com/item?id=31152490">interesting discussion on people who have used SQLite as a primary database</a>.</p><p>While I don&#8217;t see <em>too much movement</em> to SQLite as a primary database in general, I <em>do see value in SQLite</em> for <strong>local-first software (especially combined with WebAssembly advancements).</strong></p><p>Expo (React Native) constantly releases new versions of <a href="https://docs.expo.dev/versions/v52.0.0/sdk/sqlite/">expo-sqlite </a>with cool new features and upgrades. Expo v52 introduces a new Storage drop-in replacement for React Native&#8217;s AsyncStorage, with added synchronous APIs for convenience. In local-first mobile apps, SQLite is a rock-solid local store and usually a better option than <a href="https://react-native-async-storage.github.io/async-storage/docs/usage/">AsyncStorage</a>.</p><p>Notion implemented SQLite caching in their desktop apps in 2021, resulting in:</p><ul><li><p>50% faster initial page loads</p></li><li><p>50% faster navigation between pages</p></li></ul><p>Inspired by this success, Notion's team decided to bring these performance gains to their web app using WebAssembly (WASM) SQLite. This led to Notion reducing their page navigation latency on the web by 20% using <a href="https://www.threads.net/@engineerscodex/post/C-T4vZiPVY9">SQLite client-side</a>. (<a href="https://www.threads.net/@engineerscodex/post/C-T4v-KvrJk">Summary</a>, <a href="https://www.notion.com/blog/how-we-sped-up-notion-in-the-browser-with-wasm-sqlite">Blog Post</a>).&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T5Kv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T5Kv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 424w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 848w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 1272w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T5Kv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png" width="1080" height="745" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:745,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T5Kv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 424w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 848w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 1272w, https://substackcdn.com/image/fetch/$s_!T5Kv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98e48ba6-f1c7-4508-9ef2-254f9eeae115_1080x745.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>They also go over some interesting problems they faced, like having to optimize WASM SQLite loading and fixing slow disk reads on slower devices.</p><h1>Cross-Platform is getting better (React Native, Flutter)</h1><p>Cross-platform is trudging along, making great strides in performance, dev experience, usability, and&nbsp; more. For example, React Native recently introduced their <a href="https://reactnative.dev/architecture/landing-page">New Architecture</a>, which leads to more polished experiences.</p><p>One of the coolest recent examples of this is <strong>Shopify migrating their entire mobile app to React Native</strong>. (<a href="https://x.com/mustafa01ali/status/1853619638141071573">Source</a>) Now, 86% of their code is shared between iOS and Android. Not only that, performance improved along the way! They improved screen load times by 59%, app launches are now 44% faster, and webviews are now 63% faster.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eV9a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eV9a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 424w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 848w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 1272w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eV9a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png" width="1196" height="380" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99794384-40f4-4070-856f-6bda998edfb3_1196x380.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:380,&quot;width&quot;:1196,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eV9a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 424w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 848w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 1272w, https://substackcdn.com/image/fetch/$s_!eV9a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99794384-40f4-4070-856f-6bda998edfb3_1196x380.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This doesn&#8217;t really take away the need for native development of course. Mustafa Ali gives some great <a href="https://x.com/mustafa01ali/status/1853619656646418519">lessons learned</a> from the experience too:</p><ol><li><p>&#8220;Native code and native devs are crucial. There is no replacing the experience and taste that comes from having built high-quality mobile apps.&#8221;</p></li><li><p>&#8220;100% React Native should be an anti-goal. Use native wherever it is the best tool for the job (widgets, Siri shortcuts, watch app and complications, etc), or in places where there are high performance requirements.&#8221;</p></li><li><p>&#8220;Achieving good performance takes work and should be a priority from the start. Measure everything and relentlessly optimize every layer. Add automated monitoring to catch regressions.&#8221;</p></li></ol><h1>Automated reasoning&nbsp;</h1><p>Automated reasoning is a bit more obscure, but also super exciting. Automated reasoning focuses on using logic and mathematical proofs to make sure that systems behave as intended. Unlike traditional testing, which validates system behavior in specific scenarios, automated reasoning allows engineers to verify correctness across all possible scenarios. Basically, it&#8217;s a shift from reactive testing to proactive verification, leading to (ideally) better reliability and security. <a href="https://www.amazon.science/blog/a-gentle-introduction-to-automated-reasoning">Amazon has a gentle intro to automated reasoning published.</a></p><p><a href="https://aws.amazon.com/blogs/security/an-unexpected-discovery-automated-reasoning-often-makes-systems-more-efficient-and-easier-to-maintain/">AWS also recently wrote a great blog post on how they&#8217;ve been using automated reasoning techniques in their infrastructure.</a> Over a decade of applying these techniques, AWS has found that formally verified code often outperforms the unverified code it replaces. This is because the process of formal verification helps uncover bugs early, leading to optimizations that improve runtime performance.</p><p>For example, they found that by building a formal spec of IAM, they were able to optimize code that processes over 1.2 billion requests per second, resulting in a 50% performance boost. For S3, they used automated reasoning to find hidden bugs, which let them ship updates more frequently - from every quarter down to every 1-2 months.</p>]]></content:encoded></item><item><title><![CDATA[How Fireship became YouTube's favorite programmer]]></title><description><![CDATA[How Fireship wins YouTube]]></description><link>https://read.engineerscodex.com/p/how-fireship-became-youtubes-favorite</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-fireship-became-youtubes-favorite</guid><pubDate>Wed, 09 Oct 2024 05:17:45 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5c2c2c9b-05ed-434f-9b02-9d936dffa100_738x410.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post is a bit different from most of my other articles I&#8217;ve written. It&#8217;s about <em>someone technical</em> rather than <em>something technical</em>. Nevertheless, I hope you find it interesting and insightful!</p><p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p><a href="https://www.youtube.com/@Fireship">Fireship</a> is one of YouTube&#8217;s most popular programming channels. With over 3 million subscribers and 200 million total views, he&#8217;s garnered a fanbase with his fast-paced, humorous, meme-filled videos explaining programming and software trends.</p><p>Each Fireship video, with a combo of sarcastic humor combined with bite-sized learning, leaves you satisfyingly entertained and gladly informed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!adVo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!adVo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 424w, https://substackcdn.com/image/fetch/$s_!adVo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 848w, https://substackcdn.com/image/fetch/$s_!adVo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 1272w, https://substackcdn.com/image/fetch/$s_!adVo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!adVo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png" width="1331" height="426" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:426,&quot;width&quot;:1331,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:122559,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!adVo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 424w, https://substackcdn.com/image/fetch/$s_!adVo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 848w, https://substackcdn.com/image/fetch/$s_!adVo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 1272w, https://substackcdn.com/image/fetch/$s_!adVo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba5bd307-ee33-47ce-9b0d-39e36ab7dcc8_1331x426.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>What makes Fireship&#8217;s videos <strong>so good</strong>?</p><p>What is his secret to <strong>growing so fast</strong> on one of the <strong>hardest niches</strong> on YouTube?</p><p><strong>And how exactly did he do it?</strong></p><p>That&#8217;s what we&#8217;ll answer in this article.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/p/how-fireship-became-youtubes-favorite?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/p/how-fireship-became-youtubes-favorite?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2>The Types of YouTube Programmers</h2><p>Programming is a popular topic on YouTube, and most programming YouTubers fall into one of four categories. (Some YouTubers will fall into more than one or be in half a category).</p><ol><li><p><strong>Tutorials</strong>: Tutorial YouTubers create tutorials for various technologies, usually by walking through the creation of a sample project. However, the main issue here is that someone watching a &#8220;Firebase and Angular&#8221; tutorial may not want to watch a &#8220;React Native&#8221; tutorial, making one&#8217;s subscriber base fragmented. (Example: <a href="https://www.youtube.com/@thenewboston/">thenewboston</a>)</p></li><li><p><strong>Humor</strong>: Humor-focused programmers are extremely popular. Creators rise quickly from making comedy skits with niche tech and software engineering jokes. (Example: <a href="https://www.youtube.com/@jomakaze">Joma Tech</a>)</p></li><li><p><strong>Coaches</strong>: YouTubers who generally work in tech as a software engineer and teach others how to get a job. (Example: <a href="https://www.youtube.com/@sahilandsarra">Power Couple</a>)</p></li><li><p><strong>Commentary</strong>: YouTubers who generally work in tech as a software engineer and commentate on happenings. (Example: <a href="https://www.youtube.com/@ThePrimeTimeagen">ThePrimeagen and his glorious moustache</a>, <a href="https://www.youtube.com/c/neetcode">Neetcode</a>)</p></li><li><p><strong>Indirect Entertainment</strong>: These are more &#8220;classic&#8221; YouTubers, where programming is in the background and entertainment is the first part. (Example: <a href="https://www.youtube.com/@Fundy">Fundy</a>).</p></li></ol><p>Which category does Fireship fall into?</p><h2>Fireship&#8217;s Beginning</h2><p>Fireship began by creating niche tutorials, specifically <a href="https://www.youtube.com/watch?v=iaXhn5Wuk2c">Angular + Firebase tutorials</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SulH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SulH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 424w, https://substackcdn.com/image/fetch/$s_!SulH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 848w, https://substackcdn.com/image/fetch/$s_!SulH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 1272w, https://substackcdn.com/image/fetch/$s_!SulH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SulH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png" width="1320" height="323" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd762e69-584d-4780-bf95-0549ca57f372_1320x323.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:323,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:220743,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SulH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 424w, https://substackcdn.com/image/fetch/$s_!SulH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 848w, https://substackcdn.com/image/fetch/$s_!SulH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 1272w, https://substackcdn.com/image/fetch/$s_!SulH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd762e69-584d-4780-bf95-0549ca57f372_1320x323.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>He eventually expanded his niche as his audience grew.&nbsp;</p><p>He stuck with programming, but started generalizing the tutorials, going from &#8220;Angular and Firebase&#8221; to &#8220;Firebase Basics&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UzmK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UzmK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 424w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 848w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 1272w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UzmK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png" width="1312" height="318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:318,&quot;width&quot;:1312,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:252584,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UzmK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 424w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 848w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 1272w, https://substackcdn.com/image/fetch/$s_!UzmK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0acebc7b-dfc9-4ca8-a2d2-987b60626298_1312x318.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Then, as he kept growing, he widened the niche of programming even more, going over more generalized concepts while adding more personality into his explanations. His videos got faster-paced and much more interesting, as he started adding his sarcastic humor, niche jokes, and funny memes into each one.</p><h2>Fireship&#8217;s Secret Sauce: Humor</h2><p>Let&#8217;s look a little deeper into Fireship&#8217;s sense of humor.</p><ol><li><p><strong>Niche Jokes</strong></p></li></ol><p>He commonly makes jokes that only people with some programming experience would understand, such as jokes about how every week there&#8217;s a new JavaScript framework coming out.</p><ol start="2"><li><p><strong>Funny Memes</strong></p></li></ol><p>Since he doesn&#8217;t show his face, he needs to put something on the screen that&#8217;s visually entertaining and he uses memes and hilarious scenes from various media.</p><ol start="3"><li><p><strong>Sarcasm/Self-deprecating humor</strong></p></li></ol><p>Lastly, his sense of humor is sarcastic and often self-deprecating. In his &#8220;How to get a 1M subscribers in 100 seconds video&#8221; he talks about how he has the personality of a carrot (he doesn&#8217;t) and his handsome face (he is).</p><p>All these humorous aspects combined make Fireship an approachable YouTuber. He feels like your friend or coworker. He has jokes that feel like inside jokes, he shares memes with you (like your friend that sends you Reels on Instagram), and his sarcastic, self-deprecating humor gives him a sense of humbleness that makes him feel like a peer rather than this &#8220;YouTuber&#8221;.</p><h2>Fireship&#8217;s YouTube Strategy Explained</h2><p>Thanks to these aspects, viewers are encouraged to comment and discuss the topic at hand in the comments, boosting engagement. Since he teaches things too, you&#8217;ll see many comments glad they learned something new in an entertaining way.</p><p>And the way Fireship structures his channel not only drives viewer engagement, but also encourages &#8220;binge sessions&#8221;.</p><h3>Evergreen Videos</h3><p>YouTube loves it when a viewer binges someone&#8217;s videos. It shows that the viewer is satisfied enough that they keep watching one&#8217;s content and as a result, will boost that YouTube channel in the hopes that other people will also binge that content (and spend more time on YouTube as a result).</p><p>The best way to create a binge library is through evergreen videos - videos that are part of a series, but not news or trend related.</p><p>Fireships&#8217;s &#8220;X in 100 Seconds&#8221; series fits this bill. He publishes quick, fast-paced explainers in his unique style of topics like languages, frontend frameworks, and more.&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Aj46!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Aj46!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 424w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 848w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 1272w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Aj46!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png" width="851" height="412" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d6db7953-6f93-4df7-90af-df39891c0744_851x412.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:412,&quot;width&quot;:851,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:312005,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Aj46!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 424w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 848w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 1272w, https://substackcdn.com/image/fetch/$s_!Aj46!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6db7953-6f93-4df7-90af-df39891c0744_851x412.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When someone watches &#8220;<a href="https://www.youtube.com/watch?v=U3aXWizDbQ4">C in 100 seconds</a>&#8221; and they enjoy it, they&#8217;re hooked. They&#8217;ll watch another video, maybe &#8220;<a href="https://www.youtube.com/watch?v=l9AzO1FMgM8">Java in 100 seconds</a>&#8221;. Each video is satisfying to watch, filled with Fireship-style humor, and short, leading to a satisfying experience and the feeling of &#8220;let me just watch one more video.. It&#8217;s only 2 minutes..&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tMeU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tMeU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 424w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 848w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 1272w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tMeU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png" width="323" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:323,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75618,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tMeU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 424w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 848w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 1272w, https://substackcdn.com/image/fetch/$s_!tMeU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de9e72b-6f58-4ae5-9b23-a9556837855f_323x572.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Other longer evergreen videos also do well, like <a href="https://www.youtube.com/watch?v=pEfrdAtAmqk&amp;t=284s">The God Tier Developer Roadma</a>p (11 minutes long), which is currently the second most viewed video on his channel, with almost 7 million views at the time of writing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MPHA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MPHA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 424w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 848w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 1272w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MPHA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png" width="323" height="270" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:270,&quot;width&quot;:323,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:131777,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MPHA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 424w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 848w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 1272w, https://substackcdn.com/image/fetch/$s_!MPHA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fa73e2b-5524-45f7-b78a-54fdff8edf76_323x270.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Trending Videos</h3><p>After publishing evergreen videos for a long time, Fireship started a new series, The Code Report, on Feb 1, 2022 (<a href="https://www.youtube.com/watch?v=bJUl3OAIT0k&amp;list=PL0vfts4VzfNjnYhJMfTulea5McZbQLM7G&amp;index=2">How a CS student tracks Elon&#8217;s Private Jet with Python</a>). The Code Report was introduced as &#8220;a new series where I bring you breaking news every programmer should know.&#8221;&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KI_k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KI_k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 424w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 848w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 1272w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KI_k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png" width="600" height="394.36813186813185" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:957,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:2528859,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KI_k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 424w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 848w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 1272w, https://substackcdn.com/image/fetch/$s_!KI_k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe21b57fe-6878-48da-a1e2-cc454f784f1b_3154x2072.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This video did really well and it fit the same style as the rest of Fireship&#8217;s videos - fast-paced, snappy, humorous, and educational.&nbsp;</p><p>Along the way, Fireship still continued uploading evergreen videos too.</p><h3>Growth</h3><p>This strategy of combining trendy topics along with evergreen videos was genius. Paddy Galloway, renowned YouTube strategist, has noted similar YouTubers do this, like <a href="https://www.youtube.com/channel/UCV6KDgJskWaEckne5aPA0aQ">Graham Stephan</a> in the finance niche.</p><p>It&#8217;s genius because trendy topics are pushed immediately, so they get a large amount of views in the beginning and then eventually taper off.</p><p>Evergreen videos may not get as many views in the beginning, but they grow in views steadily over time.</p><p>Combined, you get a view graph that looks like this. It&#8217;s spiky but the trend is up over time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pP9a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pP9a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 424w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 848w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 1272w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pP9a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png" width="905" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:905,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67655,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pP9a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 424w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 848w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 1272w, https://substackcdn.com/image/fetch/$s_!pP9a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80bba0f6-fd04-45f0-ba44-c7cc8069bf95_905x611.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Fireship&#8217;s growth really exploded when ChatGPT came out. At a time where there was tons of AI hype along with new AI announcements coming out daily, Fireship was uploading at a rapid pace. This pushed him to a new high of 16.9 MILLION views in March 2023, a time where ChatGPT plugins, GPT-4, and other AI advancements were all announced. He also gained a record high of 120K subscribers at this time too.</p><p>Of course, the tech world is chock-full of drama and new happenings, so Fireship beat this record in December 2023 with over 20M views that month and over 150k new subs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PhTr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PhTr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 424w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 848w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 1272w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PhTr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png" width="1285" height="870" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:870,&quot;width&quot;:1285,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:873696,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PhTr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 424w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 848w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 1272w, https://substackcdn.com/image/fetch/$s_!PhTr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cda85e5-0d2e-486f-8369-3927b0dd744b_1285x870.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Key Takeaways</h2><ul><li><p>Keep videos <strong>fast-paced</strong>. It boosts retention and keeps viewers watching.</p></li><li><p>Fireship excels at <strong>edutainment</strong>. Humor is a great way to educate and Fireship&#8217;s unique combination of humor scratches an itch for people watching.</p></li><li><p><strong>Trend-jacking: </strong>The Code Report capitalizes on trends, meaning his video about a timely topic will be searched for often and be pushed by YouTube more.</p></li><li><p><strong>Evergreen videos: </strong>Evergreen videos are necessary too, as they mean you have content and be discovered by new viewers at all times. A video like C in 100 seconds is timeless - C as a language is not going anywhere.</p></li><li><p><strong>There is no &#8220;limit&#8221; to growth: </strong>Looking at other programming YouTubers, you may think that growth can stall at some point. And it might! But programming is growing as a field and the younger generation is more YouTube-focused than most. <strong>The programming niche on YouTube (and other platforms!) can only grow, and by starting early, Fireship has set himself up as &#8220;Programming YouTube&#8217;s&#8221; top creator.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><p>My favorite takeaway is definitely &#8220;there&#8217;s no limit to growth.&#8221; It&#8217;s true of a lot of things, like companies. People never thought Apple would be a $1T company, yet it&#8217;s worth almost $3T today. It&#8217;s the same in the creator space. I&#8217;m sure that Gergely Orosz never expected the Pragmatic Engineer to one day have over 700,000 subscribers, yet it does!</p><p></p>]]></content:encoded></item><item><title><![CDATA[The Boolean Trap]]></title><description><![CDATA[Use enums instead]]></description><link>https://read.engineerscodex.com/p/the-boolean-trap</link><guid isPermaLink="false">https://read.engineerscodex.com/p/the-boolean-trap</guid><pubDate>Thu, 05 Sep 2024 02:06:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2baa3ff-3727-4dfa-a5c0-1b6f00b16d14_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Using booleans is a trap. Let me explain.</p><p>Something I&#8217;ve run into more often in the past year is the &#8220;boolean trap.&#8221; Booleans are great - simple with only two states. They&#8217;re very easy to use.</p><p>However, the issue comes when using booleans as parameters in functions or APIs. It&#8217;s an issue that I&#8217;ve ran into enough that I try to actually <em>refrain</em> from using booleans if possible.</p><div><hr></div><p>In my specific example, I was working on some LLM pipeline outputs. Initially, the LLM outputs were all in plaintext, so we had no flag. Suddenly, there was a need to also support JSON outputs because JSON is much easier to parse for further pipeline steps compared to plaintext.</p><p>So, we started off with the following <code>output_plaintext</code> flag:</p><pre><code>def call_llm(prompt: str, output_plaintext: bool)</code></pre><p>While premature optimization is the devil, this flag should already be setting off red flags in your head. Remember, the key of a good API is that it&#8217;s <em>easy to understand when reading</em>.</p><p>Imagine seeing this call in your Python code where types aren&#8217;t necessarily enforced, however:</p><pre><code>output = call_llm("Subscribe!", True)</code></pre><p>Anybody reading this will be confused. What is <code>true</code> referring to? What is the argument here?</p><p><strong>Remember, <a href="https://read.engineerscodex.com/i/136922518/dont-allow-surprises">well-written code is predictable</a>. Don&#8217;t allow surprises.</strong></p><p>Let&#8217;s say we add the argument in:</p><pre><code>output = call_llm(prompt="Subscribe!", output_plaintext=True)</code></pre><p>Now, this begs the question - <strong>what is the output when </strong><code>output_plaintext</code><strong> is False? HTML? CSV? LISP?</strong></p><p>Now, let&#8217;s say we have 400 instances of <code>call_llm</code> throughout our codebase now, all using this boolean flag. Uh oh, we just got a request to have <code>call_llm</code> support XML output too! Now this is a problem because we can&#8217;t shove XML support into a binary state. Plus, we have to go around and update each call to support the new type. Gross.</p><p>You can see how this big ugly problem is very prone to human error and the greatest creator of bugs are&#8230; humans. Yes, code is written for and processed by computers, but at the same time, you don&#8217;t code in a blackbox. <strong><a href="https://read.engineerscodex.com/i/136922518/code-for-the-human-not-the-computer">You&#8217;re also coding for other humans, including your own future self.</a></strong></p><p>So, <strong>make your life easier and don&#8217;t use boolean flags</strong>.</p><div><hr></div><p>In my opinion, it&#8217;s better to use <strong>enums</strong>, EVEN IF you only have a binary state to represent.</p><ul><li><p>Enums are much more <strong>readable</strong> - both in terms of function parameters and explicit typing.</p></li><li><p>Enums are more <strong>maintainable</strong> because they are <strong>extendable</strong>.</p></li><li><p>Enums are <strong>shareable</strong> across files.</p></li></ul><p>From the above example, we can use the following enum:</p><pre><code>class LLM_OUTPUT(Enum):
    TEXT = "text"
    JSON = "json"
    XML = "xml"
    MARKDOWN = "markdown"
    HTML = "html"
    CSV = "csv"
    YAML = "yaml"</code></pre><p>This is much nicer. We&#8217;re able to easily extend functions that already take in the <code>LLM_OUTPUT</code> enum past just binary states into N-ary states without even needing to update callers of this enum. </p><p>Now, the codebase will look like this, where in cases of no explicit keyword arguments, the functionality of the call is still extremely clear. Plus, someone doesn&#8217;t have to look into the actual application code to see what the different outputs are - a simple hover over the enum solves that.</p><pre><code>output = call_llm("Subscribe!", LLM_OUTPUT.JSON)
output = call_llm(prompt="Subscribe!", output_type=LLM_OUTPUT.JSON)</code></pre><p>Now, as always, <strong>context is everything</strong>. If a function does one thing, and it&#8217;s literally called <code>setIsModalOpen(bool isModalOpen)</code>, like for a modal in React, then booleans are perfect here. There is no chance of any possible extension in the future (what, you&#8217;re going to have it half open?) and seeing <code>setIsModalOpen(true)</code> is extremely obvious in what the function is doing. (Of course, there&#8217;s another argument here that instead of having a function like that, we could just have <code>setModalOpen() </code>and <code>setModalClosed()</code> instead (which I agree is much nicer)).</p><p>In general though - coding is as much science as it is art, and art is easier to have opinions on. Using booleans can be a trap, but also aren&#8217;t necessarily wrong. In my own experience, though, booleans usually are less maintainable than enums for API/function parameters over time.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><p>I do want to note (else Hacker News will kill me) that I&#8217;m not the first, nor will I be the last person to write about this:</p><ul><li><p><a href="https://softwareengineering.stackexchange.com/questions/147977/is-it-wrong-to-use-a-boolean-parameter-to-determine-behavior/147983#147983">Is it wrong to use a boolean parameter to determine behavior?</a></p></li><li><p><a href="https://martinfowler.com/bliki/FlagArgument.html">Flag Argument</a></p></li><li><p>And many more, I&#8217;m sure</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Good programmers worry about data structures and their relationships]]></title><description><![CDATA[Wisdom from Linus Torvalds, the creator of Git and Linux]]></description><link>https://read.engineerscodex.com/p/good-programmers-worry-about-data</link><guid isPermaLink="false">https://read.engineerscodex.com/p/good-programmers-worry-about-data</guid><pubDate>Mon, 08 Jul 2024 00:52:15 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f12c0cbb-11cf-4910-84f1-da94dd9ae166_1536x1536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>I recently came across a quote by Linus Torvalds (creator of Linux and Git) in this <a href="https://softwareengineering.stackexchange.com/questions/163185/torvalds-quote-about-good-programmer">great Stack Overflow post</a>. (This post reviews many quotes from that post.)</p><p>It succinctly described a problem I&#8217;ve been working on recently:</p><blockquote><p><em>"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."</em></p></blockquote><p>Right before the above quote, Linus said:</p><blockquote><p><em>git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I'm a huge proponent of designing your code around the data, rather than the other way around, and I think it's one of the reasons git has been fairly successful [&#8230;] I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important.</em></p></blockquote><p>Good data structures make code easier to design and maintain. It makes software more reliable, systems more understandable, and code more readable. When designing any software, application logic often follows the data model. Treating the data model as an afterthought results in more work down the line. The inverse is true also - having a well-thought out data model makes migrations and building on top of complex systems easier down the line.</p><p>When I read this quote, I actually was able to recognize countless examples in the past of this. I once worked on a project where we spent quite a while optimizing complex algorithms, only to realize that by restructuring our data, we could eliminate entire classes of problems. We replaced a 500-line function with a 50-line function and a well-designed data structure. Not only was the new code faster, but it was also much easier to understand and maintain.&nbsp;(Of course, then the problem also shifted &#8220;down the stack&#8221; to where the majority of toil was in restructuring existing data.)</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>If you like reading about practical software engineering, Engineer&#8217;s Codex is for you. (And it&#8217;s free!)</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><p>Another relevant quote here is in <em>The Art of Unix Programming</em>:&nbsp;</p><blockquote><p>Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.</p><p>Even the simplest procedural logic is hard for humans to verify, but quite complex data structures are fairly easy to model and reason about. To see this, compare the expressiveness and explanatory power of a diagram of (say) a fifty-node pointer tree with a flowchart of a fifty-line program. Or, compare an array initializer expressing a conversion table with an equivalent switch statement. The difference in transparency and clarity is dramatic. See Rob Pike's Rule 5.</p><p><strong>Data is more tractable than program logic. It follows that where you see a choice between complexity in data structures and complexity in code, choose the former. More: in evolving a design, you should actively seek ways to shift complexity from code to data.</strong></p><p>The Unix community did not originate this insight, but a lot of Unix code displays its influence. The C language's facility at manipulating pointers, in particular, has encouraged the use of dynamically-modified reference structures at all levels of coding from the kernel upward. Simple pointer chases in such structures frequently do duties that implementations in other languages would instead have to embody in more elaborate procedures.</p></blockquote><p>The <strong>actionable tip here is to start with the data. </strong>Try to reduce code complexity through stricter types on your interfaces or databases. Spend extra time thinking through the data structures ahead of time. </p><p>That&#8217;s not to say the <em>code isn&#8217;t important</em>. Obviously, everything is important - but it&#8217;s useful to have a strong high-level approach of how data will flow and how different components interact before going deeper into code-related details.&nbsp;</p><p>It&#8217;s why one of the <em>Senior Engineer (L5)</em> requirements (at least for FAANG) generally involves writing higher-level design docs for more complex systems (which includes driving team planning and building good roadmaps for medium-to-large features). </p><p><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Ryan Peterman&quot;,&quot;id&quot;:38830210,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f314b5-e648-438c-87ae-94017be476b4_400x400.jpeg&quot;,&quot;uuid&quot;:&quot;528327d7-9214-4ae7-820b-24553dc134bd&quot;}" data-component-name="MentionToDOM"></span> from <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;The Developing Dev&quot;,&quot;id&quot;:1340878,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/ryanlpeterman&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb980aa1-65a4-4e90-aacb-fc07a563b5f7_500x500.png&quot;,&quot;uuid&quot;:&quot;f3b6d57b-5a60-4cf2-9414-025618177540&quot;}" data-component-name="MentionToDOM"></span> wrote a great piece on the higher level of influence L5s generally have here:</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:135419260,&quot;url&quot;:&quot;https://www.developing.dev/p/faang-career-ladder-mid-level-l4&quot;,&quot;publication_id&quot;:1340878,&quot;publication_name&quot;:&quot;The Developing Dev&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb980aa1-65a4-4e90-aacb-fc07a563b5f7_500x500.png&quot;,&quot;title&quot;:&quot;FAANG Career Ladder: Mid-level (L4) vs Senior (L5)&quot;,&quot;truncated_body_text&quot;:&quot;&#128075; Hi, this is Ryan with this week&#8217;s newsletter. I write about software engineering, big tech/startups and career growth. Since last week&#8217;s article was well-received, we&#8217;ll continue our &#8220;FAANG Career Ladder&#8221; series, comparing IC levels from Junior (L3) to Principal (L8) at FAANG-like companies.&quot;,&quot;date&quot;:&quot;2023-07-28T13:00:19.979Z&quot;,&quot;like_count&quot;:95,&quot;comment_count&quot;:6,&quot;bylines&quot;:[{&quot;id&quot;:38830210,&quot;name&quot;:&quot;Ryan Peterman&quot;,&quot;handle&quot;:&quot;ryanlpeterman&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f314b5-e648-438c-87ae-94017be476b4_400x400.jpeg&quot;,&quot;bio&quot;:&quot;Staff software engineer @instagram helping close the gap for engineers without mentors. Writing about software engineering &amp; career growth.&quot;,&quot;profile_set_up_at&quot;:&quot;2023-01-18T22:33:03.111Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1301048,&quot;user_id&quot;:38830210,&quot;publication_id&quot;:1340878,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1340878,&quot;name&quot;:&quot;The Developing Dev&quot;,&quot;subdomain&quot;:&quot;ryanlpeterman&quot;,&quot;custom_domain&quot;:&quot;www.developing.dev&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Filling the gaps for engineers who don&#8217;t have dedicated mentorship in 5 minutes or less. Written by a Staff Software Engineer @ Instagram\n\n&quot;,&quot;logo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb980aa1-65a4-4e90-aacb-fc07a563b5f7_500x500.png&quot;,&quot;author_id&quot;:38830210,&quot;theme_var_background_pop&quot;:&quot;#FF5CD7&quot;,&quot;created_at&quot;:&quot;2023-01-24T07:51:25.087Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Ryan Peterman&quot;,&quot;copyright&quot;:&quot;Ryan Peterman&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;disabled&quot;,&quot;language&quot;:null,&quot;explicit&quot;:false,&quot;is_personal_mode&quot;:false}}],&quot;twitter_screen_name&quot;:&quot;ryanlpeterman&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.developing.dev/p/faang-career-ladder-mid-level-l4?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!bzfD!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb980aa1-65a4-4e90-aacb-fc07a563b5f7_500x500.png" loading="lazy"><span class="embedded-post-publication-name">The Developing Dev</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">FAANG Career Ladder: Mid-level (L4) vs Senior (L5)</div></div><div class="embedded-post-body">&#128075; Hi, this is Ryan with this week&#8217;s newsletter. I write about software engineering, big tech/startups and career growth. Since last week&#8217;s article was well-received, we&#8217;ll continue our &#8220;FAANG Career Ladder&#8221; series, comparing IC levels from Junior (L3) to Principal (L8) at FAANG-like companies&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; 95 likes &#183; 6 comments &#183; Ryan Peterman</div></a></div><p> <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Jordan Cutler&quot;,&quot;id&quot;:58854493,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fe86d99-af64-4285-b982-9466a4c58d63_1311x1312.jpeg&quot;,&quot;uuid&quot;:&quot;48944d54-8578-42cf-8e48-582c86a6fc8e&quot;}" data-component-name="MentionToDOM"></span> from <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;High Growth Engineer&quot;,&quot;id&quot;:1504485,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/highgrowthengineer&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4028d22-8549-42cb-831c-e75539af15f9_1280x1280.png&quot;,&quot;uuid&quot;:&quot;1671a94c-b877-429d-98cf-6ee5097f0e5e&quot;}" data-component-name="MentionToDOM"></span> also wrote a great piece about getting to Senior Engineer: </p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:112248456,&quot;url&quot;:&quot;https://read.highgrowthengineer.com/p/going-from-junior-senior-engineer&quot;,&quot;publication_id&quot;:1504485,&quot;publication_name&quot;:&quot;High Growth Engineer&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4028d22-8549-42cb-831c-e75539af15f9_1280x1280.png&quot;,&quot;title&quot;:&quot;Fast-track your career: From Junior -> Senior engineer in 2 years&quot;,&quot;truncated_body_text&quot;:&quot;Hi everyone, Jordan here. In this issue, you&#8217;ll learn a wealth of actions you can do right now to grow in your career, regardless of your level. By doing these things, I was able to go from an L1 (Junior Engineer) at Gusto to L3 (Senior Engineer) through 2 back-to-back promotions.&quot;,&quot;date&quot;:&quot;2023-04-02T20:55:57.264Z&quot;,&quot;like_count&quot;:184,&quot;comment_count&quot;:34,&quot;bylines&quot;:[{&quot;id&quot;:58854493,&quot;name&quot;:&quot;Jordan Cutler&quot;,&quot;handle&quot;:&quot;jordancutler&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fe86d99-af64-4285-b982-9466a4c58d63_1311x1312.jpeg&quot;,&quot;bio&quot;:&quot;Senior Software Engineer helping engineers fast-track their career with real-world advice.\n\nAuthor of High Growth Engineer newsletter (50k+ subscribers): https://careercutler.substack.com/&quot;,&quot;profile_set_up_at&quot;:&quot;2023-03-18T21:18:20.168Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1471686,&quot;user_id&quot;:58854493,&quot;publication_id&quot;:1504485,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1504485,&quot;name&quot;:&quot;High Growth Engineer&quot;,&quot;subdomain&quot;:&quot;highgrowthengineer&quot;,&quot;custom_domain&quot;:&quot;read.highgrowthengineer.com&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Grow faster in your software engineering career with weekly actionable tips you can use right away. &quot;,&quot;logo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4028d22-8549-42cb-831c-e75539af15f9_1280x1280.png&quot;,&quot;author_id&quot;:58854493,&quot;theme_var_background_pop&quot;:&quot;#2EE240&quot;,&quot;created_at&quot;:&quot;2023-03-18T21:18:26.979Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Jordan Cutler from High Growth Engineer&quot;,&quot;copyright&quot;:&quot;Jordan Cutler&quot;,&quot;founding_plan_name&quot;:&quot;Lifetime &#10084;&#65039;&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;,&quot;language&quot;:null,&quot;explicit&quot;:false,&quot;is_personal_mode&quot;:false}}],&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://read.highgrowthengineer.com/p/going-from-junior-senior-engineer?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!4pvu!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4028d22-8549-42cb-831c-e75539af15f9_1280x1280.png" loading="lazy"><span class="embedded-post-publication-name">High Growth Engineer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Fast-track your career: From Junior -&gt; Senior engineer in 2 years</div></div><div class="embedded-post-body">Hi everyone, Jordan here. In this issue, you&#8217;ll learn a wealth of actions you can do right now to grow in your career, regardless of your level. By doing these things, I was able to go from an L1 (Junior Engineer) at Gusto to L3 (Senior Engineer) through 2 back-to-back promotions&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; 184 likes &#183; 34 comments &#183; Jordan Cutler</div></a></div>]]></content:encoded></item><item><title><![CDATA[4 Software Design Principles I Learned the Hard Way]]></title><description><![CDATA[If there&#8217;s two sources of truth, one is probably wrong. And yes, please repeat yourself.]]></description><link>https://read.engineerscodex.com/p/4-software-design-principles-i-learned</link><guid isPermaLink="false">https://read.engineerscodex.com/p/4-software-design-principles-i-learned</guid><pubDate>Mon, 22 Apr 2024 19:03:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2baa3ff-3727-4dfa-a5c0-1b6f00b16d14_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>I recently built and designed a massive service that (finally) launched successfully last month. During the design and implementation process, I found that the following list of &#8220;rules&#8221; kept coming back up over and over in various scenarios. </p><p>These rules are common enough that I daresay that at least one of them will be useful for a project that any software engineers reading this are <em>currently</em> working on. But if you can&#8217;t apply it directly now, I hope that these principles are a useful thought exercise that you are free to comment on below or challenge directly too.</p><p>One thing I will note here is that of course - each &#8220;principle&#8221; has a time and place. Nuance is necessary, as always. These are conclusions that I find myself erring towards <em>in general</em> because oftentimes, <em>the opposite that is the default</em> that I see when I&#8217;m reviewing code or reading design docs.</p><div><hr></div><h2><strong>1. Maintain one source of truth.</strong></h2><p>If there&#8217;s two sources of truth, one is probably wrong. If it&#8217;s not wrong, it&#8217;s not wrong&#8230; yet.&nbsp;</p><p>Basically, if you&#8217;re trying to maintain a piece of state in two different locations within the same service&#8230; just don&#8217;t. It&#8217;s better to try to just reference the same state wherever you can. For example, if you&#8217;re maintaining a frontend application and have a bank balance that is from the server, I&#8217;ve seen enough sync bugs in my time that I always want to get that balance from the server. If there is some balance that is derived from that, such as &#8220;spendable balance&#8221; versus &#8220;total&#8221; (for example, some banks make you keep a minimum balance), then that &#8220;spendable balance&#8221; should be derived on-the-fly rather than stored separately. Else, you&#8217;ll now have to update both balances whenever a transaction happens.</p><p>In general, if there is a piece of data that is derived from another value, then that value should be derived rather than stored. Storing that value leads to synchronization bugs. (Yes, I know this isn&#8217;t always possible. There will always be other factors in play, like the expense of the derivation. At the end of the day, it&#8217;s a tradeoff.)</p><h2><strong>2. Yes, please repeat yourself.</strong></h2><p>We&#8217;ve heard of DRY (Don&#8217;t Repeat Yourself) and now I present to you PRY (Please Repeat Yourself).</p><p>Far too many times I&#8217;ve seen code that looks <em>mostly</em> the same try to get abstracted out into a &#8220;re-usable&#8221; class. The problem is, this &#8220;re-usable&#8221; class gets one method added to it, then a special constructor, then a few more methods, until it&#8217;s this giant Frankenstein of code that serves multiple different purposes and the original purpose of the abstraction no longer exists.</p><p>A pentagon may be <em>similar-looking</em> to a hexagon, but there is still enough of a difference that they are <em>absolutely not the same</em>.&nbsp;</p><p>I&#8217;m also guilty of spending way too much time trying to make things reusable, when a bit of code duplication works perfectly fine. (Yes, you have to write more tests and it doesn&#8217;t scratch the &#8220;refactoring&#8221; itch, but oh well.)</p><h2><strong>3. Don&#8217;t overuse mocks.</strong></h2><p>Mocks. I have a love-hate relationship with mocks. My favorite one-liner from a <a href="https://www.reddit.com/r/programming/comments/1cckf07/comment/l1b66ok/">Reddit</a> discussion about this post was &#8220;with mocks, we sell test fidelity for ease of testing.&#8221;</p><p>Mocks are great when I have to write unit tests to test something quickly and don&#8217;t want to mess with &#8220;prod-level&#8221; code. Mocks are not great when prod breaks because as it turns out - something you mocked broke deeper down the stack, even though that &#8220;deeper down the stack&#8221; is owned by another team. It doesn&#8217;t matter because it was your service that broke so it's your responsibility to fix it.</p><p>Writing tests is hard. The line between unit tests and integration tests is blurrier than you think. Knowing what to mock and not mock is subjective.</p><p>It&#8217;s much nicer to find things while developing rather than in prod. As I continue writing software, I try to stay away from mocks if possible. Tests being a bit more heavyweight is completely worthwhile when it comes to a much higher reliability. If mocks are really required by my code reviewer, I&#8217;d rather write more (and maybe even redundant) tests rather than skip out on tests. Even if I can&#8217;t use a real dependency in a test, I will still try to use other options first before mocks, like a local server.</p><p><a href="https://testing.googleblog.com/2013/05/testing-on-toilet-dont-overuse-mocks.html">Google&#8217;s &#8220;Testing on the Toilet&#8221; has a good note on this from 2013.</a> They note that overusing mocks causes:</p><ul><li><p>Tests can be harder to understand because now you have this extra code someone has to understand along with the actual production code.</p></li></ul><ul><li><p>Tests can be harder to maintain because you have to tell a mock how to behave, which means you leak implementation details into your test.</p></li></ul><ul><li><p>Tests overall provide less assurance now because the reliability of your software now is only guaranteed IF your mocks behave exactly like your real implementations (which is hard to guarantee and often ends up out of sync).</p></li></ul><h2><strong>4. Minimize mutable state.</strong></h2><p>Computers are VERY fast. In the optimization game, it&#8217;s super popular to instantly throw caching and store everything in a database immediately. I think this is probably the <em>end state</em> of most successful software products and services. Of course, most services will need some sort of state, but it&#8217;s important to figure out what is truly necessary storage-wise versus what can be derived on-the-fly.&nbsp;</p><p>In the &#8220;v1&#8221; of something, I&#8217;ve found that minimizing as much mutable state as possible gets you pretty far. It lets you develop faster because you don&#8217;t have to worry about sync bugs, conflicting data, and stale state. It also lets you develop functionality piece-by-piece, rather than introducing too much at once. Machines are fast enough today where doing a few redundant calculations is totally fine. If machines are supposedly &#8220;replacing us&#8221; soon, then they can handle a few extra work units of calculations.</p>]]></content:encoded></item><item><title><![CDATA[Meta's new LLM-based test generator is a sneak peek to the future of development]]></title><description><![CDATA[Meta's TestGen-LLM is a sneak peek to the future of developer productivity: specialized, orchestrated, and rigorously filtered.]]></description><link>https://read.engineerscodex.com/p/metas-new-llm-based-test-generator</link><guid isPermaLink="false">https://read.engineerscodex.com/p/metas-new-llm-based-test-generator</guid><pubDate>Fri, 23 Feb 2024 07:34:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Meta recently released a <a href="https://arxiv.org/abs/2402.09171">paper called &#8220;Automated Unit Test Improvement using Large Language Models at Meta&#8221;</a>. </p><p>A major win of this paper is that while it integrates LLMs into a developer&#8217;s workflow, it also recommends fully-formed software improvements that are verified to be both correct and an improvement to current code coverage. This is <strong>not a magic pill, but it&#8217;s a good start on making LLMs more useful</strong>. Compare this to ChatGPT, where suggestions still have to be manually verified to work - and we all know that <a href="https://read.engineerscodex.com/p/clever-code-is-probably-the-worst">debugging code is twice as hard as writing it</a>.</p><p>Meta claims that &#8220;this is the first paper to report on LLM-generated code that has been developed independent of human intervention (other than final review sign off), and landed into large scale industrial production systems with guaranteed assurances for improvement over the existing code base.&#8221; (Bleh! That was a mouthful.)</p><p>Furthermore, there are solid principles that developers can take away in order to use AI effectively themselves.</p><p><strong>Table of Contents:</strong></p><ul><li><p>Key Points</p></li><li><p>Stats</p></li><li><p>Actionable Takeaways <strong>&#8592;</strong> <strong>if you&#8217;re short on time, just read this!</strong></p></li><li><p>How TestGen-LLM Works</p></li></ul><div><hr></div><h2><strong>Key Points</strong></h2><p>TestGen-LLM uses an approach called &#8216;Assured LLM-based Software Engineering&#8217; (Assured LLMSE), using private, internal LLMs that are probably fine-tuned with Meta&#8217;s codebase. This means that it uses LLMs to generate code improvements that are backed by &#8220;<strong>verifiable guarantees&#8221;of improvement and non-regression.</strong></p><p>TestGen-LLM uses an <strong>ensemble approach </strong>to generate code improvements. This means that it uses<strong> &#8220;LLMs, prompts, and hyper-parameters&#8221;</strong> to generate a set of candidate improvements, and then selects the best one. This approach can help to improve the quality of the generated improvements.</p><p>TestGen-LLM is specifically designed to <strong>improve existing human-written tests</strong> rather than <strong>generate code from scratch</strong>.&nbsp;A good way to think about this LLM is: it's a junior dev with the task of creating more comprehensive tests for existing code. Other devs have more important things to work on, so this LLM gets the fun task of improving unit tests.</p><p>The tests that it creates in its pull requests are often good, and sometimes trivial or pointless. Occasionally, a test it produces is really good or uncovers a bug inadvertently. Regardless, this work wouldn't have been done by humans anyways due to priorities. All of its pull requests require a human reviewer before pushed into the codebase.</p><p>TestGen-LLM has been <strong>integrated into Meta's software engineering workflows</strong>. This means that it can be used to automatically improve tests as part of the development process. It would be cool to see some screenshots of how exactly it&#8217;s integrated, but the paper doesn&#8217;t provide any.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e8Ou!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e8Ou!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 424w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 848w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 1272w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e8Ou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png" width="509" height="392" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:392,&quot;width&quot;:509,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69482,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e8Ou!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 424w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 848w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 1272w, https://substackcdn.com/image/fetch/$s_!e8Ou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fede031af-5c1f-4aa5-95f0-3be17221cb7c_509x392.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://arxiv.org/abs/2402.09171">Source</a>: Page 5</figcaption></figure></div><h2>Stats</h2><p>These stats are either direct quotes or paraphrased quotes from the paper. A short reminder that all tests that were landed required a final sign-off by human reviewers. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jp5n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jp5n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 424w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 848w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 1272w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jp5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png" width="471" height="410.90994371482174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:465,&quot;width&quot;:533,&quot;resizeWidth&quot;:471,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jp5n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 424w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 848w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 1272w, https://substackcdn.com/image/fetch/$s_!jp5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a8257b1-bce4-41e3-b88b-42e7d71bcc7b_533x465.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>The image above shows that: in an evaluation on Reels and Stories products for Instagram, 75% of TestGen-LLM test cases that were generated built correctly, 57% passed reliably, and <em>25% increased coverage</em>.</p></li><li><p>TestGen-LLM was able to improve <strong>10% of all classes to which it was applied and 73% of its test improvements were accepted by developers</strong>, and landed into production.</p></li><li><p>In a &#8220;test-a-thon&#8221; between engineers, where various Meta engineers created tests in order to increase Instagram&#8217;s test coverage, &#8220;<strong>the median number of lines of code added by a TestGen-LLM test was 2.5</strong>.&#8221;</p></li><li><p>However, one test case &#8220;hit the jackpot&#8221; and covered 1,326 lines. </p></li><li><p>All improved cases generated during the &#8220;test-a-thon&#8221; did &#8220;cover at least one additional valid corner case, such as an early return and/or special processing for special values such as null and empty list.&#8221;</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wmPR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wmPR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 424w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 848w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 1272w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wmPR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png" width="1040" height="355" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:355,&quot;width&quot;:1040,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wmPR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 424w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 848w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 1272w, https://substackcdn.com/image/fetch/$s_!wmPR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dbd5133-fdad-4164-a653-59ef1fcce406_1040x355.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://arxiv.org/abs/2308.11148">Source: Page 7</a></figcaption></figure></div><h2><strong>Actionable Takeaways</strong></h2><p><strong>TestGen-LLM is a good example of how LLMs can be used to improve dev productivity and software reliability in a time-efficient manner.</strong> (Note: many of these are my own personal opinions that I&#8217;ve taken away from the paper.)</p><h4>Incremental, integrated improvements for specialized use cases</h4><p>Small context windows and scattered dependencies make LLMs nearly unusable for non-boilerplate solutions in large codebases. Aside from any privacy concerns, it&#8217;s not feasible to paste in multiple files of code into an LLM when there could be 20+ dependencies from across a codebase in a C++ header file (as an example). Even if you do paste in multiple files, there is a time and cognitive cost to actually using and trying the code outputted by an LLM in a chat window or even in the code editor by GitHub Copilot.</p><p>The price of extra cognitive load cannot be understated. <a href="https://news.ycombinator.com/item?id=39460788">Hacker News commenters find the inaccuracies of GPT-based tooling exhausting and unreliable.</a> This is where the <strong>verification of outputs being both valid and non-regressive is extremely important. </strong>Each test by TestGen-LLM requires a human sign-off anyways, so any programmatic guarantees are useful here.</p><p>This means that for a long-term productivity boost in large codebases,<strong> improvements will probably come in incremental, specialized use cases</strong>, like test generation and <a href="https://blog.research.google/2023/05/resolving-code-review-comments-with-ml.html">automatic suggestions during code reviews</a>. These are also low risk ways to save cumulative developer time. Basically, &#8220;GPT wrappers&#8221; will continue to be useful &#128578;.</p><h4>Finding and catching edge cases</h4><p><strong>The real value of LLMs here are displayed through the edge cases</strong>. The paradox of writing good code is that <a href="https://web.mit.edu/nelsonr/www/Repenning=Sterman_CMR_su01_.pdf">nobody ever gets credit for fixing problems that never happened</a>.</p><p><a href="https://antithesis.com/blog/is_something_bugging_you/">Will Wilson writes</a>:</p><blockquote><p><em>&#8220;The fundamental problem of software testing&#8230; is that software has to handle many situations that the developer has never thought of or will never anticipate. This limits the value of testing, because if you had the foresight to write a test for a particular case, then you probably had the foresight to make the code handle that case too. This makes conventional testing great for catching regressions, but really terrible at catching all the &#8220;unknown unknowns&#8221; that life, the universe, and your endlessly creative users will throw at you.&#8221;</em></p></blockquote><p><strong>LLMs can&#8217;t really &#8220;think outside the box&#8221; because they only really know their training data. However, their box can be larger than a human&#8217;s, so they have the potential to think about cases that a human might miss.</strong></p><p>Most of the test cases created by Meta&#8217;s TestGen-LLM only covered an extra 2.5 lines. However, one test case covered 1326 lines! There are two ways to think about this case:</p><ul><li><p>The optimistic case is that the LLM possibly caught an important edge case that was missed by humans when testing.</p></li><li><p>The more realistic case is that the LLM caught a codepath that was just missed altogether, rather than catching an edge case.</p></li></ul><p><strong>More code coverage != better code</strong>. We don&#8217;t want to use lines covered as a chaseable metric, though it would be any bad engineering manager&#8217;s dream. More code coverage is gameable, but the downsides of rote coverage created by LLMs is that bugs are also codified, which means they can go unnoticed until they appear in production.</p><p>The value here is mostly bringing edge cases that lie outside of the developer&#8217;s immediate context, but still within the LLM&#8217;s training data, to the developer&#8217;s attention.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gbB1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gbB1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 424w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 848w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 1272w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gbB1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png" width="363" height="315.95896328293736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:463,&quot;resizeWidth&quot;:363,&quot;bytes&quot;:21667,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gbB1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 424w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 848w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 1272w, https://substackcdn.com/image/fetch/$s_!gbB1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb67eb123-47a1-4c00-a18f-3469345e65c2_463x403.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Blue Box signifies the space where LLMs can come in handy.</figcaption></figure></div><p>Like I mentioned earlier, a good way to think about this LLM is that it's a junior dev with the task of creating more comprehensive tests for existing code. <strong>LLMs may not generate perfect code on the first try, but it at least provides options that otherwise may not have been thought of. </strong>Other devs have more important things to work on, so this LLM gets the fun task of improving unit tests. The tests that it creates in its pull requests are often good, and sometimes trivial or pointless. Occasionally, a test it produces is really good or uncovers a bug inadvertently. </p><p>In fact, it&#8217;s so high that the creator of FoundationDB&#8217;s startup, <a href="https://antithesis.com/">Antithesis</a>, is entirely based on the fact that software testing edge cases are best found by continuously searching software for problems. <a href="https://read.engineerscodex.com/p/how-apple-built-icloud-to-store-billions">For reference, FoundationDB was acquired by Apple and is the basis for Apple iCloud&#8217;s billions of databases.</a></p><h4>Orchestration, pipelines, and processing are required</h4><p>Base model LLMs aren&#8217;t &#8220;plug-n-play" and shouldn&#8217;t reasonably ever be expected to. Sure, they might output pristine React and Tailwind CSS code, but that&#8217;s a narrow use case in most production codebases. They need a fair amount of processing and filtering for code generation tasks that require correctness. Part of this processing means grounding LLMs with examples. Google and Meta both make <strong>suggestions based on existing code</strong>, where the results are much, much better than raw generation.<strong> </strong>LLMs used in production should take ideas from how Meta processes and filters LLM outputs, and most outputs should be expected to be discarded.</p><h4>Integrations win</h4><p>LLMs do work best integrated into workflows. This is a reason why GitHub Copilot is so popular and another reason why Google&#8217;s Workspace integrations are a great idea. Asking a chatbot works great for certain use cases, like boilerplate code generation, but chatbots can often fail at more complex use cases.</p><h2><strong>How TestGen-LLM Works</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QPwW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QPwW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 424w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 848w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 1272w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QPwW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png" width="1456" height="379" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:379,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QPwW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 424w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 848w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 1272w, https://substackcdn.com/image/fetch/$s_!QPwW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F105bb1eb-0ad0-4555-8721-58714b76bcdf_1600x416.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>TestGen-LLM applies a series of semantic filters to candidate solutions generated by Meta&#8217;s internal LLMs, making sure that only the most valuable tests are preserved. Here&#8217;s how it works:</p><p><strong>Filter 1: Buildability:</strong> Initially, TestGen-LLM checks if the generated code can be built within the app's existing infrastructure. Any code that fails to build is immediately discarded.</p><p><strong>Filter 2: Execution (does the test pass?): </strong>Next, the system runs the tests that passed the buildability filter. Any test that doesn't pass is discarded. This step is crucial because, without a way to automatically determine the validity of a failing test (whether it's due to a bug or an incorrect assertion), TestGen-LLM opts to keep only those tests that can be used for regression testing (aka making sure they can protect current code against future regressions).&nbsp;</p><p><strong>Filter 3: Flakiness:</strong> To address the issue of <a href="https://www.swequiz.com/learn/what-are-flaky-tests">flakiness</a> (tests that pass or fail inconsistently under the same conditions), TestGen-LLM employs repeated execution. A test must pass consistently across multiple (five) executions to be considered non-flaky.</p><p><strong>Filter 3: Coverage Improvement:</strong> Finally, to ensure that new tests actually add value, TestGen-LLM evaluates them for their contribution to test coverage. Tests that do not enhance coverage by exploring new code paths or conditions are discarded. Only tests that provide new insights or protect against regressions are kept.</p><p>These processing filters are pretty important as they guarantee improvements to a test suite. It also shows that LLMs are very far from being &#8220;plug-and-play.&#8221; </p><p>The tests that successfully pass through all these filters are guaranteed to enhance the existing test suite, offering reliable regression testing capabilities without duplicating effort or wasting resources. Pre- and post-processing steps in TestGen-LLM facilitate the extraction and reconstruction of test classes, streamlining the integration of new tests into the software development workflow.</p><h2>Conclusion</h2><p>This paper is a good formalization of an use case that many devs probably already use LLMs like ChatGPT, Gemini, and Mistral/LLaMA for. Keeping it in writing is a good way of tracking the progress of future improvements on LLMs in the software reliability space. So far, we see that LLMs work best as an extension of the human, best thought of as a junior dev that needs assistance and prodding. As time goes on, we&#8217;ll definitely see LLMs be able to catch and test for bugs in increasingly complex software systems.</p><p>The question is - will that make software easier to develop in the long run or will it lead to a proliferation of software complexity in the future?</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>If you want to read more about complex real-world software engineering explained simply, consider subscribing to Engineer&#8217;s Codex.    It&#8217;s free :)</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[How Apple built iCloud to store billions of databases]]></title><description><![CDATA[Apple uses Cassandra and FoundationDB for CloudKit, their cloud backend service. We take a look into how exactly each is used within their cloud and the problems they've solved.]]></description><link>https://read.engineerscodex.com/p/how-apple-built-icloud-to-store-billions</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-apple-built-icloud-to-store-billions</guid><pubDate>Sun, 14 Jan 2024 21:53:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication distilling real-world software engineering.</em></p><p><em>Author&#8217;s Note: These are my personal notes on publicly available papers regarding iCloud. All sources are linked at the bottom.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Throughout the last few months, I&#8217;ve written about various tech &#8220;behind-the-scenes&#8221; in Big Tech, such as <a href="https://engineercodex.substack.com/p/meta-xfaas-serverless-functions-explained">Meta's internal serverless platform</a>, that we are lucky to see written about publicly.</p><p>Apple, on the other hand, is not as public with their infrastructure. I wanted to find out how Apple built iCloud and in this article, I cover everything I know.</p><p><strong>Apple uses <a href="https://www.foundationdb.org/">FoundationDB</a> and Cassandra for iCloud and CloudKit, their cloud backend service.</strong> And yes, the title is not incorrect: Apple really does store <strong>billions of databases in their extreme multi-tenant architecture.</strong> </p><h1>Timeless Real-World Lessons</h1><p>Before reading, these are the <strong>applicable lessons and guidelines. </strong></p><p>I found that a lot of the lessons from the paper and from Apple track very closely to the lessons of <a href="https://read.engineerscodex.com/p/meta-xfaas-serverless-functions-explained">Meta&#8217;s architecture of their serverless platform.</a></p><ul><li><p>Both use <strong>asynchronous processing </strong>smartly in order to make user functionalities smoother. Meta uses their serverless stack for non-user-facing functions. Apple uses async processing for almost <em>all </em>of the Record Layer&#8217;s functionalities (explained in-depth down below) in order to <em>hide latency from the user</em>.</p></li><li><p>Both utilize <strong>stateless architecture </strong>liberally, knowing that they have intense scalability needs.</p></li><li><p>Both <strong>isolate resources logically</strong> for reliability and availability.</p></li><li><p>Both <strong>handle diverse ranges of needs simply</strong>. Apple mentions how it&#8217;s &#8220;tempting</p><p>to provision and operate separate systems to store &#8216;small data&#8217; and &#8216;big data.&#8217;&#8221; However, this increases operational complexity, and instead, they handle all types of data needs with one abstraction. Meta does the same with their serverless platform providing one abstraction for all kinds of function loads.</p></li><li><p>Both <strong>build layers of abstractions</strong> in order to make the developer experience better. Application developers shouldn&#8217;t have to worry about scalability needs - that&#8217;s handled deeper down the stack by distributed system engineers.</p></li><li><p><strong>Know your user. </strong>Each layer, API, and design decision provided by Meta and Apple is guided by clear knowledge on who the user of the specific technology is, whether it be an application development team or an observability team.</p></li></ul><div><hr></div><h1><strong>Cassandra</strong></h1><p><a href="https://cassandra.apache.org/_/index.html">Cassandra</a> is a wide-column NoSQL database management system. It was originally developed at Facebook to power the Facebook inbox search feature. Interestingly, Meta themselves have replaced much of their Cassandra usage with <a href="https://engineering.fb.com/2021/08/06/core-infra/zippydb/">ZippyDB</a> instead.</p><p>iCloud is partly powered by Cassandra. Apple runs one of the largest Cassandra deployments in the world, <a href="https://news.ycombinator.com/item?id=9307563">according to DataStax</a>. </p><p><a href="https://twitter.com/erickramirezau/status/1578063811495477248">They report</a>:</p><ul><li><p>Over 300k instances/nodes</p></li><li><p>Hundreds of petabytes of data (if not exabytes)</p></li><li><p>Over 2 PB per cluster, with thousands of clusters</p></li><li><p>Millions of queries per second</p></li><li><p>Thousands of applications</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lqv9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lqv9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lqv9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png" width="514" height="289.125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:514,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Apache Cassandra at Apple\nScale and Scope\n\n- Over three hundred thousand instances\n- Hundreds of petabytes of data\n- Over two petabytes per cluster\n- Millions of queries per second\n- Thousands of clusters\n- Thousands of applications&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Apache Cassandra at Apple
Scale and Scope

- Over three hundred thousand instances
- Hundreds of petabytes of data
- Over two petabytes per cluster
- Millions of queries per second
- Thousands of clusters
- Thousands of applications" title="Apache Cassandra at Apple
Scale and Scope

- Over three hundred thousand instances
- Hundreds of petabytes of data
- Over two petabytes per cluster
- Millions of queries per second
- Thousands of clusters
- Thousands of applications" srcset="https://substackcdn.com/image/fetch/$s_!Lqv9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!Lqv9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04555898-3133-4b9f-a1e4-063ef4cebbb5_1600x900.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/erickramirezau/status/1578063811495477248">Source</a></figcaption></figure></div><p>Other snippets of Cassandra in iCloud show that there are <strong>exabytes of data under management</strong>. <a href="https://news.ycombinator.com/item?id=33124631#33136026">There are </a><strong><a href="https://news.ycombinator.com/item?id=33124631#33136026">multiple Cassandra nodes per server</a></strong><a href="https://news.ycombinator.com/item?id=33124631#33136026">, and the teams at Apple are smart about blast radius and sharding</a>. This makes sure iCloud data availability is near 100%.</p><p>Cassandra is still actively improved upon at Apple. Scott Andreas of Apple gave a talk about the <a href="https://www.youtube.com/watch?v=hUxLJSFi2-A">future of Cassandra last month.</a> On Apple&#8217;s jobs page, they commonly mention Cassandra when hiring for distributed systems engineers.</p><p><strong>However, <a href="https://developer.apple.com/icloud/cloudkit/">CloudKit</a> + Cassandra ran into two scalability limitations, which led to their adoption of FoundationDB.</strong></p><ol><li><p>Within a single zone, <strong>only one operation can happen at a time</strong>, even if different records are being edited. This can be problematic for apps where multiple users or devices need to work on shared data simultaneously.</p></li><li><p>When updating multiple records simultaneously in an atomic operation, the updates are limited to a single Cassandra partition. <strong>These partitions have a maximum size they can handle, and as a partition's size increases, Cassandra tends to slow down.</strong></p></li></ol><p><strong>FoundationDB and the Record Layer solved both of these issues.</strong></p><h1><strong>FoundationDB</strong></h1><p>Apple is much more public about FoundationDB. They <a href="https://techcrunch.com/2015/03/24/apple-acquires-durable-database-company-foundationdb/">acquired FoundationDB in 2015</a> and have since published various papers detailing their use of FoundationDB.</p><p><a href="https://github.com/apple/foundationdb">FoundationDB</a> is an open-source, distributed, transactional key-value store. It&#8217;s designed to handle large volumes of data and works well for both read/write workloads and write-heavy workloads. It&#8217;s also <a href="https://www.swequiz.com/learn/acid-properties">ACID-compliant</a>.&nbsp;</p><p>Apple uses the <strong><a href="https://github.com/FoundationDB/fdb-record-layer">FoundationDB Record Layer</a></strong> extensively for CloudKit (Apple&#8217;s cloud backend service).&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!re8_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!re8_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 424w, https://substackcdn.com/image/fetch/$s_!re8_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 848w, https://substackcdn.com/image/fetch/$s_!re8_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 1272w, https://substackcdn.com/image/fetch/$s_!re8_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!re8_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png" width="652" height="364.80224929709465" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:597,&quot;width&quot;:1067,&quot;resizeWidth&quot;:652,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!re8_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 424w, https://substackcdn.com/image/fetch/$s_!re8_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 848w, https://substackcdn.com/image/fetch/$s_!re8_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 1272w, https://substackcdn.com/image/fetch/$s_!re8_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253bccde-92f5-44bc-a936-0c8e15cdd86f_1067x597.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://www.youtube.com/watch?v=HLE8chgw6LI">FoundationDB Record Layer: Open Source Structured Storage</a></figcaption></figure></div><p>From their <a href="https://github.com/FoundationDB/fdb-record-layer">GitHub</a>:</p><blockquote><p>The Record Layer is a Java API providing a record-oriented store on top of FoundationDB, (very) roughly equivalent to a simple relational database, featuring:</p><ul><li><p><strong>Structured types </strong>- Records are defined and stored in terms of <a href="https://developers.google.com/protocol-buffers/">protobuf</a> (Protocol Buffer) messages. Protocol Buffers were first designed by Google.</p></li><li><p><strong>Indexes</strong> - The Record Layer supports a variety of different index types including value indexes (the kind provided by most databases), rank indexes, and aggregate indexes. Indexes and primary keys can be defined either via protobuf options or programmatically.</p></li><li><p><strong>Complex types</strong> - Support for complex types, such as lists and nested records, including the ability to define indexes against such nested structures.</p></li><li><p><strong>Queries</strong> - The Record Layer does not provide a query language, however it provides query APIs with the ability to scan, filter, and sort across one or more record types, and a query planner capable of automatic selection of indexes.</p></li><li><p><strong>Many record stores, shared schema</strong> - The Record Layer provides the ability to support many discrete record store instances, all with a shared (and evolving) schema. For example, rather than modeling a single database in which to store all users' data, each user can be given their own record store, perhaps sharded across different FDB cluster instances.</p></li><li><p><strong>Very light weight </strong>- The Record layer is designed to be used in a large, distributed, stateless environment. The time between opening a store and the first query is intended to be measured in milliseconds.</p></li><li><p><strong>Extensible</strong> - New index types and custom index key expressions may be dynamically incorporated into a record store.</p></li></ul></blockquote><p>From the <a href="https://www.foundationdb.org/files/record-layer-paper.pdf">FoundationDB Record Layer</a> paper, they write:</p><blockquote><p>&#8220;[FoundationDB Record Layer is used] to provide powerful abstractions to applications serving <strong>hundreds of millions of users</strong>. CloudKit uses the Record Layer to host <strong>billions of independent databases</strong>, many with a common schema.&#8221;</p></blockquote><h2><strong>Why is the FoundationDB Record Layer used?</strong></h2><p>The structure of FoundationDB, Record Layer, and CloudKit looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-xEP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-xEP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 424w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 848w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 1272w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-xEP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png" width="819" height="337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:337,&quot;width&quot;:819,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-xEP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 424w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 848w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 1272w, https://substackcdn.com/image/fetch/$s_!-xEP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5804ee-bb8b-4a6e-967c-e3fa3b1daa87_819x337.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://www.youtube.com/watch?v=HLE8chgw6LI">FoundationDB Record Layer: Open Source Structured Storage</a></figcaption></figure></div><ul><li><p><strong>FoundationDB</strong> does all the distributed systems and concurrency control work. </p></li><li><p><strong>The Record Layer</strong> serves as a relational database to make FoundationDB easier to work with. </p></li><li><p><strong>CloudKit</strong> is the highest layer on top and provides features and APIs for application developers. CloudKit isn&#8217;t the only thing built on top of the Record Layer, but there are also other layers on top built internally for things that need structured storage, like a JSON document store.</p></li></ul><p><strong>The Record Layer allows Apple to support multi-tenancy at scale.&nbsp;</strong></p><p>Actually, that&#8217;s somewhat underselling it.</p><p>The Record Layer is used for <strong>extreme multi-tenancy, where each user of each application gets independent record stores. This means the Record Layer hosts billions of independent databases sharing thousands of schemata.</strong></p><p>That&#8217;s better! And much, much more impressive.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EPUK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EPUK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 424w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 848w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 1272w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EPUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png" width="1035" height="466" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:466,&quot;width&quot;:1035,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EPUK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 424w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 848w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 1272w, https://substackcdn.com/image/fetch/$s_!EPUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1a4fb06-dafc-43d3-808c-31e5f56d5f21_1035x466.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://www.youtube.com/watch?v=HLE8chgw6LI">FoundationDB Record Layer: Open Source Structured Storage</a></figcaption></figure></div><p>The Record Layer is engineered to handle multi-tenancy at such a large scale thanks to two fundamental architectural decisions.&nbsp;</p><ol><li><p>The layer <strong>operates statelessly</strong> allowing for effortless scaling of the compute resources by simply adding more of these stateless instances. </p><ol><li><p>This stateless architecture simplifies the task for load balancers and routers since they only need to focus on the location of the data rather than the capabilities of the compute servers. Additionally, stateless servers have a reduced set of resources to distribute amongst clients.</p></li></ol></li><li><p>The layer uses <strong>record store abstraction to manage resource allocation and scalability</strong> effectively. This abstraction represents the entirety of a logical database, comprising serialized data, indexes, and the operational state. </p><ol><li><p>Each record store is allocated a specific key range, which guarantees logical separation of data for different tenants. Transferring a tenant's data, if necessary, becomes a straightforward process of relocating the assigned key range to a new cluster, as all the information required to manage and use the record store is contained within this range.</p></li></ol></li></ol><h4><strong>This is a good stopping point for a cursory glance of how Apple built iCloud.</strong></h4><h4><strong>For those who are interested in the technical aspects of CloudKit, FoundationDB, and Record Layer, read on. </strong></h4><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>I write about real-world software engineering. If you enjoyed this overview and want to see more, please subscribe!</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>How CloudKit uses FoundationDB and Record Layer</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KIVB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KIVB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 424w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 848w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 1272w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KIVB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png" width="1035" height="424" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:424,&quot;width&quot;:1035,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KIVB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 424w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 848w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 1272w, https://substackcdn.com/image/fetch/$s_!KIVB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5464667d-8ff2-4a05-a1f1-79627a15a79b_1035x424.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://www.foundationdb.org/files/record-layer-paper.pdf">FoundationDB Record Layer: A Multi-Tenant Structured Datastore</a></figcaption></figure></div><p><strong>In CloudKit, an application is represented by a 'logical container' which follows a defined schema.</strong> This schema outlines the necessary record types, fields, and indexes to enable efficient data retrieval and queries. <strong>Applications organize their data into 'zones'</strong> within CloudKit, which allows for grouping records logically for selective synchronization with client devices.</p><p>For each user, CloudKit designates a unique <strong>subspace in FoundationDB</strong>. Within this subspace, it creates a <strong>record store for each application a user interacts with.</strong> In essence, CloudKit manages a massive number of logical databases&#8212;multiplying the number of users by the number of applications&#8212;each containing its own set of records, indexes, and metadata, amounting to <strong>billions of databases.</strong></p><p>When CloudKit receives a request from a client device, it directs this request to an available <strong>CloudKit Service process via load balancing</strong>. This process then interacts with the specific Record Layer record store to fulfill the request.</p><p>CloudKit converts the defined application schema into a <strong>metadata definition within the Record Layer</strong>, which is stored in a separate metadata store. This metadata is augmented by CloudKit-specific system fields that track the <strong>record's creation, modification times, and the zone</strong> where the record is stored. Zone names are prefixed to primary keys to enable efficient access to records within each zone. Alongside indexes defined by the user, CloudKit also manages <strong>'system indexes'</strong> for internal purposes like managing storage quotas by keeping an index that tracks the size of records by their type.</p><p><strong>FoundationDB and the Record Layer together solve 4 key problems for Apple that either Cassandra alone or FoundationDB alone could not.</strong></p><h3><strong>Problem Solved: Personalized full-text search</strong></h3><p>FoundationDB helps solve personalized full-text search for users to quickly access their data.</p><p>Their system utilizes <strong>FoundationDB's key order</strong> to allow for quick searches on text beginnings (<strong>prefix matching</strong>) and also for more complex searches (like finding words that are close together or in a specific order - <strong>proximity and phrase search</strong>) without no extra overhead.</p><p>In traditional search systems, you often need extra processes running in the background to keep the search index up to date, but Apple&#8217;s system does everything in real-time, which means as soon as data changes, the search index is updated instantly&#8212;no extra steps needed.&nbsp;</p><h3><strong>Problem solved: High-concurrency zones</strong></h3><p>With FoundationDB, CloudKit handles many updates happening simultaneously in a smooth way.</p><p>Previously, with Cassandra, CloudKit used to rely on a special index that kept track of changes in each zone to synchronize data across devices. When a device needed to update its data, it would check this index to see what's new. But this system had a drawback: it could cause conflicts when multiple updates happened at the same time.</p><p>But with FoundationDB, CloudKit uses a special kind of index that keeps track of the exact sequence of each change without causing conflicts. This is done by <strong>assigning a unique 'version' to every change, and when CloudKit needs to sync, it looks at these versions to figure out what updates a device has missed.</strong></p><p>However, when CloudKit needs to move data across different storage clusters&#8212;perhaps to distribute the load more evenly&#8212;things get tricky because each cluster has its own version numbers that don't match up. To solve this, CloudKit gives each user's data a 'move count' (called the &#8220;incarnation&#8221;), which increases every time their data is transferred to a new cluster. Each record update includes the user's current &#8220;incarnation&#8221; number, ensuring that even after a move, CloudKit can still figure out the correct order of updates by looking at both the incarnation and version numbers.</p><p>When they switched to this new system, CloudKit faced the challenge of dealing with old data that didn't have these version numbers. They cleverly overcame this by using a special function that sorts old updates using the previous system before the new ones. This meant no complicated changes to the app or leaving behind outdated code. This function took into account the incarnation, version, and the old update-counter values to maintain the correct order of records.</p><h3><strong>Problem solved: High latency queries</strong></h3><p>FoundationDB is designed for high-concurrency, not low latency. This means it can <strong>handle a lot of tasks at the same time rather than focus on the speed of individual tasks.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fkwB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fkwB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 424w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 848w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 1272w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fkwB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png" width="968" height="395" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/104d043c-5a35-4ded-a022-97dd02c71568_968x395.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:395,&quot;width&quot;:968,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fkwB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 424w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 848w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 1272w, https://substackcdn.com/image/fetch/$s_!fkwB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F104d043c-5a35-4ded-a022-97dd02c71568_968x395.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://www.youtube.com/watch?v=HLE8chgw6LI">FoundationDB Record Layer: Open Source Structured Storage</a></figcaption></figure></div><p>To make the most of this design, <strong>the Record Layer does a lot of its work 'asynchronously'</strong>&#8212; it queues up tasks to be completed in the future, allowing for other work to be done in the meantime. This approach helps to cover up any delays that might occur during these tasks.</p><p>However, the tool that FoundationDB uses to communicate with its database is designed to do one thing at a time using a single thread for networking. In earlier versions, this setup caused a traffic jam in the system because everything was waiting for its turn in this network thread. <strong>The Record Layer had been using this single-threaded approach, which led to a bottleneck.</strong></p><p>To improve this, Apple reduced the workload on this network thread. <strong>Now, complex tasks seem faster because the system is working with the database on several fronts at the same time, rather than forming a queue.</strong> This way, the latency, or the apparent slowness, is hidden because the system doesn't wait for one task to finish before starting another.</p><h3><strong>Problem solved: Conflicting transactions</strong></h3><p>In FoundationDB, if one transaction is reading certain keys and another transaction modifies those same keys at the same time, it causes a 'transaction conflict'. <strong>FoundationDB allows precise management of these conflicts by providing control over the sets of keys that can cause these conflicts when read or written to.</strong>&nbsp;</p><p>A common method to avoid unnecessary conflicts is to perform a special kind of read that doesn't cause conflicts, known as a 'snapshot' read, on a range of keys. If this read finds important keys, the transaction will only flag those specific keys for potential conflict, rather than the entire range. This ensures the transaction is only affected by changes that actually matter to its outcome.</p><p>The Record Layer uses this strategy to efficiently manage a structure known as a skip list, which is part of its ranking index system. However, manually setting these conflict ranges can be tricky and can lead to bugs that are difficult to identify, especially when they're mixed in with the main logic of the application. Therefore, <strong>it's recommended that systems built on top of FoundationDB create higher-level tools, like custom indexes, to handle these patterns</strong>. This approach helps to avoid leaving the responsibility to relax conflict rules up to each client application, which could lead to mistakes and inconsistencies.</p><div><hr></div><p>Thanks for reading! If you&#8217;re interested in reading the full FoundationDB Record Layer paper, it&#8217;s here: <a href="https://www.foundationdb.org/files/record-layer-paper.pdf">FoundationDB Record Layer: A Multi-Tenant Structured Datastore</a>.</p><p></p>]]></content:encoded></item><item><title><![CDATA[A simple programming productivity trick: leave work unfinished to reach flow]]></title><description><![CDATA[A breakdown of 4 simple software engineering and coding habits that improved my productivity. These include keyboard shortcuts, learning to say no, reaching flow state faster, and keeping a big book of commands handy.]]></description><link>https://read.engineerscodex.com/p/simple-software-engineering-habits</link><guid isPermaLink="false">https://read.engineerscodex.com/p/simple-software-engineering-habits</guid><pubDate>Fri, 15 Dec 2023 02:05:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>&#8220;Your outcomes are a lagging indicator of your habits.&#8221; - James Clear</em></p><p>As I became a better software engineer, I noticed 4 key habits in my daily workflow that had made me much more productive.</p><div><hr></div><h3><a href="https://devstarterpacks.com/">Dev Starter Packs (Sponsored)</a></h3><p><strong>Dev Starter Packs</strong> has 100+ pre-built, interactive, beautiful React Native components to help you build your mobile app faster. The components are used in mobile apps today with thousands of users and are constantly being updated weekly with new ones.</p><p><a href="https://devstarterpacks.com">Similar to Tailwind UI, these components are </a><strong><a href="https://devstarterpacks.com">lifetime access</a></strong><a href="https://devstarterpacks.com"> with more 200+ more components planned to be released.</a> Dev Starter Packs also has a full-featured Next.js boilerplate and a fully-integrated React Native boilerplate, both offering easy payments, auth, logging, and error monitoring setup. With a holiday sale ongoing, don&#8217;t miss out - build your ideas in 2025. </p><div><hr></div><h2><strong>1. Leave work slightly unfinished for easier flow the next day</strong></h2><p>&#8220;Flow&#8221; is the root of productivity when programming.&nbsp;</p><p>Since software engineering is a <a href="http://www.paulgraham.com/makersschedule.html">&#8220;maker&#8221; activity</a> where I&#8217;m producing something, I generally perform best when I have a large block of uninterrupted &#8220;flow&#8221; time to work on a project.</p><p>However, it can often be really hard to get into flow if you&#8217;re stuck scrambling on what tasks your project goals entail. Ambiguity is difficult to deal with. Not even knowing where to start can make reaching that &#8220;flow state&#8221; much harder.</p><p>Each successful action snowballs into more.</p><p>There are a few techniques I use to do this:</p><ul><li><p><strong>Stop right before a &#8220;sticking point.&#8221;</strong> A sticking point is a task that&#8217;s part of a project where I know the steps to do to complete it, but I don&#8217;t know if there are hidden costs.&nbsp;</p><ul><li><p>For example, if my sticking point is deploying my ML model and HTTP server to a dev instance and verifying that it processes requests properly, then the hidden costs are deployment errors, authentication errors, resource constraints, etc.</p></li></ul></li><li><p><strong>Write down the next steps extremely clearly.</strong> Writing down steps makes regaining context and the state of mind from the day before easier.</p><ul><li><p><strong>Make them actionable and unambiguous.</strong></p></li></ul></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0kDZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0kDZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 424w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 848w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 1272w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0kDZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png" width="1456" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65283,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0kDZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 424w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 848w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 1272w, https://substackcdn.com/image/fetch/$s_!0kDZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a06784b-b277-40f4-832e-699ed2eb42a6_1612x633.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>2. Get better at keyboard and mouse shortcuts</strong></h2><p>My first experience with a real &#8220;shortcut ninja&#8221; was actually not with a software engineer. It was with my investment banker friend, who sped around his Excel sheets without ever touching the mouse.&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GSRH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GSRH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GSRH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png" width="516" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1456,&quot;width&quot;:1456,&quot;resizeWidth&quot;:516,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GSRH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!GSRH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22b7867e-304a-4cea-8e5e-1d24b8a11625_2000x2000.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">This, except I finally did appreciate it years later. Source: <a href="https://workchronicles.com/keyboard-shortcuts/">Work Chronicles</a></figcaption></figure></div><p>After that, I took the time to learn keyboard shortcuts, to the point where I grab my mouse ~60% less than I used to. (Yes, I tracked this.)</p><p><strong>It&#8217;s not just me! Sam Altman has a quote on this in his <a href="https://blog.samaltman.com/productivity">Productivity</a> essay: </strong></p><blockquote><p><em>I also made an effort to learn to type really fast and the keyboard shortcuts that help with my workflow.</em></p></blockquote><p>Every editor and tool in my workflow has keyboard shortcuts for pretty much any action you can think of. This doesn&#8217;t just apply to your IDE, but also your version control systems, your web browser, and your docs.</p><blockquote><p>For example, my IDE has a linter/formatter/cleaner all in one shortcut, which I use often as I write code to make sure lines stay neat.</p><p>I commonly use Command/Ctrl + Shift + V to paste in text without formatting in docs and chats.</p><p>Pressing <code>.</code> (period) on a GitHub repo page will automatically open up the repo in a VSCode Web instance.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I881!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I881!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 424w, https://substackcdn.com/image/fetch/$s_!I881!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 848w, https://substackcdn.com/image/fetch/$s_!I881!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 1272w, https://substackcdn.com/image/fetch/$s_!I881!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I881!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif" width="640" height="360" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;github dev&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="github dev" title="github dev" srcset="https://substackcdn.com/image/fetch/$s_!I881!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 424w, https://substackcdn.com/image/fetch/$s_!I881!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 848w, https://substackcdn.com/image/fetch/$s_!I881!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 1272w, https://substackcdn.com/image/fetch/$s_!I881!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73fb43a-a640-40f5-8080-eb06bc12afbe_640x360.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://github.com/github/dev">Source</a></figcaption></figure></div><p>When I do need to touch my mouse, it&#8217;s configured with shortcuts also. I&#8217;m lucky enough to have a mouse with buttons on the sides. I&#8217;ve programmed these buttons to switch between Spaces on my Mac, though you can program them for whatever feels intuitive for you. (You can even program them to be different per program.)</p><p>The best way to learn shortcuts? <strong>Introduce the most common parts of a program that you use, one a time.</strong> </p><p>For example, if you find yourself right-clicking to format your code often, that can be the first one you &#8220;practice.&#8221; Every so often, add a new shortcut to your repertoire and use it naturally as you code throughout the weeks. Over time, the shortcuts will be muscle memory.</p><h2><strong>3. Keep a list of searchable commands and links handy</strong></h2><p>I commonly have to run a set of common commands on my terminal.</p><p>I have certain pages that I always visit and some notes about various languages that I always come back to. For example, I simultaneously use templates too rarely and yet too often when writing C++, meaning I usually need to reference the docs when using them.</p><p>Instead of digging around documentation pages or constantly looking through my terminal history, I keep commands and common doc lookups in a giant doc with one word describing the command. I call it my <em>Big Book of Commands</em>, which is around ~10 pages long now. I&#8217;m easily able to find any command I need with a quick Ctrl+F. Then, a Shift + Command + &#10145;&#65039; is a full line-select for an easy copy-paste.</p><p>I also have a few common macros programmed into my keyboard for the commands and terms, like hard-to-remember ACL groups. Sometimes, I utilize Terminal aliases.</p><p>My friend <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Jordan Cutler&quot;,&quot;id&quot;:58854493,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4fe86d99-af64-4285-b982-9466a4c58d63_1311x1312.jpeg&quot;,&quot;uuid&quot;:&quot;3074ab35-03e5-4688-813f-45ef546f2eb8&quot;}" data-component-name="MentionToDOM"></span> wrote a great article that dives into his own workflow tips, which starts off with a great primer into aliases, keyboard shortcuts, and tools: <a href="https://careercutler.substack.com/p/the-top-7-software-engineering-workflow">The top 7 software engineering workflow tips I wish I knew earlier &#129520;</a></p><h2><strong>4. Say &#8220;no&#8221; more</strong></h2><p>This is less directly programming related, but I learned to say &#8220;no&#8221; to things. </p><blockquote><p>I said no to novel technology when boring technology would do the job. </p><p>I said no to automating something when it only needed to be done once manually. </p><p>I said no to more tasks when I knew I was already overloaded with work (even though my people-pleasing mind pleaded to take them on). </p><p>I said no to scope creep suggested by our designers. </p><p>I said no to low-impact tasks.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5c9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5c9w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5c9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png" width="570" height="570" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1456,&quot;width&quot;:1456,&quot;resizeWidth&quot;:570,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;No photo description available.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No photo description available." title="No photo description available." srcset="https://substackcdn.com/image/fetch/$s_!5c9w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!5c9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bd32eba-9cc5-4d80-956d-2f667b7b7b17_2000x2000.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">There&#8217;s an xkcd and a <a href="https://workchronicles.com/">Work Chronicles comic</a> for everything.</figcaption></figure></div><p>Learning to say no was harder than I expected, yet one of the most valuable skills I&#8217;ve applied in both the workplace and in my personal life.</p><p>Sometimes, it&#8217;s painful to say no to things. In both my career, hobbies, and personal life, there are times I say no to things I really want to do. But I don&#8217;t because I know my time and energy is better spent on what I&#8217;m currently focusing on.</p><p>It&#8217;s a cliche to quote Steve Jobs, but I remind myself of his famous quote &#8220;focus is about saying no&#8221; often.</p><p>My friend <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Irina Stanescu&quot;,&quot;id&quot;:4332862,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7eea2778-f26d-4f4b-9529-93fe29c3fdce_422x368.png&quot;,&quot;uuid&quot;:&quot;a0221a43-f5ae-4d19-a573-795f33bb4f2d&quot;}" data-component-name="MentionToDOM"></span> also has a fantastic article about saying no, which I highly recommend: <a href="https://www.thecaringtechie.com/p/software-eng-guide-to-saying-no">The Software Engineer's guide to saying "no"</a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>Thanks for reading Engineer&#8217;s Codex! If you&#8217;re reading, not subscribed, and enjoyed this article, please do subscribe! It&#8217;s free.</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[How Google takes the pain out of code reviews, with 97% dev satisfaction]]></title><description><![CDATA[A study of Google's code review tooling (Critique), AI-powered improvements, and recent statistics]]></description><link>https://read.engineerscodex.com/p/how-google-takes-the-pain-out-of</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-google-takes-the-pain-out-of</guid><pubDate>Mon, 04 Dec 2023 04:14:31 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1879909f-2d7d-49d0-a502-dc44a0a5ee27_2112x1126.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a publication about real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>A lot of ex-Google engineers talk about how much they miss <strong>Critique, Google&#8217;s code review tool,</strong> out of all the internal tools they leave behind.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zhrq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zhrq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 424w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 848w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 1272w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zhrq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png" width="495" height="231.0592459605027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:557,&quot;resizeWidth&quot;:495,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zhrq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 424w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 848w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 1272w, https://substackcdn.com/image/fetch/$s_!zhrq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe639edd5-e25b-456f-955a-b1e884b07aa4_557x260.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/nsthorat/status/1728211545165828162">Source: X/Twitter</a></figcaption></figure></div><p>Another Reddit comment laments about how they <a href="https://www.reddit.com/r/programming/comments/18ae0gc/comment/kbxjg6b/?utm_source=share&amp;utm_medium=web2x&amp;context=3">&#8220;miss [Critique] so bad&#8221;</a>, listing off various features they miss, like its &#8220;attention set,&#8221; which is explained below.</p><p>This tracks with Google&#8217;s own findings. Internally, <strong>97% of Google software engineers are satisfied with Critique.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></strong></p><p>But what is Critique exactly and what makes it so good?&nbsp;</p><p>How does this pair with Google&#8217;s actual process of code review?</p><p>In this article, I dive into:</p><ul><li><p>Google&#8217;s guidelines for efficient code review</p></li><li><p>Critique, their code review tooling, and AI-powered improvements</p></li><li><p>Internal statistics on Google code reviews</p></li><li><p>Why Critique seems to be so loved by Googlers</p></li></ul><p>While the <a href="https://abseil.io/resources/swe-book/html/toc.html">SWE Book</a> covers the basics of Critique, new <a href="https://blog.research.google/2023/05/resolving-code-review-comments-with-ml.html">blog posts</a> and <a href="https://research.google/pubs/?area=software-engineering">research</a> by Google show new developments in their code review processes, such as using AI to make automatic suggestions and improvements to code changes.</p><div><hr></div><h3><a href="https://devstarterpacks.com/">Dev Starter Packs (Sponsored)</a></h3><p><strong>Dev Starter Packs</strong> has 100+ pre-built, interactive, beautiful React Native components to help you build your mobile app faster. The components are used in mobile apps today with thousands of users and are constantly being updated weekly with new ones.</p><p><a href="https://devstarterpacks.com">Similar to Tailwind UI, these components are </a><strong><a href="https://devstarterpacks.com">lifetime access</a></strong><a href="https://devstarterpacks.com"> with more 200+ more components planned to be released.</a> Dev Starter Packs also has a full-featured Next.js boilerplate and a fully-integrated React Native boilerplate, both offering easy payments, auth, logging, and error monitoring setup. With a holiday sale ongoing, don&#8217;t miss out - build your ideas in 2025. </p><div><hr></div><h2>Google&#8217;s Code Review Guidelines</h2><p>To understand how Google writes clean, maintainable code, I wrote about <a href="https://engineercodex.substack.com/p/how-google-writes-clean-maintainable">Google&#8217;s readability process here</a>.</p><p>Google&#8217;s <a href="https://google.github.io/eng-practices/review/reviewer/standard.html">guidelines for a good code review</a> include:</p><ul><li><p><strong>Continuous improvement over perfection: </strong>While a more seasoned developer may find a less experienced developer&#8217;s code to not be up to their personal standard, Google encourages continuous improvement over perfection. Developers need to make progress; overly difficult reviews can discourage future improvements.&nbsp;</p></li><li><p><strong>Maintain or improve the health of the codebase</strong></p></li><li><p><strong>Follow the Style Guide:</strong> When code style comes into question, <a href="https://google.github.io/styleguide/">Google&#8217;s style guides</a> are followed and referenced to a tee.</p></li><li><p><strong>Always Share Knowledge: </strong>Reviewers are encouraged to share knowledge about language features, the codebase, and other relevant artifacts through code review. Usually, these guidelines are sent with &#8220;supporting documentation,&#8221; such as links to <a href="https://abseil.io/tips/">Google/Abseil&#8217;s C++ Tips of the Week</a>.&nbsp;</p><ul><li><p>At Google, the educational aspects of a code review are highly emphasized.</p></li></ul></li><li><p><strong>Write Small Changes</strong>: Keep changes limited to about 200 lines of code if possible.</p></li><li><p><strong>Strict Standards for Lightweightness</strong>: Google expects reviewers to review a code change in less than 24 hours and encourages reviews to only have one reviewer if possible, which saves time for everyone involved.</p><ul><li><p><em>&#8220;The majority of changes at Google are small, have one reviewer and no comments other than the authorization to commit. During the week, 70% of changes are committed less than 24 hours after they are mailed out for an initial review.&#8221;</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a></p></li></ul></li><li><p><strong>Politeness and Professionalism</strong>: Maintaining a culture of trust and respect is crucial. Feedback should be professional, avoiding personal criticism. Reviewers should be open to the author's approach, offering alternatives only if necessary, and treating each comment as a learning opportunity.</p><ul><li><p>I wanted to comment on this one specifically, as while it seems obvious, it&#8217;s not as easy to do in practice. It&#8217;s common for people to get attached to the code they&#8217;ve written or for reviewers to come off as harsher than they meant to. The written word leads for less nuanced communication compared to face-to-face.</p></li><li><p>Google has done a lot of research into how code comments can affect developer productivity and motivation.</p><ul><li><p><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/7ac08fa960dfe10561c1f5953419a0c945279faa.pdf">Predicting Developers&#8217; Negative Feelings about Code Review</a></p></li><li><p><a href="https://research.google/pubs/pub51232/">Destructive Criticism in Software Code Review Impacts Inclusion</a></p></li><li><p><a href="https://research.google/pubs/pub51204/">Detecting Interpersonal Conflict in Issues and Code Review: Cross Pollinating Open- and Closed-Source Approaches</a>&nbsp;</p></li><li><p><a href="https://developers.googleblog.com/2022/06/Using-research-to-make-code-review-more-equitable.html">Using research to make code review more equitable</a></p></li></ul></li></ul></li></ul><p>For a changelist (<a href="https://news.ycombinator.com/item?id=20891103">CLs are Google&#8217;s version of pull requests</a>, or PRs) to go through, it must have 0 unresolved comments, a LGTM (Looks Good To Me) from at least one reviewer, and 2 types of approval:</p><ul><li><p>people who &#8220;own&#8221; the part of the codebase the files go into</p></li><li><p><a href="https://engineercodex.substack.com/p/how-google-writes-clean-maintainable">Readability</a> approvals, who approve the &#8220;readability&#8221; and style of the code</p></li></ul><p>One person can be the LGTM-er and approver all at once.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2>Critique: Google&#8217;s Code Review Tool</h2><p>Critique is Google&#8217;s code review tool, allowing engineers to efficiently review and submit code changes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jk8P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jk8P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 424w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 848w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 1272w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jk8P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png" width="652" height="437.3833333333333" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab06cfb7-d251-49a6-9377-548af6901255_1440x966.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:966,&quot;width&quot;:1440,&quot;resizeWidth&quot;:652,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Jk8P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 424w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 848w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 1272w, https://substackcdn.com/image/fetch/$s_!Jk8P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab06cfb7-d251-49a6-9377-548af6901255_1440x966.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Critique&#8217;s UI, from <a href="https://abseil.io/resources/swe-book/html/ch19.html">SWE Book</a></figcaption></figure></div><p>They also have a diff view between the current codebase and the proposed changes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-r05!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-r05!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 424w, https://substackcdn.com/image/fetch/$s_!-r05!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 848w, https://substackcdn.com/image/fetch/$s_!-r05!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 1272w, https://substackcdn.com/image/fetch/$s_!-r05!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-r05!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png" width="698" height="319.2774725274725" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:666,&quot;width&quot;:1456,&quot;resizeWidth&quot;:698,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-r05!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 424w, https://substackcdn.com/image/fetch/$s_!-r05!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 848w, https://substackcdn.com/image/fetch/$s_!-r05!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 1272w, https://substackcdn.com/image/fetch/$s_!-r05!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fa11752-ef11-434b-a292-70d68f1403e3_1600x732.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The diff view, from <a href="https://blog.research.google/2023/05/resolving-code-review-comments-with-ml.html">Resolving Code Review Comments with ML</a></figcaption></figure></div><p>Importantly, Google&#8217;s <a href="https://blog.research.google/2023/05/resolving-code-review-comments-with-ml.html">recent publications</a> in 2023 show they have comprehensive <strong>AI-powered code review tools in-house now</strong> (as shown above).&nbsp;</p><p><strong>When reviewers leave comments on code, Critique will show suggested ML-powered edits, which mean that the author of the code review just has to click one button to address the comment in entirety.</strong></p><p>Recent developments, based on Google research papers, tell us that Google is improving developer productivity with AI-powered code review tools where possible.</p><h3>The Code Review Flow</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zDpW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zDpW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 424w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 848w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 1272w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zDpW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png" width="600" height="201.55728587319243" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:302,&quot;width&quot;:899,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zDpW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 424w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 848w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 1272w, https://substackcdn.com/image/fetch/$s_!zDpW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafef4989-ac0c-4cb8-a2c2-6a583d82c52e_899x302.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The <a href="https://abseil.io/resources/swe-book/html/ch19.html">SWE Book</a> covers Critique in detail with over 5000 words, but I summarize the key points here and have provided a link for those who want to dive deeper into it.&nbsp;</p><h4><strong>Stage 1: Create a Change</strong></h4><p>A CL (or Pull Request) is created in <a href="https://news.ycombinator.com/item?id=13076417">Google&#8217;s in-house code editor Cider</a>, which is &#8220;tightly integrated with Critique and other in-house Google tools&#8221;, leading to higher developer productivity.</p><ul><li><p><strong>Prereview Tools:</strong> Critique assists in polishing changes before review, showing diffs, build and test results, and style checks.</p></li><li><p><strong>Diffing and Visualization:</strong> Enhanced with syntax highlighting, cross-references, intraline diffing, whitespace ignoring, and move detection.</p></li><li><p><strong>Analysis Results:</strong> Displays results from <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/3198e114c4b70702b27e6d88de2c92734c9ac4c0.pdf">static analyzers</a>, highlighting important findings and offering fix suggestions. These include &#8220;presubmits,&#8221; which are automated tests that are run in Critique that enforce project-specific invariants.</p></li></ul><blockquote><p>Critique integrates feedback channels for analysis writers.</p><p>Reviewers have the option to click &#8220;Please fix&#8221; on an analysis generated comment as a signal that the author should fix the issue.</p><p>Either authors or reviewers can click &#8220;Not useful&#8221; in order to flag an analysis result that is not helpful in the review process. (<a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/3198e114c4b70702b27e6d88de2c92734c9ac4c0.pdf">Source</a>)</p></blockquote><h4><strong>Stage 2: Request Review </strong></h4><p>When a pull request is ready to be reviewed, the code author adds reviewers and sends it to them officially for review.</p><p>When a PR/CL is sent in for review, &#8220;presubmits&#8221; are run if they haven&#8217;t already on the current snapshot of code. This means that everyone involved in the review knows whether or not the code breaks anything.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pZ2F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pZ2F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 424w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 848w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 1272w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pZ2F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png" width="548" height="280.85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:738,&quot;width&quot;:1440,&quot;resizeWidth&quot;:548,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pZ2F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 424w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 848w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 1272w, https://substackcdn.com/image/fetch/$s_!pZ2F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fbb9fe2-3ea1-4923-8f60-48846c39cc16_1440x738.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">From <a href="https://abseil.io/resources/swe-book/html/ch19.html">SWE Book</a></figcaption></figure></div><p>Code reviews can also be <a href="https://research.google/pubs/pub50130/">anonymized</a>, where the code author can be kept anonymous from the reviewer. However, Google didn&#8217;t find much of an useful difference between anonymous code reviews and &#8220;real&#8221; code reviews.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1FYF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1FYF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 424w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 848w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 1272w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1FYF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png" width="512" height="331" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:331,&quot;width&quot;:512,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1FYF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 424w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 848w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 1272w, https://substackcdn.com/image/fetch/$s_!1FYF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87c417c9-aa2f-47de-ae17-5eedf6cd0bde_512x331.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://developers.googleblog.com/2022/06/Using-research-to-make-code-review-more-equitable.html">Using research to make code review more equitable</a> </figcaption></figure></div><h4><strong>Stages 3 and 4: Understanding and Commenting on a Change</strong></h4><ul><li><p>Anyone can comment on a change and there are features to track review progress and resolve comments.</p><ul><li><p><em>Unresolved comments</em> represent action items for the change author to definitely address. These can be marked as &#8220;resolved&#8221; by the code author themselves when they reply to the comment.</p></li><li><p><em>Resolved comments</em> include optional or informational comments that may not require any action by a change author</p></li></ul></li></ul><p>There&#8217;s a dashboard for review statuses and an &#8220;<strong>attention set&#8221;</strong> which lets people involved in a certain code review who is the current person being waited upon.</p><blockquote><p><em>The attention set is commonly a highly-regarded feature by Google engineers.</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Fg-P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fg-P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 424w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 848w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 1272w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fg-P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png" width="632" height="418.7" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:954,&quot;width&quot;:1440,&quot;resizeWidth&quot;:632,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Fg-P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 424w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 848w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 1272w, https://substackcdn.com/image/fetch/$s_!Fg-P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7386011-b782-48cd-a5c9-36ad2d5f02c8_1440x954.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Critique dashboard, from <a href="https://abseil.io/resources/swe-book/html/ch19.html">SWE Book</a></figcaption></figure></div><h4><strong>Stage 5: Change Approvals</strong></h4><p>As noted above, for a review to go in, it needs an LGTM from at least one reviewer. It needs 0 unresolved comments, though a code author can mark a comment resolved themselves when they reply. It also needs approvals from owners of the part of the codebase the code is going into, along with a <a href="https://engineercodex.substack.com/p/how-google-writes-clean-maintainable">readability approval</a>.</p><p>As mentioned before, this can all be done by one reviewer.</p><h4><strong>Stage 6: Committing a Change </strong></h4><p>Changes are submitted and committed within Critique itself.</p><p>Critique is valuable even after changes are submitted.</p><blockquote><p><em>&#8220;Google researchers found strong evidence that Critique&#8217;s uses extend beyond reviewing code. Change authors use Critique to examine diffs and browse analysis tool results. In some cases, code review is part of the development process of a change: a reviewer may send out an unfinished change in order to decide how to finish the implementation. Moreover, developers also use Critique to examine the history of submitted changes long after those changes have been approved.&#8221;</em></p></blockquote><h2>Modern Code Review Stats at Google</h2><p>Google conducted <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">a study on code review at the company specifically</a>. I&#8217;ve listed some interesting stats from their paper.</p><p><strong>Change Authoring Frequency</strong>:</p><ul><li><p>Median: 3 changes per week.</p></li><li><p>80% of authors make fewer than 7 changes weekly.</p></li></ul><p><strong>Review Frequency</strong>:</p><ul><li><p>Median: 4 changes reviewed per week.</p></li><li><p>80% of reviewers handle fewer than 10 changes weekly.</p></li></ul><p><strong>Time Spent Reviewing Per Week:</strong></p><ul><li><p>Average: 3.2 hours per week</p></li><li><p>Median: 2.6 hours per week</p></li></ul><p><strong>Initial Feedback Waiting Time</strong>:</p><ul><li><p>Small changes: Median time under 1 hour.</p></li><li><p>Very large changes: About 5 hours.</p></li></ul><p><strong>Overall Review Process Time</strong>:</p><ul><li><p>Median latency for all code sizes: Under 4 hours.</p></li><li><p><strong>Comparison with Other Companies</strong>:</p><ul><li><p>AMD: 17.5 hours (median time to approval).</p></li><li><p>Chrome OS: 15.7 hours.</p></li><li><p>Microsoft Projects: 14.7, 19.8, and 18.9 hours.</p></li><li><p>Microsoft (another study): 24 hours.</p></li></ul></li></ul><blockquote><p><em>&#8220;Previous studies have found that the number of useful comments decreases and the review latency increases as the size of the change increases. Size also influences developers&#8217; perception of the code review process; a survey of Mozilla contributors found that developers feel that size-related factors have the greatest effect on review latency.&#8221; (<a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">Source</a>)</em></p></blockquote><p>Furthermore, the number of comments received per change decreases with seniority.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GP0i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GP0i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 424w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 848w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 1272w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GP0i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png" width="458" height="296.7565543071161" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:692,&quot;width&quot;:1068,&quot;resizeWidth&quot;:458,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GP0i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 424w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 848w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 1272w, https://substackcdn.com/image/fetch/$s_!GP0i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eca60c-659d-42ed-9fe6-f67b46e67862_1068x692.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">Source</a></figcaption></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Another stat for you: <em>100% of Engineer&#8217;s Codex readers report higher satisfaction after reading. So subscribe, it&#8217;s free :)</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Why is Critique so loved by Googlers?</h2><p>Most Googlers and ex-Googlers are big fans of Critique.</p><p>Internally, <strong>97% of Google software engineers are satisfied with Critique.</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a></p><p>I asked 7 Googlers about why they prefer Critique over tools they may have used in the past, like GitHub.</p><p>They noted:</p><ul><li><p><strong>Static analysis: </strong>Google has a full-featured suite of <a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/3198e114c4b70702b27e6d88de2c92734c9ac4c0.pdf">static analysis tools</a> that provide actionable feedback on code automatically. This saves both code authors and reviewers time as reviewers then don&#8217;t have to nitpick at obvious items.</p></li></ul><ul><li><p><strong>Focus on only the latest changed files</strong>: There&#8217;s a focus on just the latest &#8220;snapshot&#8221; of code. Previous snapshots, commits, and code changes are not really a focus, allowing for a cleaner user interface.</p></li><li><p><strong>A familiar, side-by-side diffing interface: </strong>It shows "diff from the last review" by default.</p></li><li><p><strong>ML-powered suggestions: </strong>Google&#8217;s new ML-powered suggestions speed up code review immensely.</p></li><li><p><strong>Tight integration with other Google tooling: </strong>Critique is integrated extremely well with Google&#8217;s IDE and other internal tools, like their bug tracker. When everything is connected together, productivity is better.</p><ul><li><p>This includes easy linking of code, comments, and tickets.</p></li></ul></li><li><p><strong>&#8220;Action set&#8221; tracking</strong>: This lets people know who is supposed to be taking the next action.</p></li><li><p><strong>Satisfying gamification</strong>: While Critique isn&#8217;t built to be gamified, Googlers reported how they enjoyed it when Critique &#8220;went green,&#8221; which meant a PR was ready to submit (all tests passed, reviewers LGTM-ed and approved).</p></li></ul><p><a href="https://www.reddit.com/r/programming/comments/18ae0gc/comment/kbxjg6b/?utm_source=share&amp;utm_medium=web2x&amp;context=3">A Reddit comment lists more</a>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DRuA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DRuA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 424w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 848w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 1272w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DRuA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png" width="1456" height="1082" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1082,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:292730,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DRuA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 424w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 848w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 1272w, https://substackcdn.com/image/fetch/$s_!DRuA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56798bd6-1d0c-4110-8fb4-c3030f1e2c1a_1456x1082.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/3198e114c4b70702b27e6d88de2c92734c9ac4c0.pdf">A great quote on static analysis</a>:</p><blockquote><p>A qualitative study of 88 Mozilla developers found that static analysis integration was the most commonly-requested feature for code review. </p><p>Automated analyses allow reviewers to focus on the understandability and maintainability of changes, instead of getting distracted by trivial comments (e.g., about formatting).</p></blockquote><h2>Thoughts and Takeaways</h2><p><strong>While many of these features are available in other tools today, I believe it is the tight integration and extreme &#8220;personalization&#8221; of the tooling towards a Google-specific workflow and codebase that makes it so loved.</strong></p><p>At the same time, that means it&#8217;s not realistic for every company to replicate Critique and related tools exactly. For example, some of their tooling seems specific to challenges created by their monorepo structure.</p><p>While Critique itself will never be open-sourced, <a href="https://www.gerritcodereview.com/">Gerrit</a> is a similar tool to Critique. It&#8217;s an open-source code review tool also created and maintained by Google.</p><p>However, I think Google does put a lot of effort and thought into developer productivity. They <a href="https://research.google/pubs/?area=software-engineering">publish their research freely</a> and there are useful takeaways from their work.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>Thanks for reading Engineer&#8217;s Codex!</em> <em>If you enjoyed this post, please consider joining 10,000+ others in subscribing below.</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">Modern Code Review: A Case Study at Google</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">Modern Code Review: A Case Study at Google</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><a href="https://research.google/pubs/pub50130/">https://research.google/pubs/pub50130/</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><a href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/80735342aebcbfc8af4878373f842c25323cb985.pdf">Modern Code Review: A Case Study at Google</a></p></div></div>]]></content:encoded></item><item><title><![CDATA[Clever code is probably the worst code you could write]]></title><description><![CDATA[And clear, readable code is probably the hardest code to write]]></description><link>https://read.engineerscodex.com/p/clever-code-is-probably-the-worst</link><guid isPermaLink="false">https://read.engineerscodex.com/p/clever-code-is-probably-the-worst</guid><pubDate>Mon, 20 Nov 2023 09:58:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!t0Gn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a free publication about real-world software engineering. I write about real-world <a href="https://engineercodex.substack.com/p/how-instagram-scaled-to-14-million">technical case studies</a>, <a href="https://engineercodex.substack.com/p/how-one-line-of-code-caused-a-60">outages</a>, and <a href="https://engineercodex.substack.com/p/how-to-burnout-a-software-engineer">interesting stories</a> from the industry.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>When I was an undergrad, Leetcode broke my brain. I would see top solutions of esoteric one-liners and wrongly think &#8220;how do I ever get this good?&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V_Hc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V_Hc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 424w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 848w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 1272w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V_Hc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png" width="1444" height="166" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:166,&quot;width&quot;:1444,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V_Hc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 424w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 848w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 1272w, https://substackcdn.com/image/fetch/$s_!V_Hc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7d1f534-20ba-4990-b6a5-db8a1e83184f_1444x166.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://leetcode.com/problems/triangle/solutions/38827/One-liner-in-Python/">What does this even do?</a></figcaption></figure></div><p>This is commonly called &#8220;code golfing&#8221;. It&#8217;s a fun hobby, but very far from &#8220;good code.&#8221;</p><p>Everybody (including those on Leetcode) knows this isn&#8217;t good code. In the industry, it&#8217;s the worst code one could write.</p><p>Okay, I admit - this is a <em>pretty bad example of clever code</em>, <em>because it is so obviously bad. Here&#8217;s an example of a code snippet I came across in some old code that I found annoying:</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!t0Gn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!t0Gn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 424w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 848w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 1272w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!t0Gn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png" width="1456" height="394" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:394,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102349,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!t0Gn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 424w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 848w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 1272w, https://substackcdn.com/image/fetch/$s_!t0Gn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4650fd1-cf7e-4d7b-94c9-cd121aff8864_1502x406.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, on the other end of the spectrum, I realized eventually that the <strong>clearest code was actually the hardest to write.</strong></p><p>It made sense retrospectively. Reviewing the code of a senior staff software engineer was much easier to follow and review compared to the code of an entry-level L3 engineer.</p><div><hr></div><h3><a href="https://nucleate.dev">Nucleate</a> (Featured)</h3><p>Nucleate is an online platform to <strong>build and deploy beautiful web and mobile apps with AI.</strong> It takes away the set-up headaches so you can focus on building your product.</p><p><em>You can use the code <strong>ENGCODEX</strong> for 50% off your first month.</em></p><div><hr></div><h3>Clear code: the good and the bad</h3><blockquote><p><em>"Debugging code is twice as hard as writing the code in the first place. Therefore, if you write code as cleverly as possible, you are, by definition not smart enough to debug it." </em></p><p><em>- </em>Brian W. Kernighan</p></blockquote><p>The &#8220;power&#8221; of clear code, for better or for worse, was made fully clear to me after a certain incident at work.</p><p>I once wrote a module in C++, a language that is a bit harder to read compared to other languages simply due to its verbosity.</p><p>I started with just two files (.h/.cpp) and all the implementation code went into just these two files.</p><p>The result was this giant, disgusting piece of spaghetti on the inside, but a perfectly working program on the outside.</p><p>This would <em>never</em> get past code review.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DXwP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DXwP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 424w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 848w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 1272w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DXwP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png" width="740" height="258" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9d112e9-9f7d-4302-9947-df09a974d532_740x258.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:258,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Code Quality&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Code Quality" title="Code Quality" srcset="https://substackcdn.com/image/fetch/$s_!DXwP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 424w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 848w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 1272w, https://substackcdn.com/image/fetch/$s_!DXwP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d112e9-9f7d-4302-9947-df09a974d532_740x258.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://xkcd.com/1513/">xkcd 1513</a></figcaption></figure></div><p>I split the implementation into 8-10 diffs. Each diff was a neat, containerized piece of code, with convenient placeholders for dependencies that would arrive in a later diff. It had code neatly split out into helper functions and helper files when necessary.</p><p>Each diff had reasonable unit test coverage - the basics and some obvious edge cases were covered, but I didn&#8217;t go wastefully overboard with it.</p><p>Each diff also took me quite a few iterations of &#8220;code cleaning,&#8221; refactoring, and more. <strong>It took a lot more effort than I expected to achieve &#8220;clear code,&#8221; especially for such a large program.</strong></p><p>The result? <em>A beautiful landing of the module, with easy to read, clear code.</em></p><p>While I was proud of it, there was suddenly a <strong>problem</strong> when I talked to my manager about it.</p><blockquote><p>&#8220;While I understand how complex this was, when it comes to performance reviews, this code looks trivial. It looks too easy, too simple.</p><p>I would recommend writing an implementation doc of this module just so we can demonstrate that this was actually quite complex.&#8221;</p></blockquote><p>I was shocked - this wasn&#8217;t some startup. This was one of the biggest companies in the world, <em>known for their engineering culture</em>.</p><p>I now understood why Big Tech seemingly had so many docs &#8212; half of the docs I wrote didn&#8217;t <em>need</em> to be written, except they did&#8230; because I wanted to get raises and be promoted.</p><p>While promotion culture in Big Tech is a story for another article (subscribe to see it in your inbox soon &#128578;), the main point here is that <strong>great code is very clear and readable.</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><p>There&#8217;s a <a href="https://github.com/dwmkerr/hacker-laws#kernighans-law">popular saying</a> that <strong>debugging code is twice as hard as writing it</strong>. It&#8217;s the reason why when ChatGPT outputs some hogwash, it&#8217;s easier just to re-prompt it or write it from scratch yourself instead of trying to figure out the errors in its buggy code.</p><blockquote><p>Clever code is harder to read and looks esoteric.</p><p>Clear code is harder to write and looks easy.</p></blockquote><h3><strong>Some other thoughts about clear code</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fINH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fINH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 424w, https://substackcdn.com/image/fetch/$s_!fINH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 848w, https://substackcdn.com/image/fetch/$s_!fINH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 1272w, https://substackcdn.com/image/fetch/$s_!fINH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fINH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png" width="797" height="659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:659,&quot;width&quot;:797,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;No photo description available.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No photo description available." title="No photo description available." srcset="https://substackcdn.com/image/fetch/$s_!fINH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 424w, https://substackcdn.com/image/fetch/$s_!fINH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 848w, https://substackcdn.com/image/fetch/$s_!fINH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 1272w, https://substackcdn.com/image/fetch/$s_!fINH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47b6afa3-ee52-4646-8e0f-e021870e52a6_797x659.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://workchronicles.com/">Work Chronicles! I love their comics. (Source)</a></figcaption></figure></div><ul><li><p>The only way I got better at writing clear, readable code was just <strong>writing a lot of code while strictly following a clear style guide.</strong></p><ul><li><p>Also, having more experienced devs review my code with a magnifying glass. </p><ul><li><p>It was agony to get tons of comments and &#8220;nits&#8221; about seemingly pointless style in the beginning, but it paid off in the end.</p></li></ul></li></ul></li><li><p>Coding style is <strong>more important</strong> than I expected in the beginning. My start to software engineering started from being on the product-minded end of the spectrum and moved towards the &#8220;technical-minded&#8221; side of the spectrum.&nbsp;</p><ul><li><p>I had started coding solely to start a business, so I initially only cared about code as a tool, resulting in crappy, unmaintainable code.</p></li><li><p>It&#8217;s only through more experience with writing code and working within teams that the importance of clear, readable code became more obvious.</p></li><li><p>It&#8217;s not just me. This is an obvious revelation to anybody who has been writing code in the industry for more than a year. </p></li></ul></li><li><p><strong><a href="http://number-none.com/blow/john_carmack_on_inlined_code.html">John Carmack once wrote a long email about coding style in 2007, which is an interesting read.</a></strong></p></li><li><p><a href="https://engineercodex.substack.com/p/how-google-writes-clean-maintainable">Google probably has the most public style guide</a>. Vercel also recently released their <a href="https://github.com/vercel/style-guide?utm_source=tldrwebdev">style guide</a>, and pretty much every company uses some sort of linter and prettifier.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>Engineer&#8217;s Codex is a free publication about real-world software engineering. I write about real-world <a href="https://engineercodex.substack.com/p/how-instagram-scaled-to-14-million">technical case studies</a>, <a href="https://engineercodex.substack.com/p/how-one-line-of-code-caused-a-60">outages</a>, and <a href="https://engineercodex.substack.com/p/how-to-burnout-a-software-engineer">interesting stories</a> from the industry.</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[How one line of code caused a $60 million loss]]></title><description><![CDATA[60,000 people lost full phone service, half of AT&T's network was down, and 500 airline flights were delayed]]></description><link>https://read.engineerscodex.com/p/how-one-line-of-code-caused-a-60</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-one-line-of-code-caused-a-60</guid><pubDate>Mon, 13 Nov 2023 07:08:08 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/79cf33d3-de5d-4faf-8a70-1443cf658315_1200x1200.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is about practical lessons and stories of real-world software engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>On January 15th, 1990, AT&amp;T's New Jersey operations center detected a widespread system malfunction, shown by a plethora of red warnings on their network display. </p><p><strong>Despite attempts to rectify the situation, the network remained compromised for 9 hours, leading to a 50% failure rate in call connections.</strong></p><p>AT&amp;T lost over <strong>$60 million</strong> as a result with <strong>over 60,000 of Americans left with fully disconnected phones</strong>.</p><p>Furthermore, <strong>500 airline flights were delayed, affecting 85,000 people.</strong></p><p>AT&amp;T's long-distance network was supposedly a paragon of efficiency, handling a substantial portion of the nation's calls with its advanced electronic switches and signaling system. This system usually completed call routing within seconds.</p><p>However, on this day, a fault originating in a New York switch cascaded through the network. <strong>This was due to a software bug in a recent update that contained a critical bug affecting the network's 114 switches.</strong> When the New York switch reset itself and sent out signals, this bug caused a domino effect, leading to widespread network disruption.</p><p><strong>This software patch had already gone through layers of testing without being caught. This incident was especially surprising because AT&amp;T was known for their rigorous testing.</strong></p><div><hr></div><h3><a href="https://www.swequiz.com">SWE Quiz</a></h3><p>To be a great software engineer, you need to know a lot. But how do you figure out what you don&#8217;t know?</p><p><strong><a href="http://swequiz.com/">SWE Quiz</a></strong> is a resource of 500+ questions to reveal your gaps in software domain knowledge, like <a href="https://swequiz.com/learn/databases-roadmap">databases</a>, <a href="https://swequiz.com/learn/caching-roadmap">caching</a>, and <a href="https://swequiz.com/learn/networking-roadmap">networking</a>. Many of these questions are verified concepts that have been asked in interviews with Meta, Apple, Airbnb, Google, and more.</p><p>SWE Quiz also has <a href="https://swequiz.com/learn">structured roadmaps</a> for learning important software concepts.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.swequiz.com/&quot;,&quot;text&quot;:&quot;Get Lifetime Access to SWE Quiz&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.swequiz.com/"><span>Get Lifetime Access to SWE Quiz</span></a></p><div><hr></div><h3>The Problem</h3><p>The root cause was traced back to a coding error in a software update implemented across the network's switches. </p><p>The error, within a C program, involved a misplaced <em>break</em> statement within nested conditional statements, leading to data overwrites and system resets. </p><p>The pseudocode:</p><pre><code>1  while (ring receive buffer not empty 
          and side buffer not empty):

2    Initialize pointer to first message in side buffer
     or ring receive buffer

3    get copy of buffer

4    switch (message):

5       case (incoming_message):

6             if (sending switch is out of service):

7                 if (ring write buffer is empty):

8                     send "in service" to status map

9                 else:

10                    <strong>break // The error was here!</strong>

                  END IF

11           process incoming message, set up pointers to
             optional parameters

12           break
       END SWITCH


13   do optional parameter work</code></pre><p>The problem:</p><ul><li><p>If the <em>ring write buffer is NOT empty</em>, then the `if` statement on line 7 is skipped and the <em>break</em> statement on line 10 is hit instead.</p></li><li><p>However, for the program to function properly, line 11 should have been hit instead.</p></li><li><p>When the <em>break</em> statement is hit instead of the incoming message being processed and pointers being set up to optional parameters, then data (the pointers that should&#8217;ve been held) is overwritten</p></li><li><p>The error correction software identified the data overwrite and initiated a shutdown of the switch for a reset. This issue was compounded because this flawed software was present in all switches across the network, leading to a chain reaction of resets that ultimately crippled the entire network system.</p></li></ul><p>Despite having a network designed for resilience, <strong>one line of code was able to bring down half the country&#8217;s main line of communication.</strong></p><h3>The Fix</h3><p>It took engineers 9 hours to get AT&amp;T&#8217;s system fully back online. They did so mostly by rolling back the switches to a previous, working version of code.</p><p>It actually took software engineers two weeks of rigorous code reading, testing, and replication to actually understand where the bug was.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h3>Conclusion</h3><p>For AT&amp;T, unfortunately, this wasn&#8217;t even their biggest system crash of the 90s. They encountered many more issues later in the decade.</p><p><strong>In reality, it wasn&#8217;t one line of code that brought down a system</strong>. It was a failure in processes.</p><p>Today&#8217;s companies have even better processes in place, and even then, bugs slip through. Google wrote a great retrospective on <a href="https://sre.google/resources/practices-and-processes/twenty-years-of-sre-lessons-learned/">20 years of Site Reliability Engineering</a>, where they reflect on YouTube&#8217;s first global outage in 2016.</p><p>The scale of an outage for companies is huge and there are lessons to be learned from each outage. For most, however, outages come down to human error and gaps in processes.</p><h4><strong>My favorite resources for reliability engineering</strong></h4><p><a href="https://sre.google/">Google SRE</a></p><p><a href="https://handbook.gitlab.com/job-families/engineering/infrastructure/site-reliability-engineer/">GitLab&#8217;s SRE Role</a></p><p><a href="https://sre.xyz/">Site Reliability Engineering Resources</a></p><div><hr></div><p>Sources:</p><p><a href="https://users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse">https://users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse</a></p><p><a href="https://telephoneworld.org/landline-telephone-history/the-crash-of-the-att-network-in-1990/">https://telephoneworld.org/landline-telephone-history/the-crash-of-the-att-network-in-1990/</a></p><p><a href="https://www.mit.edu/hacker/part1.html">https://www.mit.edu/hacker/part1.html</a></p><p><a href="https://prezi.com/qxeu8iayvwpu/1990-att-long-distance-network-crash/">https://prezi.com/qxeu8iayvwpu/1990-att-long-distance-network-crash/</a></p>]]></content:encoded></item><item><title><![CDATA[The most valuable trait of great software engineers]]></title><description><![CDATA[A mindset shift that changed the way I approach software development. The #1 trait of valuable software engineers.]]></description><link>https://read.engineerscodex.com/p/the-1-trait-of-the-most-valuable</link><guid isPermaLink="false">https://read.engineerscodex.com/p/the-1-trait-of-the-most-valuable</guid><pubDate>Fri, 27 Oct 2023 00:01:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter about lessons from real-world engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>John Carmack, previous CTO of Oculus and creator of id Software (Doom, Quake, etc), was asked how AI will affect software developer jobs in the future.</p><p>He had only one piece of advice: <a href="https://twitter.com/ID_AA_Carmack/status/1637087219591659520">&#8220;build full product skills.&#8221;</a></p><p>In fact, he&#8217;s beat the drum about this trait over and over, in tweets, podcasts, and his writing: <strong>being product-minded makes you an extremely valuable engineer.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SKlt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SKlt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 424w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 848w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 1272w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SKlt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png" width="470" height="185.03937007874015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f76ca600-2110-4532-a26c-8d42ac63e198_762x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:762,&quot;resizeWidth&quot;:470,&quot;bytes&quot;:288847,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SKlt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 424w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 848w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 1272w, https://substackcdn.com/image/fetch/$s_!SKlt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff76ca600-2110-4532-a26c-8d42ac63e198_762x300.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/ID_AA_Carmack/status/1637087219591659520">Source</a></figcaption></figure></div><p>The best engineers I know are not only extremely sharp technically, but also are able to apply their technical skills in a way that provides the most impact to move their product forward.</p><p>Some companies have formalized this mindset into the role of &#8220;product engineers,&#8221; where they are responsible for the overall direction of the product, <a href="https://posthog.com/blog/product-engineer-vs-software-engineer">not just the engineering</a>. This is surprisingly not common in a lot of tech companies today.&nbsp;</p><p>In this article, I&#8217;ll refer to &#8220;stack engineers&#8221; as basically all software engineers.</p><p>When I was doing research on product engineering, I found that <a href="https://posthog.com/">PostHog</a> has written a lot of <a href="https://posthog.com/blog/what-is-a-product-engineer">blog</a> <a href="https://posthog.com/blog/why-product-engineering-is-so-fun">posts</a> about it, so I reached out to them to chat about:</p><ul><li><p>What&#8217;s the main difference between &#8220;product engineers&#8221; and &#8220;stack engineers&#8221;?</p></li><li><p>What does &#8220;product engineering&#8221; look like in the real world?</p></li><li><p>Tips for engineers to build full product skills</p></li><li><p>Recommendations for engineers who prefer to be tech-oriented instead of product-oriented</p></li><li><p>What else does PostHog do uniquely?</p></li></ul><div class="embedded-publication-wrap" data-attrs="{&quot;id&quot;:1318225,&quot;name&quot;:&quot;Product for Engineers&quot;,&quot;logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe72ab71-149a-44a9-8b5a-b91485b0c98f_371x371.png&quot;,&quot;base_url&quot;:&quot;https://newsletter.posthog.com&quot;,&quot;hero_text&quot;:&quot;Helping engineers and founders flex their product muscles&quot;,&quot;author_name&quot;:&quot;Andy Vandervell&quot;,&quot;show_subscribe&quot;:true,&quot;logo_bg_color&quot;:&quot;#EEEFE9&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPublicationToDOMWithSubscribe"><div class="embedded-publication show-subscribe"><a class="embedded-publication-link-part" native="true" href="https://newsletter.posthog.com?utm_source=substack&amp;utm_campaign=publication_embed&amp;utm_medium=web"><img class="embedded-publication-logo" src="https://substackcdn.com/image/fetch/$s_!JM_B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe72ab71-149a-44a9-8b5a-b91485b0c98f_371x371.png" width="56" height="56" style="background-color: rgb(238, 239, 233);"><span class="embedded-publication-name">Product for Engineers</span><div class="embedded-publication-hero-text">Helping engineers and founders flex their product muscles</div><div class="embedded-publication-author-name">By Andy Vandervell</div></a><form class="embedded-publication-subscribe" method="GET" action="https://newsletter.posthog.com/subscribe?"><input type="hidden" name="source" value="publication-embed"><input type="hidden" name="autoSubmit" value="true"><input type="email" class="email-input" name="email" placeholder="Type your email..."><input type="submit" class="button primary" value="Subscribe"></form></div></div><h2><strong>What&#8217;s the main difference between &#8220;product engineers&#8221; and &#8220;stack engineers&#8221;?</strong></h2><p><a href="http://linkedin.com/in/neilkakkar">Neil Kakkar</a>, a product engineer at PostHog, writes:&nbsp;</p><blockquote><p>&#8220;Probably the biggest shift becoming a product engineer was with thinking from the eyes of the user. What&#8217;s technically sound takes a back seat to what the user wants. </p><p>When I was a stack engineer, I&#8217;d approach problems from the lens of <em>&#8220;what&#8217;s technically possible?&#8221;</em> and choose a compromise that somewhat works, negotiating with the product manager.</p><p>Now, it&#8217;s more like: <em>&#8220;Ok, what we ideally want is technically impossible. But we still need the user to have a good experience, so maybe we can relax some other constraints such that it sparks joy for the user, and becomes technically possible as well&#8221;.</em></p><p>I still don&#8217;t always do it, and sometimes fall into the default of thinking through the tech side, where my lovely team mates help prod me back on the right track. </p></blockquote><p>Neil linked to an example of this from PostHog&#8217;s GitHub, which is public.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!afod!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!afod!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 424w, https://substackcdn.com/image/fetch/$s_!afod!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 848w, https://substackcdn.com/image/fetch/$s_!afod!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 1272w, https://substackcdn.com/image/fetch/$s_!afod!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!afod!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png" width="1456" height="352" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:352,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!afod!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 424w, https://substackcdn.com/image/fetch/$s_!afod!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 848w, https://substackcdn.com/image/fetch/$s_!afod!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 1272w, https://substackcdn.com/image/fetch/$s_!afod!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73d94b4-a0da-42e5-905d-91288d78c6dd_1690x408.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Here&#8217;s a very recent example: <a href="https://github.com/PostHog/posthog-js/pull/824#issuecomment-1753019474">https://github.com/PostHog/posthog-js/pull/824#issuecomment-1753019474</a></figcaption></figure></div><p>One thing I want to emphasize here is that being product-minded and code-oriented are not mutually exclusive.</p><p>In fact, they go together hand-in-hand.</p><h2><strong>What does &#8220;product engineering&#8221; look like in the real world?</strong></h2><p>Generally, product engineering is similar to how most projects are planned.</p><p>Neil wrote a <a href="https://neilkakkar.com/How-I-Own-Projects-as-a-Software-Engineer.html">detailed blog post about how he owns projects as a software engineer:</a></p><blockquote><p><em>Gather Context</em>: Understand the problem thoroughly, focusing on use cases.</p><p><em>Figure out a Solution:</em> Start with ideal solutions and tease out first principles.</p><p><em>Build:</em> Prioritize tasks effectively, set clear priorities, and avoid distractions.</p><p><em>Gather Feedback:</em> Conduct user interviews to confirm principles and validate solutions.</p><p><em>Align Metrics with Feedback:</em> Ensure that feedback aligns with actual product usage.</p></blockquote><p>These steps are similar to a software project being planned in a &#8220;normal company.&#8221;</p><p>However, there are a few things that stand out to me:</p><h3><strong>Gathering context</strong></h3><p><em>Gathering context</em> in a normal tech company generally means using data that&#8217;s already there or interfacing with product managers and UX teams.</p><p>In a product engineering role, gathering context means talking directly to the customer and having a more hands-on approach. <strong>This is rare!</strong>&nbsp;</p><p>Most engineers in companies are silo&#8217;d away from users and interface with product managers instead. This is usually done because having clear &#8220;roles&#8221; allows for higher focus.</p><p>On the other hand, product engineers get to wear many hats, doing engineering, product, and UX work. The interface of a product manager is removed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WAI4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WAI4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 424w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 848w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 1272w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WAI4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png" width="1063" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:516,&quot;width&quot;:1063,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49654,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WAI4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 424w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 848w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 1272w, https://substackcdn.com/image/fetch/$s_!WAI4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff86d0f3c-64bb-40a8-a0bf-dc81a87a073e_1063x516.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Instead, a product manager goes deeper into aspects of the product when necessary, supplementing surface level insights and taking over investigations that product engineers don&#8217;t have the bandwidth for.</p><p>You can also see it in real life, since <a href="https://github.com/PostHog/posthog/issues/17908">PostHog makes their sprint planning for each team public.</a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h3><strong>Feedback Loops</strong></h3><p>An interesting note mentioned was <a href="https://posthog.com/blog/feedback-loops">feedback loops</a>.</p><p>There&#8217;s a huge focus on generating faster feedback loops, allowing engineers to make sure they&#8217;re going in the right direction. Checking for feedback often allows for micro-adjustments towards a better product.</p><p>A good question that Neil mentioned here was him asking himself <em>&#8220;How can I verify my thinking?"</em>, actively forcing him to seek feedback.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oltz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oltz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 424w, https://substackcdn.com/image/fetch/$s_!oltz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 848w, https://substackcdn.com/image/fetch/$s_!oltz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!oltz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oltz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png" width="460" height="345.0842490842491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1365,&quot;resizeWidth&quot;:460,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;7 more evaluation cartoons, including a CPE comparison&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="7 more evaluation cartoons, including a CPE comparison" title="7 more evaluation cartoons, including a CPE comparison" srcset="https://substackcdn.com/image/fetch/$s_!oltz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 424w, https://substackcdn.com/image/fetch/$s_!oltz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 848w, https://substackcdn.com/image/fetch/$s_!oltz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!oltz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c641c11-e2e0-4583-848d-1d230a397fe2_1365x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://freshspectrum.com/more-eval/">Source</a></figcaption></figure></div><h3><strong>Metrics are always user-focused</strong></h3><p>This seems obvious, but having worked in big tech, it&#8217;s not always the case.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I7Pw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I7Pw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 424w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 848w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I7Pw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg" width="612" height="612" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1200,&quot;width&quot;:1200,&quot;resizeWidth&quot;:612,&quot;bytes&quot;:189355,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!I7Pw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 424w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 848w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!I7Pw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83ab98c9-38df-40b7-a050-00d5659bf430_1200x1200.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At a startup like PostHog, it&#8217;s a necessity for metrics to be user focused. The name &#8220;product engineer&#8221; keeps this focus top of mind for all engineers.</p><p>On the other hand, results vary greatly at larger tech companies. Metrics often become another thing to game to show impact for promotions. Of course, there are many cases where metrics align with a better user experience, but this is much more common at a &#8220;product engineering&#8221; company.</p><p>For example, at Big Tech companies like Meta and Google, there are countless stories littered across the web where making a better user experience is <a href="https://www.teamblind.com/post/How-to-succeed-at-Meta-diLQqcTy">often implicitly discouraged</a>, leading engineers to simply work on <a href="https://news.ycombinator.com/item?id=31262428">&#8220;hard problems&#8221;, regardless of whether they bring user value or not.</a> Engineers must often pick between doing what&#8217;s best for users or what&#8217;s best for their careers (though this is not always the case).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!syXY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!syXY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 424w, https://substackcdn.com/image/fetch/$s_!syXY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 848w, https://substackcdn.com/image/fetch/$s_!syXY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!syXY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!syXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg" width="552" height="552" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:880,&quot;width&quot;:880,&quot;resizeWidth&quot;:552,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;46 Funny Comics By Work Chronicles People Who've Ever Worked In An Office  Will Relate To | Business presentation, Programmer humor, Funny comics&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="46 Funny Comics By Work Chronicles People Who've Ever Worked In An Office  Will Relate To | Business presentation, Programmer humor, Funny comics" title="46 Funny Comics By Work Chronicles People Who've Ever Worked In An Office  Will Relate To | Business presentation, Programmer humor, Funny comics" srcset="https://substackcdn.com/image/fetch/$s_!syXY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 424w, https://substackcdn.com/image/fetch/$s_!syXY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 848w, https://substackcdn.com/image/fetch/$s_!syXY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!syXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F943aacdd-8e06-446a-bfea-e3cfcce1165b_880x880.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://workchronicles.com/">Source: Work Chronicles</a></figcaption></figure></div><p><strong>This is very obviously not the case for product engineering-focused companies</strong>.</p><p>I think that there is a non-engineering benefit here where working on things that have impact on the end-user leads to better outcomes for both engineers and the company. It leads to <a href="https://engineercodex.substack.com/p/how-to-burnout-a-software-engineer">less burnout</a> and less time wasted on company politics.</p><h3><strong>Software isn&#8217;t always the solution</strong></h3><p>Owning a project provides a holistic view from talking to customers to getting feedback.</p><p>This perspective helps in understanding the entire flow and when software might not be the right solution.</p><p>When the product comes first, this is more encouraged. Compare this to other tech companies, where volume of code and velocity of pull requests are common metrics tracked as a gauge for productivity, regardless of the real value provided.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Tips for engineers to build full-product skills</strong></h2><ul><li><p>Most companies would like for engineers to be more product-minded. While it&#8217;s made waves on &#8220;engineering&#8221; social media, it&#8217;s not really that common for engineers to think about the product that deeply.</p></li><li><p><strong>Work alongside data analysts, implementation specialists, and product managers more.</strong> Talk to them more.</p></li><li><p><strong>Ask questions about the user experience.</strong> What metrics matter for the end result? What user experience is being aimed for?</p></li><li><p>This also means really paying attention during all-hands. It&#8217;s easy to breeze through this, but it can be important to try to come out of an all-hands or earning call with questions.</p><ul><li><p>Pretend you&#8217;re leading your company and/or org.What would you focus on and what moves would you make for both the company and the org you&#8217;re in?</p></li><li><p>If your predictions align with what direction the org is going in, great!</p></li><li><p>But if they don&#8217;t. Why don&#8217;t they?</p></li><li><p>It&#8217;s actually quite common that they don&#8217;t. <strong>When visions differ enough and somebody feels strong enough to feel frustrated by leadership&#8217;s vision (or lack thereof),</strong> <strong>startups are created.&nbsp;</strong></p><ul><li><p>It&#8217;s very common for big tech companies to flounder through projects that took years and eventually shut down. I&#8217;ve seen it first hand! VPs and Directors will be assigned to projects that they have no business leading, and when those orgs get shut down due to failures a couple years later, it&#8217;s usually employees who suffer.</p></li></ul></li></ul></li></ul><ul><li><p><strong>Build more prototypes.</strong> As Neil said, making an MVP is super valuable.</p></li></ul><ul><li><p><strong>Try to get a good mix of 0-1 projects along with &#8220;improvement&#8221; projects.</strong> At companies, it&#8217;s common to work on feature improvements or changes to existing products. But, ideally, there are opportunities to work on projects that start from &#8220;ground-up.&#8221;</p><ul><li><p>At startups, these opportunities might be easier to find.&nbsp;</p></li><li><p>At big tech, it&#8217;s definitely harder, but it&#8217;s possible.</p></li></ul></li></ul><h2><strong>What if I prefer being tech-oriented instead of product-first?</strong></h2><p>Being product-minded and code-oriented are not mutually exclusive.</p><p>Great engineers are able to steer both the product and technical direction the right way at the same time!</p><p>This isn&#8217;t easy, but it&#8217;s a skill that can be developed over time.</p><p>There are many engineers who prefer being deep in the weeds of code and don&#8217;t want to talk to users or be product-facing. I think that&#8217;s okay. In fact, I&#8217;d say this is actually encouraged in some Big Techs.</p><p>At Google, for example, it&#8217;s only at L6 (Staff Engineer) that one becomes responsible for the product direction. Before that, &#8220;you can be largely successful by building good technical solutions.&#8221; (<a href="https://staffeng.com/stories/adam-bender/">Adam Bender, Principal Software Engineer at Google</a>)&nbsp;</p><p>An easy way to work on the &#8220;tech-first&#8221; is to simply work on <a href="https://engineercodex.substack.com/p/meta-xfaas-serverless-functions-explained">distributed systems and infrastructure</a>. In these cases, your users are now other teams!</p><h2><strong>What does PostHog do uniquely?</strong></h2><p>I wanted to thank PostHog for being willing to reach out and chat about product engineering. It&#8217;s not everyday that a startup is willing to take time out to chat transparently about their processes.</p><div class="embedded-publication-wrap" data-attrs="{&quot;id&quot;:1318225,&quot;name&quot;:&quot;Product for Engineers&quot;,&quot;logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe72ab71-149a-44a9-8b5a-b91485b0c98f_371x371.png&quot;,&quot;base_url&quot;:&quot;https://newsletter.posthog.com&quot;,&quot;hero_text&quot;:&quot;Helping engineers and founders flex their product muscles&quot;,&quot;author_name&quot;:&quot;Andy Vandervell&quot;,&quot;show_subscribe&quot;:true,&quot;logo_bg_color&quot;:&quot;#EEEFE9&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPublicationToDOMWithSubscribe"><div class="embedded-publication show-subscribe"><a class="embedded-publication-link-part" native="true" href="https://newsletter.posthog.com?utm_source=substack&amp;utm_campaign=publication_embed&amp;utm_medium=web"><img class="embedded-publication-logo" src="https://substackcdn.com/image/fetch/$s_!JM_B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe72ab71-149a-44a9-8b5a-b91485b0c98f_371x371.png" width="56" height="56" style="background-color: rgb(238, 239, 233);"><span class="embedded-publication-name">Product for Engineers</span><div class="embedded-publication-hero-text">Helping engineers and founders flex their product muscles</div><div class="embedded-publication-author-name">By Andy Vandervell</div></a><form class="embedded-publication-subscribe" method="GET" action="https://newsletter.posthog.com/subscribe?"><input type="hidden" name="source" value="publication-embed"><input type="hidden" name="autoSubmit" value="true"><input type="email" class="email-input" name="email" placeholder="Type your email..."><input type="submit" class="button primary" value="Subscribe"></form></div></div><p>However, this is something that PostHog does right - <strong>transparency. </strong>I read a lot of PostHog&#8217;s articles while writing this one, and I was impressed by the level of transparency they provide.&nbsp;</p><p>At the same time, I think it makes sense. It builds trust and works as a marketing tool. Furthermore, it is notoriously hard to market products to developers (versus sales, managers, etc). However, I do think PostHog&#8217;s transparent culture and open-source codebase is a mark of transparency that is to be appreciated.</p><p>They also have a key focus on product engineering and growth engineering. These are twists to the normal &#8220;stack engineers&#8221; we see - but I think simply having those titles sets the tone of the roles and company. Engineers come in knowing they are going to have to wear more hats. They aren&#8217;t here to just work on improving the backend or frontend - they are here to improve the product and grow it.</p><p>This seems like a small detail, but it&#8217;s really easy for people to lose sight of this a few months into the job.</p><h2><strong>Other great articles about product engineering</strong></h2><ul><li><p><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;The Pragmatic Engineer&quot;,&quot;id&quot;:458709,&quot;type&quot;:&quot;pub&quot;,&quot;url&quot;:&quot;https://open.substack.com/pub/pragmaticengineer&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/5ecbf7ac-260b-423b-8493-26783bf01f06_600x600.png&quot;,&quot;uuid&quot;:&quot;09066704-f648-472d-8940-0de595df60e6&quot;}" data-component-name="MentionToDOM"></span> has a great article about <a href="https://blog.pragmaticengineer.com/the-product-minded-engineer/">being product-minded</a>.</p></li></ul><ul><li><p><a href="https://posthog.com/blog/turning-engineers-into-product-people">Turning your engineers into Product People (PostHog)</a></p></li><li><p><a href="https://medium.com/codex/developer-vs-engineer-373d4a4ba22a">Developer vs. Engineer</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Meta's serverless platform processes trillions of function calls a day]]></title><description><![CDATA[XFaaS is Meta's private platform for "Hyperscale and Low Cost Serverless Functions." It is more efficient than AWS Lambda, Azure Functions, and Google Cloud Functions.]]></description><link>https://read.engineerscodex.com/p/meta-xfaas-serverless-functions-explained</link><guid isPermaLink="false">https://read.engineerscodex.com/p/meta-xfaas-serverless-functions-explained</guid><pubDate>Sun, 22 Oct 2023 17:32:27 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6a1508a8-1d52-4879-bc79-1d336d79f965_475x431.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter explaining real-world software engineering. </em></p><p><em>Author&#8217;s Note: These are my personal notes of reading the paper regarding Meta&#8217;s XFaaS.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Meta&#8217;s <a href="https://dl.acm.org/doi/abs/10.1145/3600006.3613155">XFaaS</a> is their serverless platform that &#8220;processes trillions of function calls per day on more than 100,000 servers spread across tens of datacenter regions.&#8221;<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></p><p>XFaaS is Meta&#8217;s internal version of public Function-as-a-Service (FaaS) options, such as AWS Lambda, Google Cloud Functions, and Azure Functions.</p><p>I was lucky enough to get an early look at <a href="https://drive.google.com/file/d/1FXejqjUgBfW_OSy3Q6FfwgnHEoV4FZPC/view">the paper</a> they wrote about it.</p><blockquote><p><em>Computer scientists aren&#8217;t really the most creative at naming, as there are two papers this year introducing &#8220;XFaaS.&#8221; One is by Meta, the other by IISC Bangalore scientists.</em></p><p><em>Both are completely different systems, so if you Google &#8220;XFaaS,&#8221; just know that this paper is talking about Meta&#8217;s version of the system.</em></p></blockquote><p>In this article, I start off with the high-level takeaways and lessons, for those who want a quick summary. <em>(estimated read time: 3 minutes)</em></p><p>Then, I do a more detailed walkthrough of the paper for those who want to understand the architecture behind XFaaS. <em>(estimated read time: 5 minutes)</em></p><h2>Interesting Stats and Takeaways</h2><ul><li><p>A key point of the paper is that hardware usage can be optimized by software to improve serverless performance.</p></li><li><p>Meta recognizes the wastage of startup overhead for serverless functions and aims to emulate <strong>a universal worker, i.e., any worker can execute any function instantly without startup overhead.</strong></p><ul><li><p>Hardware costs at scale are huge, and every percentage matters.&nbsp;</p></li></ul></li><li><p>XFaaS is <strong>only used for non-user-facing functions</strong>. Serverless functions have too much variable latency to be consistently used for user-facing functions.&nbsp;</p></li><li><p>The clients of XFaaS submit function calls in a highly spiky manner. <strong>The peak demand is 4.3 times higher </strong>than the off-peak demand.</p><ul><li><p>One example of load they demonstrate has <strong>20 million function calls submitted to XFaaS within 15 minutes.</strong></p></li><li><p>Meta found that even their spiky functions had patterns, which they leveraged to make spiky functions more predictable on their workload.</p></li></ul></li></ul><h3>How efficient is XFaaS?</h3><p><strong>XFaaS has achieved a daily average CPU utilization of 66%,</strong> <strong>much better than the industry average.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a-EQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a-EQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 424w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 848w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 1272w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a-EQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png" width="536" height="395.022696929239" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:552,&quot;width&quot;:749,&quot;resizeWidth&quot;:536,&quot;bytes&quot;:134134,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a-EQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 424w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 848w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 1272w, https://substackcdn.com/image/fetch/$s_!a-EQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bd07a12-9b95-4eda-9ac1-982db41abae2_749x552.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It efficiently <strong>spreads the load using time (by delaying functions) and space (by sending it to a less-loaded datacenter).</strong></p><blockquote><p><em>Meta is continuing to transition as many of their functions to being scheduled during off-peak hours, where the load and cost is more predictable.</em></p></blockquote><p>Since it&#8217;s an internal cloud, Meta is able to perform a lot of unique optimizations, such as running multiple functions from different users in the same process.</p><p>Most functions execute in less than a second, but not all.</p><div><hr></div><h4><strong><a href="https://swequiz.com/">SWE Quiz - Lifetime Access to 450+ system design questions</a></strong></h4><blockquote><p><strong><a href="https://swequiz.com/?utm_source=codex">SWE Quiz</a> is a compilation of 450+ software engineering and system design questions covering databases, authentication, caching, etc.</strong></p><p><strong>They&#8217;ve been created by engineers from Google, Meta, Apple, and more.</strong></p><p>It&#8217;s helped many of my peers (including myself) pass the &#8220;software trivia questions&#8221; during interviews and feel more confident at work.</p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://swequiz.com&quot;,&quot;text&quot;:&quot;Check out SWE Quiz&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://swequiz.com"><span>Check out SWE Quiz</span></a></p><div><hr></div><h3>Problems Solved by XFaaS</h3><p><strong>Problem: Lengthy cold start time.</strong></p><ul><li><p>If a container shuts down too early, the entire container must be initialized again for the next call.</p></li><li><p>If a container shuts down too late, it sits idle, wasting valuable compute resources.</p></li><li><p><strong>Solution: XFaaS uses methods like just-in-time compilation to approximate that every worker can instantly execute any function.</strong></p></li></ul><p><strong>Problem: High variance of load.</strong></p><ul><li><p>Results in extra hardware costs due to over-provisioning or in a slower system when under-provisioned</p></li><li><p><strong>Solution: XFaaS postpones running delay-tolerant functions until off-peak times and distributes function calls worldwide across datacenter regions.</strong></p></li></ul><p><strong>Problem: Overloading downstream services.</strong></p><ul><li><p>Example: Once, a spike in calls from non-user-facing-functions caused an outage for user-facing online services.</p></li><li><p><strong>Solution: XFaaS employs a mechanism similar to TCP congestion control to regulate the execution of functions.</strong></p></li></ul><h3>Comparisons with Public FaaS</h3><ul><li><p>Public cloud FaaS confines function executions to a single datacenter region, while XFaaS can dispatch function calls globally, allowing for better load balancing.</p></li></ul><ul><li><p>FaaS platforms focus on reducing latency first, overlooking hardware utilization. XFaaS focuses on hardware utilization and throughput of function calls.</p></li></ul><h4>Lessons for Public FaaS</h4><p>XFaaS techniques that could benefit public clouds include:</p><ul><li><p>Allowing callers to specify function execution start times.</p></li><li><p>Enabling function owners to set Service Level Objectives (SLOs) regarding completion deadlines. (Low SLOs can be delayed for a better time.)</p></li><li><p>Permitting function owners to assign criticality levels to functions.</p></li></ul><p>While public clouds might not run functions from different users in the same process like XFaaS, large cloud customers can adopt the XFaaS approach in their virtual private clouds.</p><p>A small number of Meta teams consume a significant portion of XFaaS&#8217;s capacity. Similar large customers in public clouds might also benefit from XFaaS&#8217;s strategies.</p><h2>Background: Assumptions and Requirements</h2><blockquote><p><em>This is where the detailed overview of XFaaS begins. Estimated read time: 5 minutes</em></p></blockquote><p>As mentioned before, XFaaS handles very spikey loads. At peak demand, just one function can receive 1.3 million calls per minute.</p><h3>Assumptions</h3><p>A key insight is that <strong>most XFaaS functions are triggered by automated workflows, which are okay with delays.</strong> Again, this allows XFaaS to balance load across time (by delaying functions) and space (by sending it to a less-loaded datacenter).</p><p>XFaaS supports runtimes for PHP, Python, Erlang, Haskell, and a generic container-based runtime for any language.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wOhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wOhQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 424w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 848w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 1272w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wOhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png" width="652" height="414.5092748735245" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:754,&quot;width&quot;:1186,&quot;resizeWidth&quot;:652,&quot;bytes&quot;:143222,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wOhQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 424w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 848w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 1272w, https://substackcdn.com/image/fetch/$s_!wOhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f229dcf-812f-4b33-b6b9-e99d80dbf965_1186x754.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A function has several attributes that developers can set, such as function name, arguments, runtime, criticality, execution start time, execution completion deadline, resource quota, concurrency limit, and retry policy. The execution completion deadline can range from seconds to 24 hours.</p><p><strong>Lastly, XFaaS has varying hardware capacity across regions, so load balancing must take this into account.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sfy4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sfy4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 424w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 848w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 1272w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sfy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png" width="468" height="278.27027027027026" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:352,&quot;width&quot;:592,&quot;resizeWidth&quot;:468,&quot;bytes&quot;:35269,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sfy4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 424w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 848w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 1272w, https://substackcdn.com/image/fetch/$s_!sfy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3884656c-9e04-4a1c-975c-89521f05fd4d_592x352.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Types of Workloads</h3><p>Meta has three types of workloads on XFaaS: <strong>queue-triggered functions</strong>, <strong>event-triggered functions</strong> (from data-change events in data warehouse and data-stream systems), and <strong>timer-triggered functions</strong> (auto-fired on a pre-set timing).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8XyQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8XyQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 424w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 848w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 1272w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8XyQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png" width="477" height="148" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:148,&quot;width&quot;:477,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8XyQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 424w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 848w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 1272w, https://substackcdn.com/image/fetch/$s_!8XyQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b1774c-4cc2-4e90-8f28-a4367e905ebf_477x148.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>XFaaS is used for non-user-facing functions, such as async recommendation systems, logging, productivity bots, notifications, and more.</p><h2>Overall architecture</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZdUf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZdUf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 424w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 848w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 1272w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZdUf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png" width="999" height="566" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:566,&quot;width&quot;:999,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZdUf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 424w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 848w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 1272w, https://substackcdn.com/image/fetch/$s_!ZdUf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a0560df-b6b4-4cf1-a2ba-97eecdefac30_999x566.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>Clients initiate function calls by sending a request to a submitter, which applies rate limits before passing it to the QueueLB (queue load balancer).</p><p>The QueueLB directs the function calls to a DurableQ for storage until completion.</p><p>Periodically, the scheduler moves these calls to its FuncBuffer (in-memory function buffer), sorting them by criticality, deadline, and quota.</p><p>Ready-to-execute calls move to the RunQ, and the WorkerLB (worker load balancer) then dispatches them to suitable workers.</p></blockquote><p>The submitter, QueueLB, scheduler, and WorkerLB are all stateless, unsharded, and replicated without a designated leader, so their replicas play equal roles.</p><p>DurableQ is stateful and has a sharded, highly available database.</p><p>Scaling a stateless component is easy by just adding more replicas. If a stateless component fails, it&#8217;s work can just be taken over by a peer.</p><h4>Central Controllers and Fault Tolerance</h4><p>Central controllers are separate from the function execution path. They <strong>continuously optimize the system</strong> by updating key configuration parameters, which are consumed by critical-path components like workers and schedulers.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TdAg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TdAg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 424w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 848w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 1272w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TdAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png" width="1138" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:1138,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15973,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TdAg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 424w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 848w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 1272w, https://substackcdn.com/image/fetch/$s_!TdAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba9a2bdc-46ce-461c-bebe-ef6d33fa3e8f_1138x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>&nbsp;These configs are cached in the components themselves, so if the central controllers fail, the system keeps running just fine (but it cannot be reconfigured).</p><p>This allows for central controller downtime for tens of minutes. It&#8217;s an example of how Meta has built resilience into this system.</p><h4>Data Isolation</h4><p>Functions that require strong isolation for security or performance are assigned to different namespaces, each using distinct worker pools to achieve physical isolation.</p><p>Multiple functions can operate in a single Linux process due to trust within a private cloud, mandatory peer reviews, and existing security measures. Data can only flow from lower to higher classification levels.</p><h3>Submitter</h3><p>The client sends calls to the submitter. The submitter improves efficiency by batching calls and writing them to DurableQ as one operation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cTqu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cTqu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 424w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 848w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 1272w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cTqu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png" width="773" height="303" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d407e927-0695-440c-991e-a10624b2adaa_773x303.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:303,&quot;width&quot;:773,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73003,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cTqu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 424w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 848w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 1272w, https://substackcdn.com/image/fetch/$s_!cTqu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd407e927-0695-440c-991e-a10624b2adaa_773x303.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The submitter manages large argument storage through a distributed key-value store and has built-in rate-limiting policies. To manage the variation in client submission rates, regions have two submitter sets for regular and high-frequency clients.&nbsp;</p><p>XFaaS actively monitors high-frequency clients, and human intervention is required for throttling or Service Level Objective (SLO) adjustments.</p><h3>QueueLB and DurableQ</h3><p>The submitter then sends function calls to the QueueLB. The <a href="https://research.facebook.com/publications/holistic-configuration-management-at-facebook/">Configerator</a> (Configuration Management System central controller) provides routing policies to the QueueLB to balance loads across different regions, as DurableQ hardware capacities vary.&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JJ69!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JJ69!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 424w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 848w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 1272w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JJ69!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png" width="824" height="426" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:426,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98418,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JJ69!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 424w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 848w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 1272w, https://substackcdn.com/image/fetch/$s_!JJ69!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f7a1ce0-1262-4335-bc89-3188d601e868_824x426.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Calls to DurableQs are sharded using UUIDs for equal distribution.&nbsp;Each DurableQ categorizes and stores function calls by their scheduled execution time, set by the caller.&nbsp;</p><p>The scheduler continuously queries DurableQs for stored function calls that are due. When a function call is handed over to a scheduler by a DurableQ, it is exclusive to that scheduler unless there's a failure in execution.</p><p>The scheduler communicates with the DurableQ:</p><ul><li><p><strong>Sends an ACK message for successful execution.</strong> Then the function call is permanently deleted from DurableQ.</p></li><li><p><strong>NACK for unsuccessful attempts.</strong> The function call is made available again in the DurableQ for another scheduler to process.</p></li></ul><h3>Scheduler</h3><p>A scheduler's primary role is to prioritize function calls based on their importance, deadline, and capacity quota.</p><p>It fetches function calls from DurableQs, consolidates them into FuncBuffers (ordered by importance, then execution deadline), and then arranges them in a RunQ for execution. Both FuncBuffers and RunQ are in-memory data structures.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!txbE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!txbE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 424w, https://substackcdn.com/image/fetch/$s_!txbE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 848w, https://substackcdn.com/image/fetch/$s_!txbE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 1272w, https://substackcdn.com/image/fetch/$s_!txbE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!txbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png" width="814" height="394" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:394,&quot;width&quot;:814,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98126,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!txbE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 424w, https://substackcdn.com/image/fetch/$s_!txbE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 848w, https://substackcdn.com/image/fetch/$s_!txbE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 1272w, https://substackcdn.com/image/fetch/$s_!txbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F310f68d2-b6fd-49d3-a375-27e0d30eb741_814x394.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To manage efficient execution and prevent system lags, the RunQ controls the flow of function calls. The system also ensures load balancing, with the Global Traffic Conductor (central controller) directing function call traffic across regions based on demand and capacity, optimizing worker utilization across the board.</p><h3>WorkerLB and Workers </h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PE33!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PE33!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 424w, https://substackcdn.com/image/fetch/$s_!PE33!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 848w, https://substackcdn.com/image/fetch/$s_!PE33!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 1272w, https://substackcdn.com/image/fetch/$s_!PE33!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PE33!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png" width="346" height="200.63905325443787" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:196,&quot;width&quot;:338,&quot;resizeWidth&quot;:346,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PE33!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 424w, https://substackcdn.com/image/fetch/$s_!PE33!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 848w, https://substackcdn.com/image/fetch/$s_!PE33!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 1272w, https://substackcdn.com/image/fetch/$s_!PE33!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f360de4-f2df-49f8-ad32-88fce4f94525_338x196.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The RunQ from the scheduler sends functions to the WorkerLB (worker load balancer), which has functions run by workers in a worker pool.</p><p>In the XFaaS system, functions that use the same programming language have isolation, with a dedicated runtime and worker pool.</p><p><strong>The system's design aims to allow immediate function execution by any worker without any initial delays.</strong>&nbsp;XFaaS maintains an always-active runtime and keeps functions&#8217; code updated on local SSDs.</p><h4>Cooperative Just-In-Time (JIT) Compilation to Reduce Overhead</h4><p>XFaaS introduces cooperative JIT compilation, periodically bundling and pushing function code to workers. Since code is frequently updated, this is necessary.</p><p>There are three execution phases to JIT compilation:</p><ul><li><p>A few workers test the new code.</p></li><li><p>2% of workers further test the code; some perform profiling for JIT compilation.</p></li><li><p>JIT compilation is done right before receiving function calls, eliminating delays.</p></li></ul><p>With cooperative JIT compilation, a worker reached its maximum requests-per-second in only 3 minutes after a function code update, compared to 21 minutes without JIT compilation.</p><h4><strong>Locality Groups for Efficient Memory Consumption</strong></h4><p>Memory constraints make storing every function's JIT code infeasible.</p><p>The Locality Optimizer (central controller) partitions functions and workers into groups, ensuring memory-hungry functions are distributed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h782!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h782!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 424w, https://substackcdn.com/image/fetch/$s_!h782!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 848w, https://substackcdn.com/image/fetch/$s_!h782!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 1272w, https://substackcdn.com/image/fetch/$s_!h782!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h782!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png" width="442" height="279.6077348066298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:724,&quot;resizeWidth&quot;:442,&quot;bytes&quot;:137238,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h782!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 424w, https://substackcdn.com/image/fetch/$s_!h782!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 848w, https://substackcdn.com/image/fetch/$s_!h782!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 1272w, https://substackcdn.com/image/fetch/$s_!h782!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24522eb7-6a1c-4fa9-b314-4d83e4c3e5c3_724x458.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Using locality groups reduced memory consumption by 11-12% and allowed for efficient, consistent memory utilization by workers.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3cM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3cM_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 424w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 848w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 1272w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3cM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png" width="445" height="229.05545927209707" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:297,&quot;width&quot;:577,&quot;resizeWidth&quot;:445,&quot;bytes&quot;:56678,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3cM_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 424w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 848w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 1272w, https://substackcdn.com/image/fetch/$s_!3cM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26eef250-1a38-44fa-96b3-f89d2793fb65_577x297.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>How XFaaS Efficiently Handles Load Spikes</h3><ul><li><p><strong>Quota for Functions</strong>: Every function has a quota, set by its owner, which defines its CPU cycles per second. This quota is transformed into a requests-per-second (RPS) rate limit. The Central Rate Limiter determines whether to throttle function calls based on the function's RPS limit.</p></li></ul><ul><li><p><strong>Time-Shifting Computing</strong>: XFaaS provides reserved (for prompt execution) and opportunistic quotas (for execution within 24 hours during low-demand periods). The Utilization Controller dynamically adjusts the rate of function invocations based on worker utilization.</p></li></ul><ul><li><p><strong>Dynamic RPS Limits for Functions</strong>: To prevent overburdening downstream services, XFaaS utilizes a TCP-like <a href="https://en.wikipedia.org/wiki/Additive_increase/multiplicative_decrease#:~:text=The%20additive%2Dincrease%2Fmultiplicative%2D,reduction%20when%20congestion%20is%20detected.">AIMD (Additive Increase, Multiplicative Decrease) method</a> to adjust the RPS limits dynamically. It can set concurrency levels and manage RPS shifts using a slow start approach.</p></li></ul><p>Past challenges, like an XFaaS function overloading the <a href="https://research.facebook.com/publications/tao-facebooks-distributed-data-store-for-the-social-graph/">TAO database</a> causing a service cascade failure, highlighted the need for these safeguards. Now, XFaaS has proven its adeptness in shielding downstream services, as seen in real-world incidents where its back-pressure mechanism preemptively curbed potential overloads, ensuring service stability.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2>My Opinion</h2><p><strong>This is a fantastic paper.</strong> Meta gives us a deep, honest look into their own serverless platform while providing clear lessons for developers and companies who want to optimize their own serverless function usage. <a href="https://dl.acm.org/doi/abs/10.1145/3600006.3613155">The paper can be found here, though you might need institutional access to read it for free.</a></p><p>Furthermore, hardware optimization using software, such as efficient CPU usage, isn&#8217;t focused on enough in the industry. It&#8217;s not talked about much compared to software optimizations.</p><p>In the meantime, if you&#8217;re interested in other real-world distributed systems, <strong><a href="https://engineercodex.substack.com/p/how-facebook-scaled-memcached">I also wrote about how Meta handled billions of requests a second by creating the largest Memcached system in the world. Read it here.</a></strong></p><p>If you have any questions about any parts of the paper or system, please do leave a comment below. I will answer them.</p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="https://dl.acm.org/doi/abs/10.1145/3600006.3613155">XFaaS: Hyperscale and Low Cost Serverless Functions at Meta</a></p></div></div>]]></content:encoded></item><item><title><![CDATA[How to burnout a software engineer, in 3 easy steps]]></title><description><![CDATA[The Burnout Playbook for software engineers]]></description><link>https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer</guid><pubDate>Mon, 16 Oct 2023 00:26:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c892659e-bb29-4fac-84e5-2f1c90d93a20_922x860.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter about lessons from real-world engineering.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>If you&#8217;re a manager who wants to burnout your best engineers and destroy their faith in your leadership skills, I can help you. </p><p>I&#8217;ve watched as smart engineers around me have burnt out before in both Big Tech and at a small startup. These teams follow the same &#8220;burnout playbook,&#8221; step-by-step.</p><h2><strong>Step 1: Don&#8217;t trust your engineers</strong></h2><p>The first step is to micromanage your engineers. Sure, they&#8217;re smart, but do they <em>truly understand what you want the product to look like?</em> Probably not.</p><p>When I was leading engineering at the startup, I worked alongside the CEO. He would call me daily, for hours, nitpicking at little implementation details that had no effect on the actual user experience. <em>Are you sure we should use DynamoDB? Why does this Lambda function use Python instead of Node?</em>&nbsp;</p><p><strong>It was exhausting to get pinged so much. </strong></p><p>At my team in Big Tech, I also was given a limited amount of autonomy. Not necessarily because of my manager, but because of the system. </p><p>I remember working on a design for a system I was building.</p><blockquote><p><em>I was subtly told: &#8220;We need to implement this project in this way. I know it will take a month longer, but I need it in this way [so that it looks better on my promo packet</em>].</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-5lq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-5lq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 424w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 848w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 1272w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-5lq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png" width="595" height="287" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:287,&quot;width&quot;:595,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-5lq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 424w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 848w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 1272w, https://substackcdn.com/image/fetch/$s_!-5lq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2c3093-4e2f-472e-9375-2a0bca59ef34_595x287.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/mbrandolph/status/1705809400068497918">Marc Randolph co-founded Netflix.</a></figcaption></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Step 2: Introduce unnecessary, time-wasting processes.</strong></h2><p>When I worked at the startup, I was suddenly forced one day to start writing out huge design docs before I ever implemented anything. Every single little API endpoint created had to be discussed extensively beforehand. Suddenly, shipping a feature went from a few days to a few weeks. It was frustrating.</p><p>The worst part? We hadn&#8217;t even shipped our product yet! There was no point of all these processes before we even had an inkling of revenue.</p><p>Look, Google has a culture of <a href="https://www.industrialempathy.com/posts/design-docs-at-google/">many, many design docs and one-pagers</a>. But, at a startup, <strong><a href="https://blog.bradfieldcs.com/you-are-not-google-84912cf44afb">you are not Google</a></strong>. Google needs a writing culture because they are massive and people are joining and leaving all the time.&nbsp;</p><p>This can go overboard. At a certain team in Big Tech, the amount of processes often took too long. To access certain types of data, I had to file a request that was manually approved by another team, leaving me blocked for days. To launch my feature, I had to get approval from security, product, engineering, legal, compliance, and the CEO&#8217;s dog.</p><p>Some days, all I would do is edit documents, send email, read documentation, and reply to people. I did things that had 0 impact, and that&#8217;s not because I wanted to.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z8-y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z8-y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 424w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 848w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 1272w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z8-y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png" width="601" height="178" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:178,&quot;width&quot;:601,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z8-y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 424w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 848w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 1272w, https://substackcdn.com/image/fetch/$s_!z8-y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ef030d1-a8c8-4123-bd7e-da74268e8249_601x178.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/eshear/status/1561120335331594240">Emmett Shear co-founded Twitch.</a></figcaption></figure></div><p>Of course, these processes are needed&#8230; but there needs to be a balance. Not every project an engineer works on has to go through these processes, and they shouldn&#8217;t. Luckily, not every team at Big Tech is like this. In fact, most aren&#8217;t.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer/comments"><span>Leave a comment</span></a></p><h2><strong>Step 3: Don&#8217;t ship code to customers.</strong></h2><p>There&#8217;s nothing worse than working on something for 8 months that nobody will ever see. Especially if those 8 months were full of long hours.</p><p>Even worse: those 8 months gets pushed to 12, 16, 20. And then, the product gets cut and what you worked on is <em>never</em> shipped to anybody to use. </p><p><strong>Working on projects that never ship is, anecdotally, one of the largest causes of burnout.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oqxC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oqxC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 424w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 848w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 1272w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oqxC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png" width="1156" height="586" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:586,&quot;width&quot;:1156,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:145373,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oqxC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 424w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 848w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 1272w, https://substackcdn.com/image/fetch/$s_!oqxC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f03b99b-629c-4f15-9383-5dea8876743b_1156x586.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.intercom.com/blog/shipping-is-your-companys-heartbeat/">Shipping is your company&#8217;s heartbeat (2013)</a></figcaption></figure></div><p>At the startup I worked at, we toiled away at the product for over a year without ever shipping to a customer once. Each time we would think the product was ready to ship, our CEO would ask for &#8220;just a few more features.&#8221; After a while, the team lost faith in the CEO&#8217;s ability to execute. It was hard to care deeply about something where the only feedback we got was from our CEO&#8217;s ideas and not actual users.</p><p>Products should be bug-free and have a nice user experience when they ship. <em>But they don&#8217;t have to be perfect. </em>If he kept inching towards perfection, then we were in for a very bad time. Especially since we hadn&#8217;t reached product-market fit yet.</p><blockquote><p><em>Perfectionism is often an excuse for procrastination.</em></p><p><em>Looking back, I think our CEO was just procrastinating actually selling the product and receiving critical feedback.</em></p></blockquote><p>At the Big Tech team I was in, we had constant re-orgs as Directors and VPs came and went. Each re-org came with a new executive, who had a new vision for the organization. This meant requirements changed constantly, many projects we worked on for months or years were scrapped, and we never got to see the real-world impact of our projects.</p><p>Not shipping to customers happens because of a lack of focus. When there&#8217;s no strong vision leading a product, that product is doomed to fail.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vx4s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vx4s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 424w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 848w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 1272w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vx4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png" width="1180" height="326" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:326,&quot;width&quot;:1180,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:82220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vx4s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 424w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 848w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 1272w, https://substackcdn.com/image/fetch/$s_!vx4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44173fcb-0fd2-4417-8265-2a22522a61e4_1180x326.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://twitter.com/JonErlichman/status/1404479095472373761">Source</a></figcaption></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/p/how-to-burnout-a-software-engineer/comments"><span>Leave a comment</span></a></p><h2><strong>Bonus step: Overpromise and underdeliver</strong></h2><p>This step is a culmination of all the above ones. The nail in the coffin, if you will.</p><p>Most engineers on these teams were over-promised benefits that never came.</p><p>At my startup, during the year of working on a product that never shipped, the CEO spent time fundraising. While I initially had a significant equity stake in the company, fundraising before product-market fit meant my stake was getting diluted. A lot. Suddenly, the financial incentive of the startup disappeared for me - I would make just as much working at Big Tech over the span of a decade even if the startup exited for $1B. Except Big Tech compensation was fully liquid and guaranteed, and a $1B exit is increasingly rare in this environment.</p><p>At Big Tech, every engineer that left had joined because of the following reasons:</p><ul><li><p><strong>Product vision:</strong> they were passionate about the product and the problems it solved</p></li><li><p><strong>Scope/visibility</strong>: they felt like they would have opportunities for more scope, and therefore, more growth</p></li><li><p><strong>Better promotion chances</strong>: more scope and visibility &#8594; promotion</p></li></ul><p>Unfortunately, every year, each engineer lost a little bit more hope in their goals being achieved.</p><p><strong>Hopelessness accelerates burnout.</strong></p><p>The reason they had joined simply wasn&#8217;t happening. When their hope dipped below a certain threshold, they left.</p><p>And eventually, burnout caught up to me too. So I left.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Key Lessons on Burnout</strong></h2><h4><strong>Burnout doesn&#8217;t necessarily come from hours worked. </strong></h4><p>Today, I work more than I did on the teams where I burnt out. Yet, I feel amazing. I&#8217;m having fun, growing, and I visibly see the impact my work is having on users.</p><blockquote><p><em>I want to note that burnout CAN come from working too much. Remote work has enabled more opportunities for burnout due to the reduced separation of work and life. </em></p><p><em>It&#8217;s easy to feel as if you&#8217;re on &#8220;permanent on-call.&#8221;</em></p></blockquote><h4><strong>Burnout happens when my work doesn&#8217;t matter.</strong> </h4><p>If I&#8217;m putting all this time and effort into something, I want some sort of outcome from it.&nbsp;</p><p>There is a sense of accomplishment in being given autonomy over a project and shipping it. </p><p>I&#8217;d rather have my project fail and be a bust over not shipping at all!</p><h4><strong>I need to be attached to the mission</strong>.&nbsp;</h4><p>These experiences made me realize that I need to be attached to the mission of the team. If I don&#8217;t care about the product area or what the team can teach me, then that&#8217;s a recipe for burnout.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zf1l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zf1l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 424w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 848w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 1272w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zf1l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png" width="595" height="171" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:171,&quot;width&quot;:595,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Zf1l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 424w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 848w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 1272w, https://substackcdn.com/image/fetch/$s_!Zf1l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0b12fd-837c-4bb5-a3a6-7f66b398f52f_595x171.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is different for everyone. While my satisfaction comes from the mission of my work, for others, it may come from working with other people,  getting a paycheck that supports their family, or growing their skills.</p><h4><strong>Burnout is more common than I thought.</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GK5l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GK5l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 424w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 848w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 1272w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GK5l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png" width="898" height="522" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:522,&quot;width&quot;:898,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GK5l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 424w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 848w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 1272w, https://substackcdn.com/image/fetch/$s_!GK5l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7348fad-22e4-4919-ad29-1a5ba9a1c246_898x522.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.mckinsey.com/featured-insights/sustainable-inclusive-growth/chart-of-the-day/employee-burnout-is-ubiquitous-alarming-and-still-underreported">Source: McKinsey</a></figcaption></figure></div><h4>I&#8217;ve read some other great articles about burnout. </h4><p>My friend <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Irina Stanescu&quot;,&quot;id&quot;:4332862,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/321918c5-41fa-4bf8-bf6a-c8711783d74d_1242x1213.jpeg&quot;,&quot;uuid&quot;:&quot;1d6a1aaa-fedb-4e28-a4b7-99f6db508999&quot;}" data-component-name="MentionToDOM"></span> wrote some fantastic articles about burnout that are worth reading.</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:117921397,&quot;url&quot;:&quot;https://www.thecaringtechie.com/p/10-anti-burnout-strategies-for-success&quot;,&quot;publication_id&quot;:341480,&quot;publication_name&quot;:&quot;Musings Of A Caring Techie&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png&quot;,&quot;title&quot;:&quot;10 Anti-burnout strategies for success in an early-stage startup&quot;,&quot;truncated_body_text&quot;:&quot;Anybody who joins an early-stage startup is out of their mind. That&#8217;s what I used to believe. I mean, how can they not be? The intense pressure and uncertainty of early-stage companies can easily lead to burnout and derail even the most driven individuals. And burnout sucks. I learned it the hard way (I talk about my burnout experience at length&quot;,&quot;date&quot;:&quot;2023-05-03T13:36:16.542Z&quot;,&quot;like_count&quot;:14,&quot;comment_count&quot;:7,&quot;bylines&quot;:[{&quot;id&quot;:4332862,&quot;name&quot;:&quot;Irina Stanescu&quot;,&quot;handle&quot;:&quot;thecaringtechie&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/321918c5-41fa-4bf8-bf6a-c8711783d74d_1242x1213.jpeg&quot;,&quot;bio&quot;:&quot;Staff Software Engineer turned hands-on leader and leadership coach. Ex-Google, ex-Uber, currently at an early stage startup. \n\nI write a bi-weekly newsletter for leaders and ICs about leadership, tech culture and building a thriving career.&quot;,&quot;profile_set_up_at&quot;:&quot;2021-04-26T22:53:28.565Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:262680,&quot;user_id&quot;:4332862,&quot;publication_id&quot;:341480,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:341480,&quot;name&quot;:&quot;Musings Of A Caring Techie&quot;,&quot;subdomain&quot;:&quot;thecaringtechie&quot;,&quot;custom_domain&quot;:&quot;www.thecaringtechie.com&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Lessons and stories about humans, leadership, and career growth based on my experience at Big Tech (Google, Uber) and early-stage startups. \n\nIf you're a high-performing engineer or engineering leader, this is the place for you!&quot;,&quot;logo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png&quot;,&quot;author_id&quot;:4332862,&quot;theme_var_background_pop&quot;:&quot;#67bdfc&quot;,&quot;created_at&quot;:&quot;2021-04-20T02:08:08.146Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Irina Stanescu from The Caring Techie&quot;,&quot;copyright&quot;:&quot;Irina Stanescu&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;,&quot;language&quot;:null}}],&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.thecaringtechie.com/p/10-anti-burnout-strategies-for-success?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!5lBV!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png" loading="lazy"><span class="embedded-post-publication-name">Musings Of A Caring Techie</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">10 Anti-burnout strategies for success in an early-stage startup</div></div><div class="embedded-post-body">Anybody who joins an early-stage startup is out of their mind. That&#8217;s what I used to believe. I mean, how can they not be? The intense pressure and uncertainty of early-stage companies can easily lead to burnout and derail even the most driven individuals. And burnout sucks. I learned it the hard way (I talk about my burnout experience at length&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; 14 likes &#183; 7 comments &#183; Irina Stanescu</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:35826203,&quot;url&quot;:&quot;https://www.thecaringtechie.com/p/burnout-in-tech-part-1-declaring&quot;,&quot;publication_id&quot;:341480,&quot;publication_name&quot;:&quot;Musings Of A Caring Techie&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png&quot;,&quot;title&quot;:&quot;Burnout in Tech - Part 1: Declaring War&quot;,&quot;truncated_body_text&quot;:&quot;People working in Tech are privileged. We don&#8217;t deal with occupational hazards; we are paid well, have access to wonderful perks; and most importantly: we get to build things with talented like-minded individuals. The appeal is obvious! Behind the scenes, however, sometimes things include long hours, performance reviews graded on a curve, very tight dea&#8230;&quot;,&quot;date&quot;:&quot;2021-05-04T18:11:19.169Z&quot;,&quot;like_count&quot;:22,&quot;comment_count&quot;:1,&quot;bylines&quot;:[{&quot;id&quot;:4332862,&quot;name&quot;:&quot;Irina Stanescu&quot;,&quot;handle&quot;:&quot;thecaringtechie&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/321918c5-41fa-4bf8-bf6a-c8711783d74d_1242x1213.jpeg&quot;,&quot;bio&quot;:&quot;Staff Software Engineer turned hands-on leader and leadership coach. Ex-Google, ex-Uber, currently at an early stage startup. \n\nI write a bi-weekly newsletter for leaders and ICs about leadership, tech culture and building a thriving career.&quot;,&quot;profile_set_up_at&quot;:&quot;2021-04-26T22:53:28.565Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:262680,&quot;user_id&quot;:4332862,&quot;publication_id&quot;:341480,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:341480,&quot;name&quot;:&quot;Musings Of A Caring Techie&quot;,&quot;subdomain&quot;:&quot;thecaringtechie&quot;,&quot;custom_domain&quot;:&quot;www.thecaringtechie.com&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Lessons and stories about humans, leadership, and career growth based on my experience at Big Tech (Google, Uber) and early-stage startups. \n\nIf you're a high-performing engineer or engineering leader, this is the place for you!&quot;,&quot;logo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png&quot;,&quot;author_id&quot;:4332862,&quot;theme_var_background_pop&quot;:&quot;#67bdfc&quot;,&quot;created_at&quot;:&quot;2021-04-20T02:08:08.146Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Irina Stanescu from The Caring Techie&quot;,&quot;copyright&quot;:&quot;Irina Stanescu&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;,&quot;language&quot;:null}}],&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.thecaringtechie.com/p/burnout-in-tech-part-1-declaring?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!5lBV!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86cf7d99-7392-4bee-af0c-78f8c595a75f_1280x1280.png" loading="lazy"><span class="embedded-post-publication-name">Musings Of A Caring Techie</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Burnout in Tech - Part 1: Declaring War</div></div><div class="embedded-post-body">People working in Tech are privileged. We don&#8217;t deal with occupational hazards; we are paid well, have access to wonderful perks; and most importantly: we get to build things with talented like-minded individuals. The appeal is obvious! Behind the scenes, however, sometimes things include long hours, performance reviews graded on a curve, very tight dea&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">5 years ago &#183; 22 likes &#183; 1 comment &#183; Irina Stanescu</div></a></div><p>Plus a nice little comic I found:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dSj8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dSj8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dSj8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg" width="960" height="960" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:960,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;r/comics - Burnout is real [OC]&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="r/comics - Burnout is real [OC]" title="r/comics - Burnout is real [OC]" srcset="https://substackcdn.com/image/fetch/$s_!dSj8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dSj8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbc284e6-4d13-4c37-af9b-28411f7cc56d_960x960.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.reddit.com/r/comics/comments/lwwvvr/burnout_is_real_oc/">Source</a></figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[How Airbnb Scaled by Moving Away From a Monolith]]></title><description><![CDATA[4 lessons from Airbnb's scaling strategy, with comparisons to other big tech companies]]></description><link>https://read.engineerscodex.com/p/how-airbnb-scaled-by-moving-away</link><guid isPermaLink="false">https://read.engineerscodex.com/p/how-airbnb-scaled-by-moving-away</guid><pubDate>Wed, 11 Oct 2023 01:05:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Engineer&#8217;s Codex is a newsletter about real-world engineering. </em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Airbnb started as simple Ruby on Rails monolith in 2008.</p><p>In 2018, Airbnb began its migration to a service-oriented architecture, as the Ruby on Rails &#8220;monorail&#8221; started becoming hard to maintain and was a single point of failure.</p><blockquote><p>The main difference between SOA and microservices has to do with the architecture scope. </p><p>In an SOA model, services or modules are shared and reused enterprise-wide, whereas a microservice architecture is built on individual services that function independently. (<a href="https://www.crowdstrike.com/cybersecurity-101/cloud-security/soa-vs-microservices/">Source</a>)</p></blockquote><p>While Airbnb didn&#8217;t necessarily need to move to a SOA, they chose to as it made sense for their organizational needs.</p><p>In a recent <a href="https://www.infoq.com/presentations/airbnb-scalability/">2023 talk</a>, they outlined four lessons:</p><ul><li><p><strong>Invest in shared infrastructure early</strong></p></li><li><p><strong>Simplify service dependencies</strong></p></li><li><p><strong>Centralize data hydration (fetching and transformation)</strong></p></li><li><p><strong>Separate UI logic from backend logic</strong></p></li></ul><p>In this article, I summarize the talk and make architecture comparisons with other large tech companies, like Meta, Google, and Uber.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2>Invest in shared infrastructure early</h2><p>Airbnb built common infrastructure shared by teams across services.</p><ol><li><p><strong>In-house API framework built on Apache <a href="https://thrift.apache.org/">Thrift</a></strong> </p><ol><li><p>Allowed all Airbnb services to define clean APIs and communicate with each other. </p></li><li><p>The framework handled inter-service communication, error propagation, observability metrics, and schema validation.</p></li><li><p>Engineers could focus on implementing core business logic.</p></li><li><p><a href="https://github.com/facebook/fbthrift">Facebook/Meta uses a customized, internal version of Apache Thrift called fbthrift, which they have open-sourced.</a></p></li><li><p>Google, Netflix, Square, and other companies use <a href="https://grpc.io/">gRPC</a>.</p></li></ol></li><li><p><strong>Powergrid</strong>: An in-house library for running tasks in parallel</p><ol><li><p>Helped organize code into a directed acyclic graph (DAG), enabling tasks to run concurrently. </p></li><li><p>Useful for tasks like validation and data aggregation.</p></li></ol></li><li><p><strong><a href="https://medium.com/airbnb-engineering/dynamic-kubernetes-cluster-scaling-at-airbnb-d79ae3afa132">OneTouch</a></strong>: A framework built on Kubernetes for managing services and deploying them efficiently. </p><ol><li><p>Ensured that all service configurations were managed in one place.</p></li><li><p>Provided a command-line tool for deploying services to different environments.</p></li><li><p><a href="https://research.google/pubs/pub43438/">Google uses Borg as a cluster manager.</a> It was a <a href="https://kubernetes.io/blog/2015/04/borg-predecessor-to-kubernetes/">predecessor to Kubernetes</a>. <a href="https://news.ycombinator.com/item?id=17175716">Google and</a> <a href="https://cloud.google.com/blog/products/bigquery/bigquery-under-the-hood#:~:text=most%20traditional%20databases.-,Borg%3A%20Compute,-To%20give%20you">Google Cloud run on Borg.</a></p></li><li><p><a href="https://engineering.fb.com/2019/06/06/data-center-engineering/twine/">Facebook/Meta uses Twine for cluster management.</a></p></li></ol></li><li><p><strong><a href="https://spinnaker.io/">Spinnaker</a></strong>: An open-source continuous delivery platform that facilitated safe and repeatable workflows for deploying changes to production. </p><ol><li><p>Featured automated canary analysis to ensure smooth deployments at scale.</p></li><li><p><em><strong><a href="https://spinnaker.io/docs/guides/user/canary/">Automated canary analysis</a></strong></em> lets you partially roll out a change then evaluate it against the current deployment to assess its performance.</p></li><li><p>Spinnaker was created at Netflix.</p></li><li><p>Uber has a fantastic talk about <a href="https://www.infoq.com/articles/uber-deployment-planet-scale/">safe and fast deploys at planet scale</a>.</p></li></ol></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p_9H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p_9H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 424w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 848w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 1272w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p_9H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png" width="1456" height="338" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:338,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:143088,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p_9H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 424w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 848w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 1272w, https://substackcdn.com/image/fetch/$s_!p_9H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f2a590-b3b6-401c-9a71-0bb811f634b9_2754x640.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://www.infoq.com/presentations/airbnb-scalability/">Source</a></figcaption></figure></div><p>By investing in this common infrastructure, Airbnb was able to accelerate its migration to SOA and reap the benefits of higher reliability and business agility.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2>Simplify service dependencies</h2><p>As Airbnb continued to scale its architecture, the team separated services into layers based on technical priorities. This approach helped reduce complexity and ensure that stable services did not depend on more volatile ones. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F4ze!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F4ze!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 424w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 848w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 1272w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F4ze!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png" width="1162" height="506" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:506,&quot;width&quot;:1162,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72208,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!F4ze!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 424w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 848w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 1272w, https://substackcdn.com/image/fetch/$s_!F4ze!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d46e9e3-f646-4abe-90ba-a26d8686a877_1162x506.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.infoq.com/presentations/airbnb-scalability/">Service Tiers</a></figcaption></figure></div><p>A higher-tier service could call a lower-tier service, but not vice versa. To enforce this topology-driven layer architecture, Airbnb introduced <strong>service blocks at the platform layer</strong>, each containing related business functionalities.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m3KQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m3KQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 424w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 848w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 1272w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m3KQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png" width="774" height="314" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:314,&quot;width&quot;:774,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44845,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!m3KQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 424w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 848w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 1272w, https://substackcdn.com/image/fetch/$s_!m3KQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed43c866-e0b1-4754-9d88-33618ed50c6c_774x314.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.infoq.com/presentations/airbnb-scalability/">Example of service blocks</a></figcaption></figure></div><p>These blocks encapsulated both data and business logic, offering a simple and consistent API to upstream clients. This approach simplified service dependencies, making it easier for engineers to discover and leverage core functionality.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2>C<strong>entralize data hydration (fetching and transformation)</strong></h2><blockquote><p><strong>Data hydration</strong> is the process of importing data into an object.</p></blockquote><p>It&#8217;s a common task in presentation services, involving fetching and merging data from multiple downstream services. </p><p>To streamline this process and avoid duplication (which is expensive at scale!), Airbnb introduced a <strong>centralized data access layer.</strong> This layer provided a consolidated GraphQL schema that stitched together different entities, such as listings, users, and reservations, from various data sources. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fD2w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fD2w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 424w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 848w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 1272w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fD2w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png" width="1151" height="636" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:636,&quot;width&quot;:1151,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:112271,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fD2w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 424w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 848w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 1272w, https://substackcdn.com/image/fetch/$s_!fD2w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09e5751c-4652-4cb6-b653-6f10ca1367b3_1151x636.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>By centralizing data fetching and hydration logic, engineers could focus on product innovation rather than writing the same data hydration code repeatedly. </p><p>The data access layer also introduced a declarative approach to data retrieval, enabling engineers to write queries based on the data they needed, reducing potential errors and improving efficiency.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dgdQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dgdQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 424w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 848w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 1272w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dgdQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png" width="1367" height="637" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:637,&quot;width&quot;:1367,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:180887,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dgdQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 424w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 848w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 1272w, https://substackcdn.com/image/fetch/$s_!dgdQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613bd64f-e593-4779-a41b-65fba1092a1c_1367x637.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Separate UI logic from backend logic</strong></h2><p>To ensure a consistent user experience and streamline development, Airbnb introduced the <strong>App Framework, a unified, service-driven UI system</strong>. This framework allowed Airbnb to present a standardized API to clients and stopped engineers from constantly re-inventing the wheel with their own custom APIs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mqx0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mqx0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 424w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 848w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 1272w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mqx0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png" width="1456" height="396" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:396,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67211,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Mqx0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 424w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 848w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 1272w, https://substackcdn.com/image/fetch/$s_!Mqx0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F695b653b-94d8-40c2-a73c-8f7b02e69d38_1566x426.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The backend drove the content and styling of the UI within each section of a rendered frontend page. The frontend was mostly responsible for rendering each section.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BTWe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BTWe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 424w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 848w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 1272w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BTWe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png" width="560" height="587.2174969623329" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:823,&quot;resizeWidth&quot;:560,&quot;bytes&quot;:154468,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BTWe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 424w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 848w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 1272w, https://substackcdn.com/image/fetch/$s_!BTWe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c0a496-fba2-4622-a3de-48a257ea4694_823x863.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The team broke down the UI into standardized sections, each with its data model and UI component type. This approach provided clear patterns for reusability and customization, allowing product teams to launch new features across clients without mobile app versioning or frontend deploys. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OOJz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OOJz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 424w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 848w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 1272w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OOJz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png" width="1456" height="747" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:747,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:190593,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OOJz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 424w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 848w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 1272w, https://substackcdn.com/image/fetch/$s_!OOJz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb7f9ed9-cbef-4863-9de1-7ed42b9d0d6c_1650x846.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>UI data was sent in from the backend.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vkoz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vkoz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 424w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 848w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 1272w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vkoz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png" width="1456" height="841" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:841,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:238378,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Vkoz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 424w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 848w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 1272w, https://substackcdn.com/image/fetch/$s_!Vkoz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c935a1d-20b3-4f03-8679-43c2140e26ff_1502x868.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://www.infoq.com/presentations/airbnb-scalability/">They also showed off some handy dev tooling.</a></figcaption></figure></div><p>Standardizing the client-facing API is a common move for companies as they scale. <a href="https://doordash.engineering/2021/02/09/serving-multiple-websites-and-business-logic-from-a-single-platform/">DoorDash had a great post about their experiences with separation too</a>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.engineerscodex.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.engineerscodex.com/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Takeaways</strong></h2><ul><li><p><strong>Undoing work is normal</strong>. Throughout the entire process, Airbnb usually had to undo earlier work. While it can be painful to delete code, <a href="https://engineercodex.substack.com/p/7-simple-habits-of-the-top-1-of-engineers">it&#8217;s important to stay detached from it.</a></p></li><li><p><strong>Splitting out services allow teams to move at different speeds.</strong> At Airbnb, frontend teams commonly moved faster than other areas. The above move allowed each team to move forward at their own pace rather than be held back or pulled forward by another team.</p></li><li><p><strong>Make the move only when you have to</strong>. Airbnb operated fine on a single Rails monolith for a decade! They only made the migration to a SOA after it was getting really painful to continue development on the monolith.</p></li><li><p><strong>Microservices are more for scaling organizations than applications.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://engineercodex.substack.com/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share Engineer&#8217;s Codex&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://engineercodex.substack.com/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share"><span>Share Engineer&#8217;s Codex</span></a></p>]]></content:encoded></item></channel></rss>