<?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[The Coder Cafe: Concepts]]></title><description><![CDATA[Learn one concept with your coffee.]]></description><link>https://read.thecoder.cafe/s/concepts</link><image><url>https://substackcdn.com/image/fetch/$s_!OZXv!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08792c7-cadb-478c-bce4-a10c5dc5ac05_1280x1280.png</url><title>The Coder Cafe: Concepts</title><link>https://read.thecoder.cafe/s/concepts</link></image><generator>Substack</generator><lastBuildDate>Fri, 17 Apr 2026 15:58:54 GMT</lastBuildDate><atom:link href="https://read.thecoder.cafe/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Teiva Harsanyi]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[thecodercafe@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[thecodercafe@substack.com]]></itunes:email><itunes:name><![CDATA[Teiva Harsanyi]]></itunes:name></itunes:owner><itunes:author><![CDATA[Teiva Harsanyi]]></itunes:author><googleplay:owner><![CDATA[thecodercafe@substack.com]]></googleplay:owner><googleplay:email><![CDATA[thecodercafe@substack.com]]></googleplay:email><googleplay:author><![CDATA[Teiva Harsanyi]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How an SSD Works]]></title><description><![CDATA[Your SSD doesn't just store data, it relies on quantum physics to do it.]]></description><link>https://read.thecoder.cafe/p/how-an-ssd-works</link><guid isPermaLink="false">https://read.thecoder.cafe/p/how-an-ssd-works</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 15 Apr 2026 10:01:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8SqT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we explore quantum physics. Not the abstract kind, but the kind that runs inside the device you are reading this on. Indeed, every time you save a file to an SSD, electrons exploit quantum physics to cross a physical barrier they classically have no business crossing. I&#8217;m not a physicist, but I&#8217;ve been in love with quantum physics for years, and over the last few months I've gone deep into these concepts. Get cozy, grab a coffee, and let&#8217;s begin!</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_!8SqT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8SqT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1653007,&quot;alt&quot;:&quot;Your SSD doesn't just store data, it relies on quantum physics to do it.&quot;,&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;:&quot;https://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Your SSD doesn't just store data, it relies on quantum physics to do it." title="Your SSD doesn't just store data, it relies on quantum physics to do it." srcset="https://substackcdn.com/image/fetch/$s_!8SqT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.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><h1>An Introduction to Matter</h1><p>To start, what is matter? Matter is made up of molecules, and molecules are assemblages of <strong>atoms</strong>, the building blocks of matter. For example, water is an H&#8322;O molecule: 2 hydrogen atoms and 1 oxygen atom.</p><p>An atom is itself composed of a <strong>nucleus and electrons</strong>, which carry a negative charge and orbit around it.</p><p>The nucleus contains two types of particles:</p><ul><li><p><strong>Protons</strong>, which carry a positive charge, naturally repel each other.</p></li><li><p>And <strong>neutrons</strong>, which carry no electric charge and act as a kind of &#8220;glue,&#8221; helping to keep the nucleus stable.</p></li></ul><p>The attraction between electrons (&#8722;) and protons (+) keeps the whole thing in a <strong>stable state</strong>.</p><p>On the other hand, too few or too many neutrons relative to the protons, and the nucleus becomes unstable. It will eventually decay by emitting energy. This is the principle of radioactivity. Carbon-14, for example, is slightly unstable. It decays slowly and predictably. This predictability allows it to be used as a clock to date ancient elements.</p><p>One might think that when touching a solid object, like a table, for instance, what gives the table its <strong>solidity</strong> is that it is &#8220;filled&#8221; with matter, preventing our finger from passing through. Yet, if we took the nucleus and enlarged it into a marble and placed that marble on a football pitch, the electrons would be orbiting at the level of the stands.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9O8t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9O8t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 424w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 848w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1272w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png" width="1456" height="810" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97558,&quot;alt&quot;:&quot;Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled \&quot;empty\&quot; &#8212; demonstrating that matter is mostly empty space.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled &quot;empty&quot; &#8212; demonstrating that matter is mostly empty space." title="Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled &quot;empty&quot; &#8212; demonstrating that matter is mostly empty space." srcset="https://substackcdn.com/image/fetch/$s_!9O8t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 424w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 848w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1272w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.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">If the nucleus of an atom were the size of a marble placed at the center of a football pitch, the electrons would only be found orbiting at the level of the distant stands with almost nothing in between.</figcaption></figure></div><p>An atom is therefore <strong>almost entirely empty</strong>. Solid matter is almost nothing, and what gives this impression of solidity are forces between atoms called <strong>electromagnetic forces</strong>.</p><h1>The Fundamental Forces in the Universe</h1><p>The universe is made up of 4 and only 4 fundamental forces:</p><ul><li><p><strong>Gravity</strong>: Attracts everything with mass toward everything else with mass.</p></li><li><p><strong>The strong nuclear force</strong>: It glues protons and neutrons together inside the nucleus.</p></li><li><p><strong>The weak nuclear force</strong>: Responsible for certain radioactive decays. It is what allows a neutron to transform into a proton (or vice versa).</p></li><li><p>And <strong>the electromagnetic force</strong>.</p></li></ul><p>If we focus on this last one, it is the one that:</p><ul><li><p><strong>Attracts</strong> opposite charges</p></li><li><p>And <strong>repels</strong> identical charges.</p></li></ul><p>Unlike the two nuclear forces, which only act inside the nucleus, the electromagnetic force has an infinite range. That is why it is the one that governs interactions between atoms at our scale.</p><p>It is therefore the electromagnetic force that creates the <strong>illusion of solidity</strong>. When we touch a table, it is the electrons in our hand and those in the table that repel each other. We never truly touch anything.</p><h1>Light: Wave and Particle</h1><p>Let&#8217;s now talk about light. So, <strong>what is light</strong>? It is an electromagnetic wave, a disturbance of the electric and magnetic fields that propagates through space.</p><p>Light is a <strong>spectrum</strong>. Indeed, so-called visible light, the light our eyes can perceive, is only a tiny portion of what exists. The full spectrum is called the electromagnetic spectrum:</p><blockquote><p><em>Radio wave &#8594; Microwave &#8594; Infrared &#8594; Visible light &#8594; UV &#8594; X-rays &#8594; Gamma rays</em></p></blockquote><p>When a radio picks up radio waves, it is therefore picking up light, invisible due to its frequency. Indeed, what varies across the electromagnetic spectrum is the frequency of the wave, and therefore its energy.</p><p><strong>But light hides a surprise: it is also a particle.</strong></p><blockquote><p><strong>NOTE</strong>: <em>A particle can be summarized as follows: an indivisible packet of energy.</em></p></blockquote><p>We know it is a particle thanks to Einstein in 1905 (for which he received his only Nobel Prize, not for relativity). When a light bulb emits light, it emits specific particles called photons.</p><p>When we vary the intensity of that light bulb, one might assume it is the energy of the photon that varies, but that is not the case. The energy of each photon is fixed by its frequency. The higher the frequency of a photon, the more energetic each photon is. That is why, for example, UV rays burn the skin.</p><p>What makes a light bulb emit more light is the increase in electric voltage, which therefore produces more photons. It is the <strong>quantity of photons</strong> that makes a light bulb shine more or less.</p><p>In flight, the photon behaves like a <strong>wave</strong>: it propagates, it oscillates, and it can interfere with other photons. But when it comes into contact with matter, it behaves like a particle: it interacts in one single hit, in one single place.</p><p>When a photon collides with matter, it can either be:</p><ul><li><p><strong>Absorbed</strong>: The photon ceases to exist. Its energy is transferred to an atom, which moves to a higher energy level. This is what an eye does: it absorbs the photon and converts it into an electrical signal.</p></li><li><p><strong>Reflected</strong>: Technically, this is not a true reflection because it is not the same photon that leaves. The atom absorbs the photon and then re-emits a photon of the same energy in a different direction.</p></li></ul><blockquote><p><strong>NOTE</strong>: <em>What determines whether a photon is absorbed or reflected depends on the energy levels of the electrons in the atoms of the surface. If the photon&#8217;s frequency matches an available energy level, the atom absorbs it. Otherwise, the photon is re-emitted. That is why glass is transparent, why the retina absorbs light, and why a mirror reflects almost everything.</em></p></blockquote><h1>The Young&#8217;s Double-Slit Experiment</h1><p>We have seen that light is a wave. But how do we know this? This is where <strong>Young&#8217;s double-slit experiment</strong> comes in, and it is this very experiment that will lay the foundations of quantum physics.</p><p>Young&#8217;s experiment, carried out for the first time in 1801, is as follows:</p><ul><li><p>A <strong>laser</strong> projects photons (light)</p></li><li><p>A <strong>wall</strong> with two small slits, A and B</p></li><li><p>A <strong>screen</strong> behind to detect where the photons land</p></li></ul><p>If light were a &#8220;packet&#8221; of something, we would see the following result:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SGSt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SGSt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png" width="600" height="287.22527472527474" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:112185,&quot;alt&quot;:&quot;Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets." title="Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets." srcset="https://substackcdn.com/image/fetch/$s_!SGSt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.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">If light behaved purely as a particle, firing it through two slits would simply produce two bright bands on the screen, one for each slit (<a href="https://douglasphillipsbooks.com/blog/the-double-slit-experiment">credits</a>).</figcaption></figure></div><p>Yet, the result of Young&#8217;s double-slit experiment is as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DtMu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DtMu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png" width="599" height="286.7465659340659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/935aab51-7f46-4348-8567-c80340518280_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:128723,&quot;alt&quot;:&quot;Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle." title="Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle." srcset="https://substackcdn.com/image/fetch/$s_!DtMu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.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">Instead of two bands, light actually produces multiple alternating stripes on the screen, proof that it behaves as a wave, interfering with itself after passing through both slits simultaneously (<a href="https://douglasphillipsbooks.com/blog/the-double-slit-experiment">credits</a>).</figcaption></figure></div><p>We obtain what is called an <strong>interference pattern</strong>. The wave passes through both slits simultaneously, splits into two, and these two waves meet on the other side.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iLkr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iLkr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 424w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 848w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1272w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png" width="501" height="337.5157894736842" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:950,&quot;resizeWidth&quot;:501,&quot;bytes&quot;:355586,&quot;alt&quot;:&quot;Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen." title="Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen." srcset="https://substackcdn.com/image/fetch/$s_!iLkr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 424w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 848w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1272w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.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">Where two light waves meet after passing through a double slit, they either reinforce or cancel each other out, creating an alternating pattern of bright and dark bands on the screen.</figcaption></figure></div><p>When two waves meet, they add up or cancel out depending on their respective phase:</p><ul><li><p>Two crests meeting &#8594; they add up &#8594; <strong>bright zone</strong></p></li><li><p>A crest meeting a trough &#8594; they cancel out &#8594; <strong>dark zone</strong></p></li></ul><p>The result is an alternating pattern of bright and dark bands on the screen: that is an <strong>interference pattern</strong>.</p><h1>What If We Did the Same With Matter?</h1><p>In the 20th century, researchers then had an idea: apply Young&#8217;s experiment no longer by projecting photons (light) but <strong>electrons</strong> (matter). The experiment is therefore similar, but instead of a laser, an electron gun is used to then measure on the screen where the matter lands.</p><p>Obviously, with this experiment, we are going to get two bands of matter, right?</p><p>Well, still no! <strong>An interference pattern is observed as well</strong>. This result was not a complete surprise to everyone. In 1924, physicist Louis de Broglie had already theoretically proposed that matter, like light, could have a wave-like nature. But this time, it's not a wave-like light; <strong>it's a probability wave</strong>.</p><p>This is one of the greatest discoveries in quantum physics: at the atomic level, the particle has <strong>no defined position</strong>. The position of a particle is determined by a function called the <strong>wave function</strong>, <code>&#968;(x)</code>, which describes the probabilities of finding that particle at a given location in 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_!Do9R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Do9R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 424w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 848w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1272w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png" width="1456" height="459" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:459,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49106,&quot;alt&quot;:&quot;Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location." title="Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location." srcset="https://substackcdn.com/image/fetch/$s_!Do9R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 424w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 848w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1272w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.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 smooth sinusoidal curve representing the wave function &#968;(x), showing how the probability of finding a particle oscillates across different positions in space.</figcaption></figure></div><p>A small clarification on this concept of undefined position to make sure the concept is clear, because this is the moment where our rational brain can start to &#8220;let go.&#8221;</p><p>Let&#8217;s take a coin for a coin toss. We throw it in the air and hide the result. We are in a state of uncertainty, but this uncertainty is called <strong>epistemic</strong>. We do not know the result (heads or tails) because we have not looked yet, yet that result already exists.</p><p>For a particle in the quantum world, the uncertainty is called <strong>ontological</strong>. It is not that we lack information about the position of the particle; it is that <strong>this position simply does not exist yet</strong>. This is what is called <strong>quantum superposition</strong>: an unmeasured particle exists in multiple states simultaneously.</p><p>However, measurement changes everything. When we measure the position of a particle, we will find it in one of the possible positions described by the wave function. We then say that <strong>the wave function &#8220;collapses&#8221;</strong> because it restricts the possibilities into a single real state.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0E59!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0E59!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 424w, https://substackcdn.com/image/fetch/$s_!0E59!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 848w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1272w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png" width="1456" height="461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:461,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41596,&quot;alt&quot;:&quot;Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled \&quot;measured position\&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled &quot;measured position&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location." title="Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled &quot;measured position&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location." srcset="https://substackcdn.com/image/fetch/$s_!0E59!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 424w, https://substackcdn.com/image/fetch/$s_!0E59!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 848w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1272w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.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">Once a particle&#8217;s position is measured, its wave function collapses from a spread of possibilities into a single sharp spike, pinpointing the particle at one exact location.</figcaption></figure></div><p>As an analogy, it is a bit like Minecraft. A default Minecraft map is 60 million x 60 million blocks. For the initial loading, the server does not generate the entire map. <strong>It only generates the world around the observer</strong>, i.e., the player. However, when the player moves, they force the server to generate the world's continuation.</p><p>Where this analogy reaches its limits is that the generation of the Minecraft world, even if it is random, is still <strong>deterministic</strong> because each world has its own seed. The quantum world, on the other hand, appears to be purely random, meaning without hidden information.</p><p>Let&#8217;s return to Young&#8217;s experiment. What would happen if, when a particle passes through a slit, we placed a <strong>detector</strong> there to observe which slit the particle goes through? We recall that a wave passes through both slits at once.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!t4wc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!t4wc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png" width="599" height="286.7465659340659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:103253,&quot;alt&quot;:&quot;Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment." title="Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment." srcset="https://substackcdn.com/image/fetch/$s_!t4wc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.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">When a detector is added to observe which slit the particle passes through, the outcome on the screen becomes uncertain because the act of measuring the particle&#8217;s position disrupts its wave-like behavior.</figcaption></figure></div><p>This is the moment where the brain completely lets go: <strong>observing the particle changes the result of the experiment</strong>. Indeed, observing that particle &#8220;forces&#8221; it to have a defined position, and it then behaves like a classical marble. The result, therefore, gives us <strong>two bands of matter</strong>.</p><p>To summarize what we have seen so far: an unobserved particle exists as a probability wave, in multiple positions simultaneously. As soon as we measure it, this wave collapses, and the particle ends up at a precise location.</p><p>But then, why do we never see this in everyday life? The answer is <strong>decoherence</strong>.</p><h1>Decoherence</h1><p>Quantum superposition is only possible as long as a particle remains isolated from its environment. As soon as it <strong>interacts with anything</strong>, another atom, a photon, an electric field, that interaction constitutes a measurement in the quantum sense. The wave function collapses, and the particle ends up in a precise state.</p><p>An isolated electron in a vacuum can remain in superposition. But a macroscopic object like a table is made up of <strong>billions upon billions of atoms</strong> that permanently interact with the surrounding air, light photons, and electromagnetic fields. These interactions occur billions of times per second. <strong>The superposition collapses</strong> instantaneously before we can even observe it.</p><p>That is why quantum physics is only observable at the atomic scale. And that is also why a single electron in a transistor behaves very differently from an object we can hold in our hand.</p><h1>The Key is Information</h1><p>OK, so the original Young&#8217;s experiment with light produces an interference pattern because light is a wave. The variation with electrons (or indeed subsequently other elements such as atoms) also produces an interference pattern, which proves that matter is a wave, but this time a probability wave. When we measure the result, we change the result of the experiment because we force the particle to &#8220;choose&#8221; its position.</p><p>But incidentally, how does this <strong>measurement</strong> work in the experiment? It works thanks to <strong>photons</strong>. Indeed, when the electron passes through one of the slits, we project a photon which will interact with the electron and be re-emitted in a direction that allows us to deduce which slit the electron went through.</p><p>Researchers wanted to know what would happen if they performed the exact same experiment, measuring which slit the particle went through, but this time, instead of reading the information encoded in the orientation of the photon, <strong>they destroyed that information</strong>.</p><p>And here, another surprise: if we destroy the information, <strong>we return to an interference pattern</strong>. It was as if, since we were not using that information, there was nothing <strong>forcing</strong> the particle to choose which slit to go through, and so it could remain in the form of a probability wave.</p><p>This new experiment, therefore, demonstrates something fundamental in quantum physics: technically, <strong>it is not the act of measuring that influences the experiment, but whether or not this information exists somewhere in the universe</strong>. If this information is destroyed, the interference pattern returns.</p><p>The key is therefore <strong>information</strong>.</p><blockquote><p><strong>NOTE</strong>: <em>How does the destruction of this information work? One might think it would simply be a matter of having the photon absorbed by an absorbing surface before reading it, but this does not work, and we are left with bands. Indeed, by doing so, the information theoretically exists because the absorbing surface could have determined the position of the particle through the orientation of the photon. The destruction works with another incredible principle of quantum physics that I will not detail in this article: entanglement. The photon is sent onto a special crystal, which splits it into two twin photons quantumly linked. One of the twins is then destroyed, making the information unrecoverable because to read the information, one absolutely needs to read both twins. To simplify, the two twins are not copies; they form a single system whose properties are not individually defined.</em></p></blockquote><h1>The Tunnel Effect</h1><p>We are slowly getting closer to SSDs. But before that, there is one last quantum concept we need to talk about: <strong>the tunnel effect</strong>.</p><p>We said that an unobserved electron does not exist like a <em>marble</em> at a precise location. It exists as a probability wave spread out in space. This wave function gives a probability of finding the electron at each point in space.</p><p>Now let&#8217;s imagine a <strong>physical barrier</strong>. We send an electron toward this barrier. Classically, if the electron does not have enough energy to pass over it, it is blocked. Full stop.</p><p>Yet quantum mechanically, the wave function of the electron does not stop abruptly at the barrier. Because it is a wave, it propagates and gradually decays through the barrier. It does not fall to zero. On the other side, there therefore remains <strong>a non-zero probability of finding the electron</strong>.</p><p>This is the tunnel effect: a real chance for the electron to end up <strong>on the other side</strong>, without having had the classical energy needed to cross.</p><p>This probability is not fixed. It depends directly on the thickness of the barrier: the thinner the barrier, the more the wave function survives on the other side, and the higher the tunneling probability. At our scale, the barriers are far too thick for this effect to be observable. But at the scale of a few nanometers, the probability exists.</p><h1>How SSDs Use Quantum Physics</h1><p>In an SSD, we want to store data. They work with bits, but it is precisely in the management of these bits that the principles of quantum physics come into play.</p><p>In an SSD, each bit is encoded in cells called <strong>floating gates</strong>: small zones isolated on all sides by an insulating layer. This box can contain electrons or not:</p><ul><li><p><strong>Box with electrons</strong>: Bit = 0</p></li><li><p><strong>Box without electrons</strong>: Bit = 1</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_!ixiE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ixiE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 424w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 848w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1272w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png" width="1320" height="510" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:510,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:58617,&quot;alt&quot;:&quot;Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level.&quot;,&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.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level." title="Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level." srcset="https://substackcdn.com/image/fetch/$s_!ixiE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 424w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 848w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1272w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.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">In an SSD, each bit is stored in a floating gate cell: a cell filled with electrons represents a 0, while an empty cell represents a 1.</figcaption></figure></div><p>If we need:</p><ul><li><p><strong>To write</strong>, we therefore need to make electrons enter this isolated box. What we do is apply an electric voltage that deforms the wave function of the electrons and increases their probability of ending up on the other side. The electrons, therefore, cross the barrier via the tunnel effect.</p></li><li><p><strong>To erase</strong>, we apply a reverse voltage, which also impacts the wave function, and the electrons cross in the other direction.</p></li><li><p><strong>To read</strong>, it is a classical, non-quantum measurement: we measure the electric current passing through the transistor.</p><ul><li><p>Electrons present: weak current: 0.</p></li><li><p>No electrons: strong current: 1.</p></li></ul></li></ul><p>We saw, however, that the wave function gives a <strong>probability</strong>, not a certainty. If we apply a voltage to write or erase, we therefore only have a probability that the electron will cross the barrier.</p><p>How can an SSD be <strong>reliable</strong> then? An individual electron is unpredictable, but we never send just one electron. We send millions simultaneously. Statistically, enough of them cross the barrier to charge the floating gate reliably.</p><p>And after each write, the controller immediately re-reads the cell to verify. If not enough electrons have crossed, it tries again. That is why SSDs embed error correction mechanisms, <strong>ECC (Error Correcting Code)</strong>, precisely because the process is probabilistic by nature.</p><p>When a cell exceeds a certain error threshold over time, it is finally marked as defective and taken out of service. The data it held is moved to a healthy cell.</p><p>That is why SSDs always have an over-provisioning capacity: a reserve of cells invisible to the user, planned from the manufacturing stage to replace defective cells over time. And that is also why an SSD does not fail all at once; it <strong>degrades progressively</strong>, cell by cell, until the reserve is exhausted.</p><p>And this is where quantum physics imposes its limits. The more transistors shrink, the thinner the insulating barriers become, and the more the tunnel effect becomes uncontrollable, electrons escape spontaneously, errors increase, and cells age faster. Moore&#8217;s Law, which predicts a doubling of transistor density every two years, is today running up against these fundamental physical limits. This is not an engineering problem: <strong>it is quantum physics that sets the boundary</strong>.</p><h1>Summary</h1><ul><li><p><strong>Matter</strong> is made up of atoms, themselves composed of a nucleus (protons and neutrons) and electrons. An atom is almost entirely empty: what we perceive as &#8220;solid&#8221; is an illusion created by the electromagnetic forces between atoms.</p></li><li><p><strong>Light</strong> is both an electromagnetic wave and a particle called a photon. In flight, it behaves like a wave, but it is emitted and absorbed like a particle, in one single hit, in one single place.</p></li><li><p>Young&#8217;s double-slit experiment proves that light is a <strong>wave</strong>: it produces an interference pattern, impossible to obtain with classical particles.</p></li><li><p>Matter behaves in the same way. But unlike light, its wave is not physical: it is a <strong>probability wave</strong> that describes the possible positions of a particle. This is quantum superposition: an unmeasured particle exists in multiple states simultaneously.</p></li><li><p>It is not the act of measuring that collapses the superposition: it is the <strong>existence of the information</strong> somewhere in the universe. If the information is destroyed, the superposition is restored.</p></li><li><p><strong>Decoherence</strong> explains why we never see superposition at our scale: any macroscopic object permanently interacts with its environment, which instantaneously collapses its wave function.</p></li><li><p><strong>The tunnel effect</strong> is a direct consequence of the wave-like nature of particles: the wave function of an electron does not stop abruptly at a physical barrier. There exists a non-zero probability of finding it on the other side, without having had the classical energy to cross.</p></li><li><p><strong>SSDs</strong> exploit the tunnel effect to write and erase data: an electric voltage deforms the wave function of electrons and increases their probability of crossing the insulating barrier of a floating gate. Reliability rests on the large number of electrons sent and on ECC.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/systems">Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/instruction-pipelining">Instruction Pipelining</a></p></li><li><p><a href="https://read.thecoder.cafe/p/simultaneous-multithreading">Simultaneous Multithreading</a></p></li><li><p><a href="https://read.thecoder.cafe/p/soft-lockup-hard-lockup">Linux Soft vs. Hard Lockup</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/44065062-something-deeply-hidden">Something Deeply Hidden</a></p></li><li><p><a href="https://www.goodreads.com/book/show/31625636-we-have-no-idea">We Have No Idea</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://quantum.country/">Quantum Country</a></p></li><li><p>The Double-Slit Experiment - Veritasium</p><div id="youtube2-Iuv6hY6zsd0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Iuv6hY6zsd0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/Iuv6hY6zsd0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Did you know quantum physics was hiding in your laptop all along? I&#8217;d love to hear your reaction in the comments.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/how-an-ssd-works/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.thecoder.cafe/p/how-an-ssd-works/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Working on Complex Systems]]></title><description><![CDATA[My Talk at the Monster SCALE Summit 2026]]></description><link>https://read.thecoder.cafe/p/complex-systems-talk</link><guid isPermaLink="false">https://read.thecoder.cafe/p/complex-systems-talk</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 24 Mar 2026 11:03:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!TI9L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, I&#8217;m sharing the talk I gave at the <a href="https://www.scylladb.com/monster-scale-summit/">Monster SCALE Summit 2026</a> on working on complex systems. Get cozy, grab a coffee, and let&#8217;s begin!</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_!TI9L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TI9L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 424w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 848w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1272w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" width="1200" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40702,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://read.thecoder.cafe/i/191926390?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TI9L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 424w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 848w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1272w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 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><h1>Introduction</h1><p>If you&#8217;ve been a subscriber since mid-2025, you were already here when I published the post that performed best on my newsletter: <em><a href="https://read.thecoder.cafe/p/complex-systems">Working on Complex Systems</a></em>.</p><p>I really loved writing it, and I always had in mind to revisit it at some point. So, when someone at ScyllaDB reached out to invite me to speak at Monster SCALE Summit, I saw the perfect opportunity to turn it into a talk.</p><p>The video isn&#8217;t a 1:1 mapping of the original content. I expanded it with more examples and new ideas. In it, I define what complex systems are, then discuss their common characteristics, and finally explore patterns for navigating them.</p><p>Hope you will enjoy it!</p><h1>Video</h1><div id="youtube2-ddbrrwnoz48" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;ddbrrwnoz48&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/ddbrrwnoz48?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/latency-and-user-experience">Latency and User Experience</a></p></li><li><p><a href="https://read.thecoder.cafe/p/probabilistic-increment">Probabilistic Increment</a></p></li><li><p><a href="https://read.thecoder.cafe/p/bloom-filters">Bloom Filters</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://docs.google.com/presentation/d/e/2PACX-1vQ2Hw-0GC8O15T4G09gpfCz16Qgbxnb3YkEQ_c_0xMzMgZfrdSycDkxIlqElluxUh6yTBCqTyZgo6JM/pub?start=false">Slides</a></p></li><li><p><a href="https://www.scylladb.com/resources/tech-talks/?presentation-type=2873&amp;years=3488">Monster SCALE Summit - 2026 Tech Talks</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/complex-systems-talk/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.thecoder.cafe/p/complex-systems-talk/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[3 Bullets and a Call to Action]]></title><description><![CDATA[When communicating via email or chat, people prefer short and memorable messages that do not require too much cognitive effort to process.]]></description><link>https://read.thecoder.cafe/p/three-bullets-one-call-to-action</link><guid isPermaLink="false">https://read.thecoder.cafe/p/three-bullets-one-call-to-action</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 18 Mar 2026 11:02:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MUle!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss an efficient communication method presented in the <a href="http://Debugging Teams">Debugging Teams</a> book called 3 bullets and a call to action. I&#8217;ve been using it extensively over the past months, and I can confirm its efficiency. Get cozy, grab a coffee, and let&#8217;s begin!</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_!MUle!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MUle!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MUle!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1677328,&quot;alt&quot;:&quot;3 Bullets and a Call to Action.&quot;,&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;:&quot;https://read.thecoder.cafe/i/190563246?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="3 Bullets and a Call to Action." title="3 Bullets and a Call to Action." srcset="https://substackcdn.com/image/fetch/$s_!MUle!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MUle!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.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>At Google, I recently switched to a new domain: <a href="https://cloud.google.com/distributed-cloud-connected">Google Distributed Cloud Connected</a><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Here, all the teams are very busy, and finding an efficient way to communicate over email or chat can be challenging, especially when asking someone to do something.</p><p>Recently, I came across a simple technique: three bullets and one call to action. The idea is the following:</p><ul><li><p>Add three bullet points explaining the key context</p></li><li><p>Follow with one clear call to action</p></li></ul><p>Let&#8217;s look at a concrete example. Suppose you receive the following email:</p><blockquote><p>Hi,</p><p>I recently wrote a design doc on how to save storage in the context of X, where I describe the current problem and the approach we could take to address it. In the document, I go through the main trade-offs involved and explain why the proposal focuses on solution Y in particular. I also included several open questions related to the deployment strategy and some areas where feedback would be especially helpful. It would be great if you could take a look at the document and leave comments by Friday.</p><p>Thanks!</p></blockquote><p>Quite a mouthful. It requires a non-trivial amount of brain time to understand both the context and what the person is actually asking for.</p><p>Now let&#8217;s apply the three bullets and a call to action strategy:</p><blockquote><p>Hi,</p><ul><li><p>I recently wrote a design doc on how to save storage in the context of X.</p></li><li><p>It highlights the main trade-offs and focuses on the solution Y.</p></li><li><p>I&#8217;ve added open questions around the deployment strategy.</p></li></ul><p>Could you please have a look and leave comments by Friday?</p><p>Thanks!</p></blockquote><p>Much better, right? The call to action is clear, and the context is structured around short and easy-to-scan sentences.</p><p>Why does it work? When communicating via email or chat, people prefer short and memorable messages that do not require too much cognitive effort to process. Bullet points help break information into smaller chunks, which makes the message easier to scan quickly. Ideally, the bullet points and the call to action should be as short as possible.</p><p>Another aspect is that 3 is often a magic number in communication. With 2 items, you often get a contrast. With 3 items, you start to get a small structure or rhythm that is easier for the mind to process. That is one of the reasons why the rule of three appears so often in writing, storytelling, and presentations, where it helps make ideas more engaging and convincing.</p><p>Remember: to improve your chances of getting an answer to your request, use 3 short bullets and an efficient call to action.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/10-technical-writing-rules">10 Rules I Learned About Technical Writing</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://thinkinsights.net/consulting/rule-three?">Rule of three &#8212; Thinking Insights</a></p></li><li><p><a href="https://en.wikipedia.org/wiki/Rule_of_three_(writing)">Rule of three (writing) &#8212; Wikipedia</a></p></li></ul><p><em>Only 2, sorry about that.</em></p><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What do you think about this strategy? Have you tried something similar?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/three-bullets-one-call-to-action/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.thecoder.cafe/p/three-bullets-one-call-to-action/comments"><span>Leave a comment</span></a></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>That partially explains why I wasn&#8217;t so active with <em>The Coder Cafe</em> these days. It will get better, I promise.</p></div></div>]]></content:encoded></item><item><title><![CDATA[The Cold Start Problem]]></title><description><![CDATA[The cold start problem is a chicken-and-egg trap:&#160;no users without value,&#160;no value without users.]]></description><link>https://read.thecoder.cafe/p/cold-start-problem</link><guid isPermaLink="false">https://read.thecoder.cafe/p/cold-start-problem</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 07 Jan 2026 11:02:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6lAp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! I sucked at product management<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Early in my career, I was only passionate about how a product works under the hood, not about what the product actually does. Over time, I began to change and open up. Today, I want to share a concept from a book recommended on X by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Pratim Bhosale&quot;,&quot;id&quot;:83787927,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/581a89bf-c59e-473d-8c0a-edfeb7fbfbba_2897x3072.jpeg&quot;,&quot;uuid&quot;:&quot;96ca4096-601e-4569-8e67-0ec634799d0c&quot;}" data-component-name="MentionToDOM"></span> that</em> <em>I really loved: <a href="https://www.goodreads.com/book/show/55338968-the-cold-start-problem">The Cold Start Problem</a>. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6lAp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6lAp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1664132,&quot;alt&quot;:&quot;The cold start problem is a chicken-and-egg trap: no users without value, no value without users.&quot;,&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;:&quot;https://www.thecoder.cafe/i/173044040?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The cold start problem is a chicken-and-egg trap: no users without value, no value without users." title="The cold start problem is a chicken-and-egg trap: no users without value, no value without users." srcset="https://substackcdn.com/image/fetch/$s_!6lAp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h1>Network Effects</h1><p>Let&#8217;s consider a dating app. If there are only three people who installed the app in New-York, anyone new will probably try it for a few seconds and uninstall it. But if a big part of the city is on it, then someone single will probably stick around.</p><p>Said differently, the more people use the product, the more valuable it becomes. There&#8217;s a term for that type of product, and it&#8217;s called <strong>the network effect: when a product gets more valuable as more people use it</strong>.</p><p>Delving into the network effect, it&#8217;s not a single force but actually a trio of forces:</p><ul><li><p><strong>The acquisition effect</strong>: How a product can use its own network to attract new people.</p></li><li><p><strong>The engagement effect</strong>: The more people join, the more useful and sticky it becomes.</p></li><li><p><strong>The economic effect</strong>: A larger network reduces costs, improves monetization, and strengthens the business model.</p></li></ul><p>Now comes the real challenge. If our product relies on network effects, how do we launch it? Do we start from zero, or wait until enough people are on board? <strong>It&#8217;s a chicken-and-egg problem, and that&#8217;s the cold start problem.</strong></p><h1>Anti-Pattern: Big Bang</h1><p>One common mistake to solve the cold start problem is the big bang launch: <strong>releasing to everyone before any community exists.</strong></p><p>Google+ is the perfect example. Launched in 2011, it was Google&#8217;s attempt at a social network with a Facebook-style feed. The problem was that when people joined, they found empty timelines and left. Google later admitted that 90% of user sessions lasted less than five seconds.</p><p>At one point, Google even tied YouTube comments to Google+, requiring an account just to comment. The platform eventually reached more than 500 million users, but the issue was never sign-ups. <strong>The real problem was that a newcomer&#8217;s first session didn&#8217;t feel like walking into a lively room.</strong> It was forced growth instead of real networks.</p><p>Google+ didn&#8217;t fail because Google couldn&#8217;t build a social network. <strong>It lost because it never created a place where a new user could land in a live network.</strong> In short, Google+ failed to solve the cold start problem.</p><h1>Pattern: Atomic Networks</h1><p>A solution to the cold start problem was applied by Tinder, and it involves focusing on the concept of atomic networks.</p><p>Back then, dating apps were not very popular. Yet, Tinder was ambitious and wanted to succeed in that market. Instead of launching worldwide, they did the complete opposite. They organized a party at a college that required installing the application to attend. The next day, most students there had Tinder installed. <strong>This college was an atomic network: the smallest self-sustaining cluster of users where network effects actually work.</strong></p><p>Soon after, they repeated the same process in another college in the same city, with the same result: within days, most students there had joined Tinder.</p><p>What&#8217;s powerful about atomic networks is simple: <strong>if we can build one network, we can build two. If we can build two, we can build thousands.</strong> Tinder repeated this strategy college by college, then city by city, eventually growing into entire countries.</p><p>The takeaway is that when we start a product with network effects, <strong>the first step is to build a single, tiny network that&#8217;s self-sustaining on its own.</strong> We just want to get started. If we can create one stable, engaged network, then we can build a second one next to it. From there, we can replicate the process and eventually connect them into one large network that spans the whole market.</p><h1>Summary</h1><ul><li><p>Network effects happen when a product gets more valuable as more people use it.</p></li><li><p>How do we launch such a product with zero users? That&#8217;s the cold start problem.</p></li><li><p>Big bang launches fail when newcomers find empty networks.</p></li><li><p>One effective approach is to build atomic networks: the smallest self-sustaining clusters where network effects work.</p></li><li><p>If we can build one atomic network, we can repeat it and scale across a market.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/lateral-thinking">Lateral Thinking</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/55338968-the-cold-start-problem">The Cold Start Problem</a></p></li><li><p><a href="https://blog.google/technology/safety-security/project-strobe/">Project Strobe: Protecting your data, improving our third-party APIs, and sunsetting consumer Google+</a></p></li><li><p><a href="https://blog.google/products/google-plus/google-communities-and-photos">Google+: Communities and photos</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>The book is really great and covers many more aspects. I definitely recommend it.</em> <em>Are you into product management? What resources would you recommend?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/cold-start-problem/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/cold-start-problem/comments"><span>Leave a comment</span></a></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>Right, Afroditi?</p></div></div>]]></content:encoded></item><item><title><![CDATA[Linus Torvalds vs. Ambiguous Abstractions]]></title><description><![CDATA[There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name.]]></description><link>https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions</link><guid isPermaLink="false">https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 26 Nov 2025 11:01:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d74f20cc-1821-4609-9b6d-da2737380ab0_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#127876; <em>If you&#8217;re planning to do <a href="https://adventofcode.com/">Advent of Code</a> this year, join The Coder Cafe leaderboard: </em><code>261108-ab921387</code><em>. I&#8217;ll find a few prizes for the winner(s). If you&#8217;re new to Advent of Code, I wrote a short <a href="https://read.thecoder.cafe/p/advent-of-code">introduction</a> last year, and I also wrote a blog post called <a href="https://teivah.medium.com/advent-of-code-b5bf35a6d115">I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned</a> if you&#8217;re interested. I&#8217;ve also created a custom channel in the Discord channel.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://discord.thecoder.cafe/&quot;,&quot;text&quot;:&quot;Join the Discord&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://discord.thecoder.cafe/"><span>Join the Discord</span></a></p><p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss a recent comment from Linus Torvalds about the use of a helper function. Get cozy, grab a coffee, and let&#8217;s begin!</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_!DVdt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DVdt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1677956,&quot;alt&quot;:&quot;There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name.&quot;,&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;:&quot;https://read.thecoder.cafe/i/176306471?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name." title="There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name." srcset="https://substackcdn.com/image/fetch/$s_!DVdt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.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>In August 2025, there was (yet another) drama involving Linus Torvalds replying on a pull request:</p><blockquote><p><em>No. This is garbage and it came in too late. I asked for early pull requests because I&#8217;m traveling, and if you can&#8217;t follow that rule, at least make the pull requests good.</em></p><p><em>This adds various garbage that isn&#8217;t RISC-V specific to generic header files.</em></p><p><em>And by &#8220;garbage&#8221; I really mean it. This is stuff that nobody should ever send me, never mind late in a merge window.</em></p><p><em><strong>Like this crazy and pointless make_u32_from_two_u16() &#8220;helper&#8221;.</strong></em></p><p><em>That thing makes the world actively a worse place to live. It&#8217;s useless garbage that makes any user incomprehensible, and actively WORSE than not using that stupid &#8220;helper&#8221;.</em></p><p><em><strong>If you write the code out as &#8220;(a &lt;&lt; 16) + b&#8221;, you know what it does and which is the high word.</strong> Maybe you need to add a cast to make sure that &#8216;b&#8217; doesn&#8217;t have high bits that pollutes the end result, so maybe it&#8217;s not going to be exactly pretty, but it&#8217;s not going to be wrong and incomprehensible either.</em></p><p><em>In contrast, <strong>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 &#8220;helper&#8221; 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.</em></p></blockquote><p>Let&#8217;s not discuss the rudeness of this comment (it&#8217;s atrocious). Instead, let&#8217;s focus on the content itself.</p><p><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Engineer's Codex&quot;,&quot;id&quot;:2794641,&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%2Fe324dc5e-8be6-4d9a-a32a-61a938fdc0cc_1024x1024.png&quot;,&quot;uuid&quot;:&quot;51fa1556-4f40-48a9-9d44-81c39577c852&quot;}" data-component-name="MentionToDOM"></span>, a popular newsletter, wrote a <a href="https://read.engineerscodex.com/p/how-to-not-write-garbage-code-by">post</a> about it:</p><blockquote><p><em><strong>the main point Linus makes here is that good code optimizes for reducing cognitive load</strong>. {&#8230;] Humans have limited working memory capacity - let&#8217;s say the human brain can only store 4-7 &#8220;chunks&#8221; at at time. <strong>Each abstraction or helper function costs a chunk slot.</strong> Each abstractions costs more tokens.</em></p></blockquote><p>I share the view that good code optimizes for reducing cognitive load<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, but I don&#8217;t understand Linus&#8217;s comment in exactly the same way.</p><p>Yes, Linus is virulent about the helper function, but in my opinion, his main argument isn&#8217;t simply that an abstraction costs a &#8220;chunk slot&#8221; as <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Engineer's Codex&quot;,&quot;id&quot;:2794641,&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%2Fe324dc5e-8be6-4d9a-a32a-61a938fdc0cc_1024x1024.png&quot;,&quot;uuid&quot;:&quot;2e3c401b-609f-444d-822d-4adfa7555481&quot;}" data-component-name="MentionToDOM"></span> mentioned; it&#8217;s rather that this isn&#8217;t the right abstraction.</p><p>Here is the code added in the pull request:</p><pre><code>/**
 * make_u32_from_two_u16 - return u32 number by combining
 * two u16 numbers.
 * @hi: upper 16 bit number
 * @lo: lower 16 bit number
 */
#define make_u32_from_two_u16(hi, lo)&#9;(((u32)(hi) &lt;&lt; 16) | (u32)(lo))</code></pre><p>This macro builds a 32-bit integer by putting one 16-bit value in the high half and the other in the low half. For example:</p><pre><code>hi     = 1010101111001101
lo     = 0001001000110100
result = 10101011110011010001001000110100
         |--------------||--------------|
               hi               lo</code></pre><p>The main problem with this macro isn&#8217;t necessarily that it exists. It&#8217;s that its intent (meaning what it tries to accomplish) could have been clearer.</p><p>Indeed, the helper&#8217;s name doesn&#8217;t tell which word is high and which one is low and that&#8217;s exactly what Linus is calling out with &#8220;<em>you have not a f^%$ing clue what the word order is</em>&#8221;.</p><p>Because we can&#8217;t get the intent from the name (<code>make_u32_from_two_u16</code>), we have to open the macro to understand the order. That&#8217;s precisely why it costs a &#8220;chunk slot.&#8221;: not because the abstraction exists, but because it&#8217;s an ambiguous one.</p><p>If we wanted to keep using a macro, a better approach, in my opinion<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, would be to encode the word order in the name itself (<code>msw</code> = most significant word, <code>lsw</code> = least significant word):</p><pre><code>/**
 * make_u32_from_msw_lsw - return u32 number by combining
 * two u16 numbers in msw:lsw word order.
 * @msw: upper 16 bit number
 * @lsw lower 16 bit number
 */
#define make_u32_from_msw_lsw(msw, lsw) (((u32)(msw) &lt;&lt; 16) | (u32)(lsw))</code></pre><p>In this case, the word order is carried by the macro name, which makes it a clearer abstraction. Reading the call site doesn&#8217;t require opening the macro to understand the word order:</p><pre><code>u32 v = make_u32_from_msw_lsw(0xABCD, 0x1234);</code></pre><p>Such an abstraction doesn&#8217;t cost a &#8220;chunk slot&#8221; in terms of cognitive load. Its intent is clear from the name, so we don&#8217;t need to load an extra piece of information into our working memory to understand it.</p><p>In summary, if we want to optimize for cognitive load, there&#8217;s not necessarily an issue with using helper functions. But if we do, we should make the abstraction as explicit as possible, and that starts with a clear function name that conveys what it tries to accomplish.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/programming">Programming</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/readability">Readability</a></p></li><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load</a></p></li><li><p><a href="https://read.thecoder.cafe/p/nested-code">Nested Code</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://lore.kernel.org/lkml/CAHk-=wjLCqUUWd8DzG+xsOn-yVL0Q=O35U9D6j6=2DUWX52ghQ@mail.gmail.com/">Re: [GIT PULL] RISC-V Patches for the 6.17 Merge Window, Part 1 - Linus Torvalds</a> <em>// The discussion.</em></p></li><li><p><a href="https://github.com/ColinIanKing/linux-next/blob/b1549501188cc9eba732c25b033df7a53ccc341f/include/linux/wordpart.h">GitHub</a> <em>// The code proposed in the pull request</em></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://cybersect.substack.com/p/linus-and-the-two-youts">Linus and the two youts</a> <em>// Interestingly, the macro was plain wrong when the second word was negative. The full explanation is here.</em></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Where do you draw the line between &#8220;helpful&#8221; and &#8220;harmful&#8221; abstraction?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions/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.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions/comments"><span>Leave a comment</span></a></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>At least most of the time. Sometimes we must optimize for performance at the expense of cognitive load.</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>Mr Torvalds, if you see this and you disagree, please do not insult me.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Nothing Beats Kindness]]></title><description><![CDATA[No act of kindness, no matter how small, is ever wasted.]]></description><link>https://read.thecoder.cafe/p/nothing-beats-kindness</link><guid isPermaLink="false">https://read.thecoder.cafe/p/nothing-beats-kindness</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 13 Nov 2025 11:01:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3VVN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e8978eb-eccb-4bb7-89a1-d71105f7075b_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, November 13, is World Kindness Day. For this special occasion, we discuss how kindness matters at work. Get cozy, grab a coffee, and let&#8217;s begin!</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_!kn3P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kn3P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1651457,&quot;alt&quot;:&quot;No act of kindness, no matter how small, is ever wasted.&quot;,&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;:&quot;https://read.thecoder.cafe/i/176993198?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No act of kindness, no matter how small, is ever wasted." title="No act of kindness, no matter how small, is ever wasted." srcset="https://substackcdn.com/image/fetch/$s_!kn3P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.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>We&#8217;re in 2022. It&#8217;s Saturday evening, and I&#8217;m about to go to bed. I&#8217;m on-call that night. I haven&#8217;t been paged, but just to make sure everything is OK, I logged in and checked Slack.</p><p>An incident was going on, and a colleague was already on it. I DMed him: &#8220;<em>Why didn&#8217;t you contact me?</em>&#8221;</p><p>He replied: &#8220;<em>It&#8217;s late and I thought you might be sleeping. I was awake, so I looked to see if there&#8217;s something I could do.</em>&#8221;</p><p>My first reaction was: I&#8217;m on-call. I&#8217;m paid for it. I&#8217;ll take care of it. Go to bed.</p><p>But here&#8217;s the thing: on a Saturday evening, he chose to help because he thought I might be sleeping, even though I was the one on-call, the one paid to handle it.</p><p>That was a pure act of kindness. No points. No credit. Just care. And after that? Honestly, I would have done anything for <a href="https://www.linkedin.com/in/kasper-bentsen-37109a57/">that person</a>.</p><h2>Why Kindness Wins</h2><p>At work, we work with people long before we work with code. There&#8217;s always a little distance between us: roles and power dynamics, deadlines and pressure, different cultures, communication styles, sometimes different time zones. Kindness is the fastest bridge across that distance.</p><p>Kindness is about being generous, considerate, and having concern for others without expecting praise or reward in return. It&#8217;s a voluntary act that creates psychological safety among team members. When people feel safe, they surface risks earlier, ask the &#8220;naive&#8221; questions, and move faster together.</p><p>Kind people make work better day in, day out. Kindness boosts trust, speeds decisions, reduces stress, and quietly raises the bar for everyone.</p><p>Let&#8217;s look at a few places where kindness matters in our daily jobs:</p><ul><li><p><strong>Code review</strong>: When we&#8217;re assigned a review, we&#8217;re not there to rate someone&#8217;s code. We&#8217;re there to merge the best possible change together. Be respectful and stay factual. Favor questions over pronouncements: &#8220;<em>What scenarios does this handle? I&#8217;m worried about X; would Y cover Z?</em>&#8221; Point out what&#8217;s good, suggest concrete fixes, and link to standards or examples. If there&#8217;s confusion, offer help.</p></li><li><p><strong>Meetings</strong>: Make space so everyone can be heard. Don&#8217;t interrupt. Invite quieter people in: &#8220;<em>Ben, anything you would add?</em>&#8221; It&#8217;s not because someone is more vocal that they&#8217;re more right.</p></li><li><p><strong>Mentoring</strong>: People make mistakes. Don&#8217;t jump to blame or perform expertise. The goal is to protect in public and correct in private. Give clear, kind feedback, focus on the next step, and share your own past mistakes to lower the temperature.</p></li><li><p><strong>Random thank you</strong>: When you receive help or just enjoy working with someone, say thank you. Recognition matters, and doing it publicly multiplies the effect. For example, at Google, there&#8217;s a program called gThanks that lets you thank someone publicly so others can see it too.</p></li><li><p><strong>Make time to listen</strong>: Being kind also means making time to listen. I remember going through a difficult period of my life, and a former manager just took time to talk, without judging. That mattered more than any advice.</p></li><li><p><strong>Self-compassion</strong>: Kindness also applies to yourself. Give yourself the same understanding you would give a teammate. Take breaks, ask for help, forgive your own mistakes, and learn from them.</p></li></ul><p>Being kind is a bridge to people, and even in a professional context, as Aesop wrote, no act of kindness, no matter how small, is ever wasted.</p><div id="youtube2-YLP9C4yn4C0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;YLP9C4yn4C0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/YLP9C4yn4C0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/mistake-journal">Keeping a Mistake Journal</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://hbr.org/2023/07/why-kindness-at-work-pays-off">Why Kindness at Work Pays Off</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.randomactsofkindness.org/kindness-at-work">Random Acts of Kindness Foundation</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What&#8217;s one act of kindness that changed your workday?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/nothing-beats-kindness/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.thecoder.cafe/p/nothing-beats-kindness/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Horror Coding Stories: Therac-25]]></title><description><![CDATA[In total, there were six known radiation overdoses involving the Therac-25,and at least three were fatal.]]></description><link>https://read.thecoder.cafe/p/therac-25</link><guid isPermaLink="false">https://read.thecoder.cafe/p/therac-25</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Fri, 31 Oct 2025 15:01:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ce5a0037-5c6b-4b2f-9f83-85aaa45eda6e_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#128197; <em>Last updated: March 9, 2025</em></p><p>&#127875; <em>Welcome to The Coder Cafe! Today, we examine the Therac-25 accidents, where design and software failures resulted in multiple radiation overdoses and deaths. Make sure to check the Explore Further section to see if you&#8217;re able to reproduce the deadly issue. Get cozy, grab a pumpkin spice latte, and let&#8217;s begin!</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_!B8Kz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1703978,&quot;alt&quot;:&quot;In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal.&quot;,&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;:&quot;https://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal." title="In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal." srcset="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.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><h1>Therac-25</h1><p>Treating cancers used to require a mix of machines, depending on tumor depth: shallow or deep. In the early 1980s, a new generation promised both from a single system. That was a big deal for hospitals: one machine instead of several meant lower maintenance and fewer systems to manage.</p><p>That was the case with the Therac-25.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3DYM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3DYM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png" width="800" height="295" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:295,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103150,&quot;alt&quot;:&quot;Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room.&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room." title="Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room." srcset="https://substackcdn.com/image/fetch/$s_!3DYM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.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>The Therac-25 offered two therapies with selectable modes:</p><ul><li><p><strong>Electron beam:</strong> Low-energy electrons for shallow tumors (e.g., skin cancer).</p></li><li><p><strong>X-ray photons:</strong> High-energy radiation for deep tumors (e.g., lung cancer).</p></li></ul><p>Earlier Therac models allowed switching modes with hardware circuits and physical interlocks. The new version was smaller, cheaper, and computer-controlled. Less hardware and fewer parts meant lower costs.</p><p>However, what no one realized soon enough: it also removed an independent safety net.</p><h1>The Horror Begins </h1><p>On a routine day, a radiology technologist sat at the console and began entering a plan:</p><ul><li><p>By habit, she selected X-ray (deep mode).</p></li><li><p>Then she immediately corrected it for Electron (shallow mode) and hit start.</p></li></ul><p>The machine halted with a <code>MALFUNCTION 54</code> message. The operator&#8217;s manual didn&#8217;t explain the code. Service materials listed the number but gave no useful guidance, so she resumed and triggered the radiation.</p><p>The patient was receiving his ninth treatment. Immediately, he knew something was different. He reported a buzzing sound, later recognized as the accelerator pouring out radiation at maximum. The pain came fast; paralysis followed. He later died from radiation injury.</p><p>Weeks later, a second patient endured the same incident on the same model.</p><h1>What Happened?</h1><p>Initially, the radiology technologist entered &#8216;<code>X</code>&#8217; for X-ray (&#8216;&#9646;&#8217; is the cursor and &#8216;<code>&#8230;</code>&#8217; are other fields):</p><pre><code>MODE:              X
...                &#9646;
BEAM READY:        </code></pre><p>She immediately hit <em>Cursor Up</em> to go back and correct the field to &#8216;<code>E</code>&#8217;:</p><pre><code>MODE:              E
...                &#9646;
BEAM READY:        </code></pre><p>After a rapid sequence of <em>Return</em> presses, she moved back down to the command area:</p><pre><code><code>MODE:              E
...                
BEAM READY:        &#9646;</code></code></pre><p>From her perspective, the screen showed the corrected mode, so she hit return and started the treatment:</p><pre><code><code>MODE:              E
...                
BEAM READY:        &#9646;&lt;Enter&gt;</code></code></pre><p>Behind the scenes, the Therac-25 software ran several concurrent tasks:</p><ul><li><p><strong>Data-entry task</strong>: Monitored operator inputs and edited a shared treatment-setup structure.</p></li><li><p><strong>Hardware-control task</strong>: On a periodic loop, snapshotted that same structure and positioned the turntable and magnets based on user input.</p></li></ul><p>Because both tasks read the same memory with no mutual exclusion, there was a short window (on the order of seconds) in which the hardware-control task used a different value than the one displayed on the screen.</p><p>As a result:</p><ul><li><p>The UI showed Electron mode, which looked correct to the operator.</p></li><li><p>The hardware-control task had snapshotted stale data and marked the system as ready even though critical elements (e.g., turntable position, scanning magnets/accessories) were not yet aligned with electron mode.</p></li><li><p>When treatment was started, the machine delivered an effectively unscanned, high-intensity electron beam, causing a massive overdose.</p></li></ul><p>This is a <a href="https://read.thecoder.cafe/p/data-race-vs-race-condition">race condition</a> example: the outcome depends on the timing of events, here, the input cadence of the technologist. Depending on the timing, the system could enter a fatal state, with one process seeing &#8216;<code>X</code>&#8217; while another saw &#8216;<code>E</code>&#8217;.</p><p>The manufacturer later confirmed the error could not be reproduced reliably in testing. The timing had to line up just right, which made the bug elusive. They initially misdiagnosed it as a hardware fault and applied only minor fixes. Unfortunately, the speed of operator editing was the key trigger that exposed this software race.</p><h1>Another Tragedy</h1><p>The problem could have stopped here, but it didn&#8217;t.</p><p>Months later, another fatal overdose occurred, this time caused by a different software defect. It wasn&#8217;t a timing race. This time, the issue was a counter overflow within the control program.</p><p>The software used an internal counter to track how many times certain setup operations ran. After the counter exceeded its maximum value, it wrapped back to zero. That arithmetic overflow created a window where a critical safety check was bypassed, allowing the beam to turn on without the proper accessories in place.</p><p>Again, the Therac-25 fired a high-intensity beam without the proper hardware configuration.</p><h1>Conclusion</h1><p>Both the race condition and the counter overflow stemmed from the same design flaw: the belief that software alone could enforce safety. The Therac-25 showed, in tragic terms, that without independent safeguards, small coding errors can have catastrophic consequences. </p><p>We should know that whether it&#8217;s software, hardware, or a human process, every single safeguard has inherent flaws. Therefore, in complex systems, safety should be layered, as illustrated by the Swiss cheese model:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HRO0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HRO0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 424w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 848w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1272w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png" width="498" height="444.005376344086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:995,&quot;width&quot;:1116,&quot;resizeWidth&quot;:498,&quot;bytes&quot;:799387,&quot;alt&quot;:&quot;A diagram of the Swiss Cheese Model showing four slices of cheese labeled \&quot;Distancing,\&quot; \&quot;Masks,\&quot; \&quot;Cleaning,\&quot; and \&quot;Handwashing.\&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up.&quot;,&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A diagram of the Swiss Cheese Model showing four slices of cheese labeled &quot;Distancing,&quot; &quot;Masks,&quot; &quot;Cleaning,&quot; and &quot;Handwashing.&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up." title="A diagram of the Swiss Cheese Model showing four slices of cheese labeled &quot;Distancing,&quot; &quot;Masks,&quot; &quot;Cleaning,&quot; and &quot;Handwashing.&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up." srcset="https://substackcdn.com/image/fetch/$s_!HRO0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 424w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 848w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1272w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.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.goodreads.com/book/show/127280527-big-ideas-little-pictures">Credits</a></figcaption></figure></div><p>In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/reliability">Reliability</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/adaptive-lifo">Adaptive LIFO</a></p></li><li><p><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable?</a></p></li><li><p><a href="https://read.thecoder.cafe/p/lurking-variables">Lurking Variables</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://smartbear.com/blog/bug-day-race-condition-therac-25/">The Worst Computer Bugs in History: Race conditions in Therac-25</a></p></li><li><p><a href="https://hackaday.com/2015/10/26/killed-by-a-machine-the-therac-25/">Killed By A Machine: The Therac-25</a></p></li><li><p><a href="https://www.cs.columbia.edu/~junfeng/08fa-e6998/sched/readings/therac25.pdf">An Investigation of the Therac-25 Accidents</a></p></li></ul><h2>Explore Further</h2><p>I created a Docker image based on a <a href="https://web.mit.edu/6.033/2007/wwwdocs/assignments/therac.c">C implementation</a> from an <a href="https://web.mit.edu/6.033/2007/wwwdocs/assignments/handson-therac.html">MIT course</a> simulating the operator console of the Therac-25 interface:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lhlS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lhlS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 424w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 848w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1272w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png" width="604" height="338.9203296703297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:817,&quot;width&quot;:1456,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:128363,&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.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_!lhlS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 424w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 848w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1272w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.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 run the UI using Docker:</p><pre><code> docker run --rm -it -e TERM=xterm-256color teivah/therac-25</code></pre><p>Simulator commands:</p><ul><li><p>Beam Type: &#8216;<code>X</code>&#8217; or &#8216;<code>E</code>&#8217;</p></li><li><p>Command: &#8216;<code>B</code>&#8217; for beam on, or &#8216;<code>Q</code>&#8217; to quit the simulator.</p></li></ul><p>&#128073; Try to trigger the <code>MALFUNCTION 54</code> error based on the scenario discussed.</p><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Any other horror coding stories you want to share?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/therac-25/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.thecoder.cafe/p/therac-25/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Speed vs. Velocity]]></title><description><![CDATA[On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.]]></description><link>https://read.thecoder.cafe/p/speed-vs-velocity</link><guid isPermaLink="false">https://read.thecoder.cafe/p/speed-vs-velocity</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 22 Oct 2025 12:03:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cdwe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss the difference between speed and velocity in team productivity, illustrating that tracking speed alone can be misleading. Get cozy, grab a coffee, and let&#8217;s begin!</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_!cdwe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cdwe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1683126,&quot;alt&quot;:&quot;On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.&quot;,&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;:&quot;https://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature." title="On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature." srcset="https://substackcdn.com/image/fetch/$s_!cdwe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.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>We often celebrate teams for moving fast. But speed alone can be a trap. A rush of fast changes that barely move the product toward the real goal shouldn&#8217;t count as a win. When we talk about team productivity, we should understand that <strong>speed &#8800; velocity</strong>:</p><ul><li><p><strong>Speed</strong> is how quickly a team ship changes.</p></li><li><p><strong>Velocity</strong> is speed with direction, the movement toward a defined goal.</p></li></ul><p>Let&#8217;s look at three teams to illustrate these definitions.</p><ul><li><p><strong>Team A</strong> has ideal velocity. Each iteration is represented by an arrow: its length shows speed, and its angle shows direction. Every iteration moves the team consistently closer to the goal.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o45s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o45s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!o45s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png" width="499" height="500.18809523809523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56826b45-968e-45f9-a359-78325662868e_840x842.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:840,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:203058,&quot;alt&quot;:&quot;Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal.&quot;,&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;:&quot;https://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal." title="Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal." srcset="https://substackcdn.com/image/fetch/$s_!o45s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!o45s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.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><figcaption class="image-caption">Team A shows ideal velocity: steady speed and consistent direction.</figcaption></figure></div></li><li><p><strong>Team B</strong> has a speed problem. Each iteration is well-aligned (correct angle), but the team delivers too slowly (small length), resulting in a lower velocity. They finish only halfway to the goal.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MOTO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MOTO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 424w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 848w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1272w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png" width="500" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0134531c-c429-4277-9345-13b5710ebda7_840x840.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:840,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:273994,&quot;alt&quot;:&quot;Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction.&quot;,&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;:&quot;https://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction." title="Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction." srcset="https://substackcdn.com/image/fetch/$s_!MOTO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 424w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 848w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1272w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.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><figcaption class="image-caption">Team B has the right direction but low speed, so they only reach halfway to the goal.</figcaption></figure></div></li><li><p><strong>Team C</strong> ships as rapidly as team A (same arrow length). However, various factors such as frequent bug fixes and changing targets make their direction inconsistent. Despite high speed, their velocity is low, and they end only halfway to the goal, just like team B.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fqSk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fqSk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png" width="499" height="500.18809523809523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:840,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:212717,&quot;alt&quot;:&quot;Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal.&quot;,&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;:&quot;https://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal." title="Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal." srcset="https://substackcdn.com/image/fetch/$s_!fqSk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.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><figcaption class="image-caption">Team C moves fast but changes direction often, so velocity stays low and progress stops halfway.</figcaption></figure></div></li></ul><p>As we can see, velocity requires both speed and direction. A team moving too slowly or in inconsistent directions will make little progress, <strong>even if they&#8217;re busy</strong>. Only when speed is high and direction is aligned do teams reach their goals efficiently.</p><p>Measuring team speed isn&#8217;t useless, though. We can track speed by considering various metrics such as deployment frequency, average time in code review, or mean time to recovery (MTTR) following a production bug. These metrics are interesting to track and provide a certain perspective to understand a team's productivity. <strong>Yet, speed shouldn&#8217;t be the sole dimension to track.</strong></p><p>The danger of tracking speed only is that a team might become organized in a way to optimize <strong>short-term delivery</strong>. The team might focus on delivering many changes that, together, do not move the product in a meaningful way. Instead, teams should track speed and velocity.</p><p>As we said, velocity is speed with direction. We already discussed metrics to track speed; what is missing is monitoring direction.</p><p>Setting <strong>clear and factual objectives</strong> that align with the business strategy helps us track direction. For example:</p><ul><li><p>Payment success rate above 99 percent.</p></li><li><p>Signup to activation above 50 percent within 7 days.</p></li><li><p>Retention after week 4 is above 40 percent.</p></li></ul><p>The easier a metric is to measure, the easier it is to track the direction over time.</p><p>One caveat is how to report progress. In a past team, we used to set OKRs (Objectives and Key Results) every semester. Some objectives were difficult to measure, so we tracked progress differently. Say we created 50 tickets and closed 45. In that case, we reported that we reached 90% of the OKR. <strong>That number said nothing about real progress toward the objective.</strong> Key results should be outcomes, not ticket counts.</p><p>Something else to mention, I read here and there that we should track velocity by counting the number of story points delivered within a timeframe (e.g., during a sprint). I strongly disagree with this. Let me give an example:</p><ul><li><p>A team ships a first change <strong>&#8592; 3 story points</strong></p></li><li><p>The team finds a bug and ships a fix <strong>&#8592; 2 story points</strong></p></li><li><p>Later, the team learns the initial approach is not the best, so it ships another change <strong>&#8592; 5 story points</strong></p></li></ul><p>On paper, the team delivered 10 story points. <strong>That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.</strong> Story points measure effort; they don&#8217;t measure progress toward the objective.</p><h1>Summary</h1><ul><li><p>Speed is how fast we ship. Velocity is speed with direction toward a goal.</p></li><li><p>The goal of a team shouldn&#8217;t be to reach high speed; it should be to reach high velocity, where rapid iterations translate into <em>real</em> system-level improvements.</p></li><li><p>Tracking story points, for example, is a measure of speed, not velocity.</p></li><li><p>Objectives tracking should use outcomes, not ticket counts. Reporting 90 percent of tickets done is not a good measure of progress toward the objective.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mistake-journal">Keeping a Mistake Journal</a></p></li><li><p><a href="https://read.thecoder.cafe/p/streetlight-effect">Streetlight Effect</a></p></li><li><p><a href="https://read.thecoder.cafe/p/survivor-bias">Survivor Bias</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.atlassian.com/agile/project-management/velocity-scrum">Sprint Velocity in Scrum: How to Measure and Improve Performance</a> <em>// The velocity definition I disagree with.</em></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What&#8217;s your take on speed vs. velocity? How do you measure velocity in your team?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/speed-vs-velocity/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.thecoder.cafe/p/speed-vs-velocity/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Conflict-Free Replicated Data Types (CRDTs)]]></title><description><![CDATA[No matter when or how often the nodes sync, they always end up with the same state.]]></description><link>https://read.thecoder.cafe/p/crdt</link><guid isPermaLink="false">https://read.thecoder.cafe/p/crdt</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 16 Oct 2025 12:02:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!It-D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we will explore CRDTs, why they matter in distributed systems, and how they keep nodes in sync. Get cozy, grab a coffee, and let&#8217;s begin!</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_!It-D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!It-D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!It-D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1656225,&quot;alt&quot;:&quot;No matter when or how often the nodes sync, they always end up with the same state.&quot;,&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;:&quot;https://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No matter when or how often the nodes sync, they always end up with the same state." title="No matter when or how often the nodes sync, they always end up with the same state." srcset="https://substackcdn.com/image/fetch/$s_!It-D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!It-D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.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>CRDTs, short for Conflict-Free Replicated Data Types, are a family of data structures built for distributed systems. At first sight, CRDTs may look intimidating. Yet at their core, the idea is not that complex. What makes them special is that they allow updates to happen independently on different nodes while still guaranteeing that all replicas eventually converge to the same state.</p><p>To understand how CRDTs achieve this, we first need to step back. We need to talk about concurrent operations and what coordination means in a distributed system. Let&#8217;s take it step by step.</p><h1>Concurrent Operations</h1><p>What does concurrent operations mean? Our first intuition might be to say they happen at the same time. That&#8217;s not quite right. Here&#8217;s a counterargument based on a collaborative editing example.</p><ol><li><p>While on a plane, Alice connects to a document and makes an offline change to a sentence.</p></li><li><p>An hour later, Bob connects to the same document and edits the very same sentence, but online.</p></li><li><p>Later, when Alice lands, both versions have to sync.</p></li></ol><p>The two edits (1. and 2.) were separated by an hour. They didn&#8217;t happen at the same time, yet they are concurrent.</p><p><strong>So what&#8217;s a better definition for concurrent operations? Two operations that are not causally related.</strong></p><p>In the previous example, neither operation was made with knowledge of the other. They are not causally related, which makes them concurrent. Yet, if Bob had first seen Alice&#8217;s update and then made his own, his edit would depend on hers. In that case, the two operations wouldn&#8217;t be concurrent anymore.</p><p><strong>We should also understand concurrent &#8800; conflict:</strong></p><ul><li><p>If Alice fixes a missing letter in a word while Bob removes the whole word, that&#8217;s a conflict.</p></li><li><p>If Alice edits one sentence while Bob edits another, that&#8217;s not a conflict.</p></li></ul><p>Concurrency is about independence in knowledge. Conflict is about whether the effects of operations collide.</p><h1>Coordination</h1><p>Now, let&#8217;s talk about coordination in distributed systems.</p><p>Imagine a database with two nodes, node 1 and node 2. A bunch of clients connect to it. Sometimes requests go to node 1, sometimes to node 2. Let&#8217;s say two clients send concurrent and conflicting operations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wA4s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wA4s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 424w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 848w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1272w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png" width="500" height="434.2105263157895" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:760,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:86606,&quot;alt&quot;:&quot;Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database." title="Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database." srcset="https://substackcdn.com/image/fetch/$s_!wA4s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 424w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 848w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1272w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.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>In this case, we can&#8217;t have node 1 storing $200 while node 2 stores -$100. That would be a consistency violation with the two nodes disagreeing on Alice&#8217;s balance.</p><p>Instead, both nodes need to agree on a shared value. To do that, they have to communicate and decide on one of the following:</p><ul><li><p>Reject both operations</p></li><li><p>Accept client A&#8217;s update and set the balance to $200</p></li><li><p>Accept client B&#8217;s update and set the balance to -$100</p></li></ul><p><strong>The very action of nodes communicating and, if needed, waiting to agree on a single outcome is called coordination.</strong></p><p>Coordination is one way to keep replicas consistent under concurrent operations. But coordination is not the only way. That&#8217;s where CRDTs come in.</p><h1>CRDT</h1><p><strong>CRDT stands for Conflict-Free Replicated Data Types</strong>. In short, CRDTs are data structures built so that nodes can accept local updates independently and concurrently, without the need for coordination.</p><p>If you read our recent <a href="https://www.thecoder.cafe/p/availability-models">post</a> on availability models, you might notice we&#8217;re now in the territory of <strong>total availability: a system is totally available if every non-faulty node can execute any operation. </strong>Total availability comes with weaker consistency. For CRDTs, the consistency guarantee is called <strong>Strong Eventual Consistency (SEC)</strong>.</p><p>For that, CRDTs rely on a deterministic conflict resolution algorithm. Because every node applies the same rules, all replicas are guaranteed to eventually converge to the same state.</p><h1>G-Counter</h1><p>Let&#8217;s make this more concrete with a classic CRDT: the G-Counter (Grow-Only Counter).</p><p>Imagine a database with two nodes tracking the number of likes on a post. Node 1 receives a new like, increments its counter, and replies success to the client:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gVtm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gVtm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png" width="499" height="446.4736842105263" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:760,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:79712,&quot;alt&quot;:&quot;Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync." title="Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync." srcset="https://substackcdn.com/image/fetch/$s_!gVtm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.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>Then, node 1 communicates with node 2 to send this update:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Yvi3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 424w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 848w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1272w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png" width="526" height="230.9268292682927" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:820,&quot;resizeWidth&quot;:526,&quot;bytes&quot;:67456,&quot;alt&quot;:&quot;Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization." title="Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization." srcset="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 424w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 848w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1272w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Ultimately, both nodes converge to the same value: 6.</p><p>How does the conflict resolution work for a G-Counter?</p><p>Each replica keeps a vector of counters, with one slot per node. In our example, the total number of likes is 5. Let&#8217;s say node 1 has seen 2 likes and node 2 has seen 3 likes. So the initial state is the following:</p><pre><code>Node 1: [2, 3]
Node 2: [2, 3]</code></pre><p>When node 1 receives a new like, it only increments its own slot. Node 2 is now temporarily out of sync:</p><pre><code>Node 1: [<strong>3</strong>, 3]
Node 2: [2, 3]</code></pre><p>During synchronization, both nodes merge their vectors by taking the element-wise maximum:</p><pre><code>[max(3,2), max(3,3)] = [3, 3]</code></pre><p>Now both replicas converge to the same state:</p><pre><code>Node 1: [3, 3]
Node 2: [<strong>3</strong>, 3]</code></pre><p>The beauty of this algorithm is that it&#8217;s deterministic and order-independent. No matter when or how often the nodes sync, they always end up with the same state.</p><blockquote><p><strong>NOTE</strong>: Do you know Gossip Glomers? It&#8217;s a series of distributed systems challenges we briefly introduced in an earlier <a href="https://read.thecoder.cafe/p/gossip-glomers">post</a>. Challenge 4 is to build a Grow-Only Counter. It&#8217;s worth checking out if you haven&#8217;t already.</p></blockquote><h1>PN-Counter</h1><p><strong>CRDTs can also be combined to make a more complex CRDT.</strong> For example, if we want to track both likes and dislikes, we can use two G-Counters together. This data type is called a PN-Counter (Positive-Negative Counter).</p><p>Imagine two clients act concurrently on the same post: one likes it, another dislikes 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_!vw6t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vw6t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png" width="500" height="447.36842105263156" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:760,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:84183,&quot;alt&quot;:&quot;Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync." title="Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync." srcset="https://substackcdn.com/image/fetch/$s_!vw6t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.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 nodes exchange their updates and converge to the same value:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-sAF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-sAF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 424w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 848w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1272w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png" width="916" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:916,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72272,&quot;alt&quot;:&quot;Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution." title="Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution." srcset="https://substackcdn.com/image/fetch/$s_!-sAF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 424w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 848w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1272w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.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>In the case of a PN-Counter, the conflict resolution algorithm is similar to the G-Counter. The difference lies in the fact that it involves not one but two vectors: one for increases and one for decreases.</p><p>Assume an initial state where node 1 has received 2 likes and 0 dislikes, and node 2 has received 3 likes and 0 dislikes:</p><pre><code>-- Increase
Node 1: [2, 3]
Node 2: [2, 3]

-- Decrease
Node 1: [0, 0]
Node 2: [0, 0]</code></pre><p>Now, suppose node 1 receives a new like and node 2 receives a dislike. Before the sync, the state is the following:</p><pre><code>-- Increase
Node 1: [<strong>3</strong>, 3]
Node 2: [2, 3]

-- Decrease
Node 1: [0, 0]
Node 2: [0, <strong>1</strong>]</code></pre><p>When the replicas exchange their state, the merge rule is element-wise maximum for each vector:</p><pre><code>-- Increase
[max(3,2), max(3,3)] = [3, 3]

-- Decrease
[max(0,0), max(0,1)] = [0, 1]</code></pre><p>After sync, both nodes converge to:</p><pre><code>-- Increase
Node 1: [3, 3]
Node 2: [<strong>3</strong>, 3]

-- Decrease
Node 1: [0, <strong>1</strong>]
Node 2: [0, 1]</code></pre><p>The final counter of likes is:</p><pre><code>node1Likes + node2Likes - node1Dislikes - node2Dislikes
= 3 + 3 - 0 - 1
= 5</code></pre><h1>Use Cases</h1><p>Let&#8217;s pause for a second. Based on what we&#8217;ve discussed, can you think of some use cases for CRDTs? A data structure where nodes are updated independently, concurrently, without coordination, and still guarantees that they converge to the same state?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K5jT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" width="725.5375366210938" height="362.7687683105469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:725.5375366210938,&quot;bytes&quot;:55063,&quot;alt&quot;:&quot;Time to think.&quot;,&quot;title&quot;:&quot;Time to think.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Time to think." title="Time to think." srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.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><strong>One main use case is collaborative and offline-first systems.</strong> For example, Notion, a collaborative workspace, recently introduced a feature that lets people edit the same content offline. They rely on CRDTs, and more specifically on Peritext, a CRDT for rich-text collaboration co-authored by multiple people, including <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&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/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;8d478747-27ec-474f-ace6-1e8939782a19&quot;}" data-component-name="MentionToDOM"></span>.</p><p><strong>Another big use case is totally available systems that put availability ahead of strong consistency.</strong> As we&#8217;ve seen, nodes don&#8217;t need to coordinate before acknowledging a client request, which makes the system more highly available.</p><p>Take Redis, for example. It can be configured in an active-active architecture with geographically distributed datacenter<strong>s.</strong> Clients connect to their closest cluster and get local latencies without waiting for coordination across distant regions. And yes, this setup is built on CRDTs.</p><p>We could also think about other applications for CRDTs, like:</p><ul><li><p><strong>Edge &amp; IoT</strong>: Devices update offline and merge later without a central server.</p></li><li><p><strong>Peer-to-peer</strong>: Peers share changes directly and match up when they reconnect.</p></li><li><p><strong>CDN/edge state</strong>: Keep preferences, drafts, or counters near users and sync to the origin later.</p></li></ul><h1>Different Types of CRDTs</h1><p>There are two main types of CRDTs:</p><ul><li><p><strong>State-based CRDTs</strong>: Convergence happens by propagating the full state.</p></li><li><p><strong>Operation-based CRDTs</strong>: Convergence happens by propagating the update operations.</p></li></ul><h2>State-Based CRDTs</h2><p>In the previous examples, we looked at two state-based CRDTs: the G-Counter (Grow-Only Counter) and the PN-Counter (Positive-Negative Counter). In both cases, what was exchanged between the nodes was the entire state. For example, node 1 could tell node 2 that its total number of likes is 3.</p><p>With state-based CRDTs, states are merged with a function that must be:</p><ul><li><p><strong>Commutative:</strong> We can merge in any order and get the same result.</p></li><li><p><strong>Idempotent:</strong> Merging something with itself doesn&#8217;t change it.</p></li><li><p><strong>Associative:</strong> We can merge in any grouping and get the same result.</p></li></ul><p>Each synchronization monotonically increases the internal state. In other words, when two replicas sync, the state can only move forward, never backward. This is enforced by a simple &#8220;<em>can&#8217;t-go-backwards</em>&#8221; rule (a partial order), where merges use operations like max for numbers (as we&#8217;ve seen) or union for sets.</p><h2>Operation-Based CRDTs</h2><p>In operation-based CRDTs, nodes share the operations rather than the full state. Convergence relies on three properties:</p><ul><li><p><strong>Commutativity</strong> of concurrent operations</p></li><li><p><strong>Causality:</strong> Either carried in the operations&#8217; metadata (for example, vector clocks) or guaranteed by the transport layer through causal delivery</p></li><li><p><strong>Duplicate tolerance:</strong> Handled by idempotent operations, unique operation IDs with deduplication, or a transport layer that guarantees no duplicates</p></li></ul><p>One example of an operation-based CRDT is the LWW-Register (Last-Writer-Wins Register), which stores a single value. Updates are resolved using a logical timestamp (such as Lamport clocks) along with a tie-breaker like the node ID. When a node writes a value, it broadcasts an operation <code>(value, timestamp, nodeID)</code>. On receiving it, a node applies the update if the pair <code>(timestamp, nodeID)</code> is greater than the one it currently holds.</p><h2>CRDT Types Summary</h2><p>To summarize:</p><ul><li><p><strong>State-based CRDTs:</strong></p><ul><li><p>Convergence is guaranteed because merging states is associative, commutative, and idempotent.</p></li><li><p>Don&#8217;t require assumptions on the delivery layer beyond eventual delivery.</p></li><li><p>Simpler to reason about. </p></li><li><p>Exchanging full states can be more bandwidth-intensive.</p></li></ul></li><li><p><strong>Operation-based CRDTs:</strong></p><ul><li><p>More bandwidth-efficient; we only send the operations, not the whole state.</p></li><li><p>Correctness usually depends on having causal order (or encoding causality in the ops) and tolerating duplicates via idempotence/dedup.</p></li><li><p>More complex to implement (causal broadcast, vector clocks, or equivalent).</p></li></ul></li></ul><p>For completeness, there&#8217;s also a third type we should be aware of: <strong>delta-based CRDTs</strong>. Here, convergence is achieved by sending and merging fragments of state (deltas) rather than the entire state. A quick analogy to picture the differences:</p><ul><li><p><strong>State-based CRDT:</strong> &#8220;<em>From time to time, send me the whole document.</em>&#8221;</p></li><li><p><strong>Operation-based CRDT:</strong> &#8220;<em>When you make a change, tell me exactly what you did.</em>&#8221; &#8594; &#8220;<em>Adding word `miles` at position 42.</em>&#8221;</p></li><li><p><strong>Delta-based CRDT:</strong> &#8220;<em>When you make a change, send me just the delta that reflects it (for example, the updated sentence)</em>&#8221; &#8594; &#8220;<em>And miles to go before I sleep.</em>&#8221;</p></li></ul><h1>CRDT vs. OT</h1><p>We talked about collaborative document editing. So you might assume a system like Google Docs is based on CRDTs, right?</p><p>Well, that&#8217;s not the case. <strong>Google Docs is based on another concept called OT (Operational Transformation)</strong>. The goal of OT and CRDT is the same: convergence among all nodes in a collaborative system.</p><p>The main difference is that OT requires all communication to go through the same server:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i4v7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i4v7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 424w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 848w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1272w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png" width="500" height="408.65384615384613" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:832,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:74701,&quot;alt&quot;:&quot;Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence." title="Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence." srcset="https://substackcdn.com/image/fetch/$s_!i4v7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 424w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 848w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1272w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.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>We haven&#8217;t mentioned it until now (on purpose), but <strong>with CRDTs, there&#8217;s no need for a central server to achieve convergence</strong>.</p><p>Back to our collaborative editing tool: if Alice and Bob are both offline but manage to connect their laptops directly, they could still achieve convergence without talking to a central server:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tSU3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tSU3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 424w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 848w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1272w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png" width="500" height="120.1923076923077" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:200,&quot;width&quot;:832,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:49073,&quot;alt&quot;:&quot;Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server.&quot;,&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server." title="Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server." srcset="https://substackcdn.com/image/fetch/$s_!tSU3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 424w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 848w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1272w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>As we saw earlier, CRDTs embed a deterministic conflict resolution algorithm. The data type itself ensures convergence.</p><p>That&#8217;s the key difference: CRDTs don&#8217;t need to make any assumptions about the network topology or about a central server. <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&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/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;f0ce5f94-0d7b-4799-8101-4639b98efb14&quot;}" data-component-name="MentionToDOM"></span> considers CRDT to be the natural successor of OT.</p><blockquote><p><strong>NOTE</strong>: So, why is Google Docs still based on OT? Historical reasons. Google Docs was launched before CRDTs existed, and it still works really well. There&#8217;s no practical reason for Google to migrate from OT to CRDT, despite some discussions about it in the past.</p></blockquote><h1>Conclusion</h1><ul><li><p>Operations are concurrent when they aren&#8217;t causally related; concurrency doesn&#8217;t automatically mean conflict.</p></li><li><p>Coordination is when replicas communicate and, if needed, wait to agree on a single outcome for concurrent updates before acknowledging clients, so they don&#8217;t diverge.</p></li><li><p>CRDTs accept independent updates on each replica and still converge via deterministic merge rules.</p></li><li><p>Three types: state-based (share full state), operation-based (share operations), delta-based (share just the changed parts).</p></li><li><p>CRDTs are a great fit for systems like offline-first collaboration and highly available systems.</p></li><li><p>Unlike OT, CRDTs don&#8217;t rely on a central server to reach the same result everywhere.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/exploring-database-isolation-levels">Exploring Database Isolation Levels</a></p></li><li><p><a href="https://read.thecoder.cafe/p/consensus">Consensus</a></p></li><li><p><a href="https://read.thecoder.cafe/p/safety-liveness">Safety and Liveness</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://x.com/ivanhzhao/status/1957832558017655292">Ivan Zhao (Notion&#8217;s CEO) tweet on the new Notion offline collaboration feature</a></p></li><li><p><a href="https://redis.io/blog/diving-into-crdts/">Diving into Conflict-Free Replicated Data Types (CRDTs) - Redis</a></p></li><li><p>CRDTs: The Hard Parts by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&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/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;5c3468ea-5010-43c8-b59b-d9afc76e64c9&quot;}" data-component-name="MentionToDOM"></span></p><div id="youtube2-x7drE24geUw" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;x7drE24geUw&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/x7drE24geUw?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://news.ycombinator.com/item?id=45606224">Hacker News discussion</a></p></li><li><p><a href="https://www.inkandswitch.com/peritext/">Peritext - A CRDT for Rich-Text Collaboration</a></p></li><li><p><a href="https://redis.io/active-active/">Active-Active geo-distribution (CRDTS-based) - Redis</a></p></li><li><p><a href="https://www.bartoszsypytkowski.com/crdt-optimizations/">Bartosz Sypytkowski&#8217;s 12-part blog series on CRDT</a></p></li><li><p><a href="https://crdt.tech">crdt.tech</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Have you worked with CRDTs before, or do you see another use case where they shine? Share your thoughts in the comments!</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/crdt/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/crdt/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Organic Growth vs. Controlled Growth]]></title><description><![CDATA[A codebase is like a garden: left to grow organically, it becomes colorful but chaotic.]]></description><link>https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth</link><guid isPermaLink="false">https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 30 Sep 2025 10:00:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XUmw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we will discuss the concept of organic growth vs. controlled growth. Get cozy, grab a coffee, and let&#8217;s begin!</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_!XUmw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XUmw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1664361,&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;:&quot;https://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.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_!XUmw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.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>A few months ago, I was in a meeting discussing the state of a codebase and heard myself say:</p><div class="pullquote"><p><em>This codebase has grown organically.</em></p></div><p>After reflecting on my own words, I began questioning myself: I don&#8217;t even know what organic growth really means and whether it is ultimately positive or negative.</p><p>Discussing the concept with various colleagues, I noticed we had different interpretations. I also created a <a href="https://x.com/teivah/status/1950276971839074785">poll</a> on X that went viral (#<em>irony</em>), showing that most people see organic growth as something positive.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sRsv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sRsv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 424w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 848w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1272w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png" width="598" height="251.68119266055047" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:872,&quot;resizeWidth&quot;:598,&quot;bytes&quot;:53267,&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;:&quot;https://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.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_!sRsv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 424w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 848w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1272w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.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>If Perplexity is correct, the term organic growth was used first in <em><a href="https://www.goodreads.com/book/show/661723.Bushido">Bushido: The Soul of Japan</a></em>, published in 1899. The author, Inazo Nitobe, describes Bushido (aka the way of the samurai) as something that developed through organic growth rather than being the invention of a single person or the result of a single event. In other words, Bushido emerged gradually over decades and centuries as a collective experience, not the product of one individual.</p><p>It&#8217;s easy to draw parallels with the many codebases we maintain at work. The older the codebase and the more developers it has had, each with their own vision of how the code should look. Differences in perception arise from factors like developers&#8217; varied mental models based on the parts of the code they know best. </p><p>Developers come and go, making changes, introducing biases about what the future should be, and after years, the codebase reflects hundreds or even thousands of such incremental changes.</p><p>This is organic growth in software: incremental delivery driven by agile methodology that shapes codebases, often in a bottom-up manner.</p><p>So, is organic growth good or bad? Let&#8217;s use the garden metaphor: imagine a public garden where anyone can plant whatever they want and wherever they want. Over time, sure, it&#8217;s colorful, but there&#8217;s little harmony, with a lack of overall guidance or direction:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XNU6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XNU6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2430306,&quot;alt&quot;:&quot;A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance.&quot;,&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://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance." title="A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance." srcset="https://substackcdn.com/image/fetch/$s_!XNU6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.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>Now imagine we control what can be planted and where, and periodically review and rearrange what&#8217;s growing. Our garden will likely look harmonious and well-maintained:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jXbE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jXbE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2552515,&quot;alt&quot;:&quot;A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order.&quot;,&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://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order." title="A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order." srcset="https://substackcdn.com/image/fetch/$s_!jXbE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.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>In my opinion, organic growth carries a somewhat negative connotation, implying a lack of direction, with systems growing out of ad hoc solutions and quick fixes rather than intentional design.</p><p>So, how can we move from a messy garden to a harmonious one? By transitioning from organic to controlled growth.</p><p>Controlled growth is the deliberate and reflective process of evolving a codebase. With controlled growth, we should also embrace progress that is not always perfect but consistently guided by shared patterns and standards, fostering sustainable, manageable, and harmonious development over time.</p><p>Here are five main rules for controlled growth:</p><ul><li><p><strong>Be consistent</strong>. Follow agreed conventions and standards to build maintainable and predictable codebases. Many standards aren&#8217;t explicit, so strive to follow even the implicit ones. For example, if an entity is consistently named X, don&#8217;t be a cowboy and name it Y; stick to X.</p></li><li><p><strong>Plan ahead for large changes.</strong> Think strategically and collectively about big transitions such as significant new features. Avoid chaos and technical debt by breaking ambitious changes into smaller phases, communicating plans early, and leveraging documentation assets such as design docs (see Explore Further section).</p></li><li><p><strong>Hold regular retrospectives.</strong> After major development milestones, gather the team to review what went well and what could improve. Retrospectives foster a culture of learning and continuous improvement, a strategic pillar of controlled growth.</p></li><li><p><strong>Apply the Boy Scout rule.</strong> Frequent changes are inevitable and often rushed under pressure. Remember: <em>&#8220;Always leave the campground cleaner than you found it.&#8221;</em> When making a pull request, spend a little time refactoring small bits, cleaning legacy code, removing dead code, or renaming variables. This keeps the garden harmonious over time.</p></li><li><p><strong>Build a team where everyone shares responsibility and speaks openly.</strong> Controlled growth shouldn&#8217;t fall only on tech leads; it should be everyone&#8217;s job. When all team members feel heard and share responsibility for the health and quality of the codebase, the team grows on a stronger, more sustainable foundation.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/programming">Programming</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/tidy-first">Tidy First?</a> <em>// We already discussed organic growth in this post.</em></p></li><li><p><a href="https://read.thecoder.cafe/p/focus-on-product-ideas-not-requirements">Focus on Product Ideas, Not Requirements</a></p></li><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://books.google.fr/books/about/Bushido.html?id=--HpQwAACAAJ">Bushido: The Soul of Japan</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.industrialempathy.com/posts/design-docs-at-google/">Design Docs at Google</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>When you say a codebase grew organically, what do you mean?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Second Brain]]></title><description><![CDATA[Your mind is for having ideas, but without a second brain, those ideas fade into memory.]]></description><link>https://read.thecoder.cafe/p/second-brain</link><guid isPermaLink="false">https://read.thecoder.cafe/p/second-brain</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 03 Sep 2025 10:03:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uHs5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, I wanted to share a book that had a huge impact on how I organize my personal and professional knowledge: <a href="https://www.goodreads.com/book/show/59616977-building-a-second-brain">Building a Second Brain</a> by Tiago Forte. Get cozy, grab a coffee, and let&#8217;s begin!</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_!uHs5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uHs5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1659530,&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;:&quot;https://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.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_!uHs5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.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><h1>A Decade of Failures</h1><p>For over a decade, I failed miserably at keeping an effective note-taking system, mostly for two reasons:</p><ol><li><p>I never had a single, centralized place. I used to rely on a combination of <a href="https://www.notion.com">Notion</a> + Apple Notes + a physical notebook + Kindle highlights + <a href="https://apps.ankiweb.net/">Anki</a>.</p></li><li><p>I didn&#8217;t have a system that was generic enough. I had a different format pretty much every time: book summaries, posts, computer science notes, <a href="https://www.thecoder.cafe/p/mistake-journal">mistake journal</a>, personal growth notes, and so on.</p></li></ol><p>The result was a messy system that didn&#8217;t scale. <strong>I kept losing knowledge, and it made learning inefficient</strong>. When we read or watch a great resource but don&#8217;t capture what we learned from it, chances are high that within a few months or even weeks, that knowledge fades away. That&#8217;s what kept happening to me.</p><p>In a world full of content&#8212;social media, work, books, courses, podcasts&#8212;being able to extract and retain working knowledge isn&#8217;t optional; it&#8217;s necessary if we want to <strong>keep growing as an engineer and as a person</strong>.</p><p>Let&#8217;s discuss an approach to solve this problem.</p><h1>Second Brain</h1><p>One of the first sentences in the book hooked me:</p><div class="pullquote"><p>Your mind is for having ideas, not holding them.</p></div><p>Our brain is great for processing ongoing tasks, but it&#8217;s not meant to retain everything. Over time, it lets go of unused ideas to make room for more relevant ones. This process, referred to as synaptic pruning, helps us adapt, but it also means we lose what we don&#8217;t externalize.</p><p><strong>That&#8217;s the promise of a second brain:</strong> <strong>a place to offload notes and thoughts, avoid losing knowledge, and build on it over time with new ideas.</strong></p><p>Before switching to the second brain approach, I also struggled with my notes because I wanted everything to be perfect. That drained a lot of time and energy. But one paragraph from the book really shifted my perspective:</p><div class="pullquote"><p>We have to remember that <strong>we are not building an encyclopaedia of immaculately organized knowledge</strong>. We are building a <strong>working system</strong>. [&#8230;] For that reason, you should prefer a system that is imperfect, but that continues to be useful in the real conditions of your life.</p></div><p>That changed everything for me. I stopped chasing perfection and started building something that simply works, something that supports me every day, both at work and in my personal life.</p><p>What I found enriching is that the book presents <strong>not just a system, but also a mindset</strong>. Let&#8217;s start with the latter.</p><h1>Mindset</h1><p>Knowledge work is about taking information and turning it into results, for example, delivering on a project. All day, we consume and then produce:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VahM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VahM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 424w, https://substackcdn.com/image/fetch/$s_!VahM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 848w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1272w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png" width="585" height="139" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:139,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17657,&quot;alt&quot;:&quot;Simple diagram showing a one-way flow from \&quot;Information\&quot; to \&quot;Projects\&quot; with a curved arrow.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Simple diagram showing a one-way flow from &quot;Information&quot; to &quot;Projects&quot; with a curved arrow." title="Simple diagram showing a one-way flow from &quot;Information&quot; to &quot;Projects&quot; with a curved arrow." srcset="https://substackcdn.com/image/fetch/$s_!VahM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 424w, https://substackcdn.com/image/fetch/$s_!VahM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 848w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1272w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The problem with this approach is that most of the information that we will gain will eventually be lost. Sure, we might remember the most important parts for a while. But what about the rest? It will fade, eventually.</p><p><strong>What we miss is a feedback loop, a way to </strong><em><strong>recycle</strong></em><strong> information into knowledge that we can reuse later</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_!s5ld!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s5ld!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 424w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 848w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1272w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png" width="585" height="280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:280,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30795,&quot;alt&quot;:&quot;Circular flow diagram showing how \&quot;Information\&quot; turns into \&quot;Knowledge\&quot; and then into \&quot;Projects\&quot; through a feedback loop.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Circular flow diagram showing how &quot;Information&quot; turns into &quot;Knowledge&quot; and then into &quot;Projects&quot; through a feedback loop." title="Circular flow diagram showing how &quot;Information&quot; turns into &quot;Knowledge&quot; and then into &quot;Projects&quot; through a feedback loop." srcset="https://substackcdn.com/image/fetch/$s_!s5ld!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 424w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 848w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1272w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.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>That&#8217;s what a second brain gives us: a way to turn information into assets we can reinvest in the future.</p><p>Another interesting idea in the book is to stop seeing notes as a flat list of things we&#8217;ve saved. Our notes can become <strong>building blocks</strong>, meaning pieces that help us create new ideas later on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M7oP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M7oP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 424w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 848w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1272w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png" width="1456" height="707" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:707,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107660,&quot;alt&quot;:&quot;Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures." title="Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures." srcset="https://substackcdn.com/image/fetch/$s_!M7oP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 424w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 848w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1272w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.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>That&#8217;s a powerful shift: notes aren&#8217;t just storage, they&#8217;re raw material for thinking. They can connect and evolve into new ideas. Being able to track down all your notes in a single place makes those connections easier to spot and build on.</p><p>One last point I wanted to discuss: creativity. Here&#8217;s the definition given by Neuroscientist Nancy C. Andreasen:</p><div class="pullquote"><p>Creative people are better at recognizing relationships, making associations, and connections.</p></div><p>A second brain is not only a memory tool, but also a thinking tool. Keeping an effective system to track down notes and ideas becomes a great tool to improve our creativity. Remember: <strong>creativity is not a talent, it&#8217;s a way of operating</strong>.</p><blockquote><p><strong>NOTE: </strong>Did you enjoy this punchline? It&#8217;s coming from a note I hold on creativity in my second brain &#128526;.</p></blockquote><h1>System</h1><p>In this section, we&#8217;ll delve into what a note really is, how to take notes effectively, and then go over the PARA system presented in the book.</p><h2>Notes</h2><p>So, what&#8217;s a note? The author defines it this way:</p><div class="pullquote"><p>A piece of content, interpreted through your lens, curated according to your taste, translated into your own words, or drawn from life experience, and stored in a secure place.</p></div><p>Let&#8217;s go over the different parts of that definition.</p><p>First, a note is something to use, not just to collect. Again, we&#8217;re not building an encyclopaedia, we&#8217;re building something that works for us. For example, if we&#8217;re interested in public speaking, we don&#8217;t need a note on every single resource we read or watch.</p><p>Instead, the author suggests asking a few questions to decide what&#8217;s worth capturing:</p><ol><li><p>Does it inspire us?</p></li><li><p>Is it useful?</p></li><li><p>Is this personal?</p></li><li><p>Is it surprising?</p></li></ol><p><strong>Ultimately, we should capture what resonates.</strong></p><p>For example, we may have read this <em>amazing</em> book that everyone is talking about and discover that it doesn&#8217;t resonate with us at all<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Conversely, we may have watched a 30-second video that had a profound effect on us and triggered emotions. In this case, it&#8217;s better to spend some time creating a note on this video rather than the book.</p><p>When something resonates with us, it&#8217;s our emotion-based, intuitive mind telling us it&#8217;s interesting before our logical mind can explain why.</p><h2>How to Take Notes</h2><p>Every time we take a note, we should ask: &#8220;<em>How can I make this as useful as possible for my future self?</em>&#8221;</p><p>One way to do that is to be mindful of our future limited time. Instead of tracking dozens, if not hundreds, of lines, <strong>we should focus on finding the essence</strong>, meaning the heart and soul of what a resource is trying to communicate.</p><p>But in some cases, that&#8217;s barely possible. For example, I recently read the <a href="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41344.pdf">F1: A distributed SQL database that scales</a> whitepaper. How can we capture the essence of such a dense technical document containing so much valuable information?</p><p>The solution, brought again by the author, is to use the <strong>progressive summarization technique</strong>. In short, it&#8217;s about layering our notes:</p><ul><li><p><strong>Layer 1 - Captured notes</strong>: Either a copy and paste or even better writing, down in our own words what we understood from it.</p></li><li><p><strong>Layer 2 - Bolded passages</strong>: Go over the captured notes and mark in bold the most important pieces.</p></li><li><p><strong>Layer 3 - Highlighted passages</strong>: Go over the bolded passages and highlight the most important pieces.</p></li><li><p><strong>Layer 4 - Summary</strong>: Write down a summary.</p></li></ul><p>Here&#8217;s an example from my F1 whitepaper notes. I created two main sections: <strong>Summary</strong> and <strong>Highlights</strong>.</p><ul><li><p>Layer 1: In Highlights, I captured all the raw content, for example, on locking.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-Irv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-Irv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png" width="600" height="215.52197802197801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f7c180-634d-4762-8137-d9acca27319f_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:133700,&quot;alt&quot;:&quot;Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity." title="Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity." srcset="https://substackcdn.com/image/fetch/$s_!-Irv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 2: I bolded the passages that were most interesting to me.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Hq7A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png" width="599" height="215.16277472527472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:132847,&quot;alt&quot;:&quot;Same excerpt with selected sentences in bold to highlight important ideas from the captured notes.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Same excerpt with selected sentences in bold to highlight important ideas from the captured notes." title="Same excerpt with selected sentences in bold to highlight important ideas from the captured notes." srcset="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 3: I highlighted the most important parts.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_sB2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_sB2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png" width="600" height="215.52197802197801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:135540,&quot;alt&quot;:&quot;Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage." title="Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage." srcset="https://substackcdn.com/image/fetch/$s_!_sB2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 4: I wrote a summary section with the ideas that were the most interesting for me.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!io78!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!io78!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!io78!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!io78!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png" width="600" height="435.16483516483515" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1056,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:302224,&quot;alt&quot;:&quot;Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors.&quot;,&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors." title="Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors." srcset="https://substackcdn.com/image/fetch/$s_!io78!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!io78!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!io78!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.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></li></ul><p>In the end, the note looks like this:</p><pre><code># Summary

- ...
- ...
- ...

# Highlights

## Architecture

## Data model

## Locking

## Etc.</code></pre><p>This approach allows me to come back later and start with a quick summary to refresh the main ideas. If I need a bit more, I can scan the bolded and highlighted passages. And if I really want to dive deeper, I can go through all the highlights.</p><p>Of course, every layer is optional. If we consider that a resource only needs layers 1 and 4 of summarization, or just 1 and 2, that&#8217;s perfectly fine.</p><p><strong>Again, our second brain should be something that works for us.</strong></p><h2>PARA</h2><p>The PARA system is at the core of the book. It&#8217;s a proposition on how to organize our notes. It is designed for actionability, with layers of action. To make things clear, a note can be assigned to one of the following domains:</p><ul><li><p><strong>Project</strong>: A short-term effort with a possible due date and a clear outcome that needs to happen in order to mark the project as complete. For example, publish a blog post about second brain.</p></li><li><p><strong>Area</strong>: Ongoing responsibilities, what we are committed to, and what requires constant attention.</p></li><li><p><strong>Resource</strong>: A catchall for anything that doesn&#8217;t belong to a project or an area. </p></li><li><p><strong>Archive</strong>: When a note becomes inactive or outdated, we can move it to the archive.</p></li></ul><blockquote><p><strong>NOTE</strong>: The distinction between area and resource wasn&#8217;t immediately clear to me, so here&#8217;s how I think about it.</p><p>I enjoy both fitness and climbing. But I&#8217;m only committed to fitness. I try to eat healthy, work out regularly, and so on. Climbing, on the other hand, is something I enjoy, but I only go from time to time. So in my system, fitness is an area, and climbing is a resource.</p></blockquote><p>The PARA system has two main benefits.</p><ul><li><p><strong>Clear focus</strong>: We&#8217;re not mixing short-term efforts with long-term maintenance. It helps us focus on outcomes and next steps rather than just piles of information.</p></li><li><p><strong>Genericity</strong>: PARA can handle all kinds of notes. It organizes information based on how actionable it is, not what kind of information it is.</p></li></ul><p>As I said, I used to lack a system that was generic enough to track all my notes. Now, whether it&#8217;s a book I read, a course I followed, or a post I came across, I capture everything that resonates with me using the PARA system.</p><h1>Notion</h1><p>To implement the second brain, I used <a href="https://www.notion.com/">Notion</a>, which I think is a fantastic tool with a lot of flexibility and configuration options.</p><p>If you don&#8217;t want to build your own second brain from scratch, you can check out this online tutorial:</p><div id="youtube2-EZXumCgT_l8" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;EZXumCgT_l8&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/EZXumCgT_l8?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Or, you can use my <a href="https://2brain.dev/notion/">personal Notion template</a>. This is the setup I use every day to track notes, growth tasks, my to-do list, areas, resources, and more.</p><h1>Conclusion</h1><p>In summary, the second brain method presented in the book follows the CODE system:</p><ul><li><p><strong>Capture</strong>: Keep what resonates, leave the rest aside.</p></li><li><p><strong>Organize</strong>: Save for actionability (project, area, or resource).</p></li><li><p><strong>Distill</strong>: Find the essence of what a resource communicates.</p></li><li><p><strong>Express</strong>: Show your work based on the knowledge you gained.</p></li></ul><p>Unless you&#8217;re a super memory genius, I strongly recommend looking into building a second brain. As we discussed, our brain should be for having ideas, not holding them.</p><p>Maybe the ideas in this post won&#8217;t fit you exactly, and you&#8217;ll come up with your own way of tracking notes. However you approach it, building a second brain has been incredibly important for me, and it might be for you as well.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/survivor-bias">Survivor Bias</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/59616977-building-a-second-brain">Building a Second Brain</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://2brain.dev/">Create Your Own Second Brain</a></p></li><li><p><a href="https://www.buildingasecondbrain.com/resources">Your Resource Guide to Building a Second Brain</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like. It&#8217;s a helpful signal to decide what to write next.</em></p><p>&#128172; <em>Are you using a second brain system? If not, how do you keep track of your notes and ideas?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/second-brain/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/second-brain/comments"><span>Leave a comment</span></a></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://www.goodreads.com/book/show/18144590-the-alchemist">The Alchemist</a>, I&#8217;m looking at you.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Availability Models]]></title><description><![CDATA[Highly available is too vague; watch out when you read or hear it.]]></description><link>https://read.thecoder.cafe/p/availability-models</link><guid isPermaLink="false">https://read.thecoder.cafe/p/availability-models</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 19 Aug 2025 10:02:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Dnex!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Last week, we reached 3,000 subscribers, that&#8217;s awesome, thank you all!</em></p><p><em>Recently, I was going through the <a href="https://antithesis.com/resources/reliability_glossary/#availability-models">distributed systems reliability glossary</a> brought by <a href="https://antithesis.com/">Antithesis</a> &amp; <a href="https://jepsen.io/">Jepsen</a>, and I found their approach on availability models particularly interesting. Let&#8217;s dive into that.</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_!Dnex!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dnex!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1647499,&quot;alt&quot;:&quot;Highly available is too vague; watch out when you read or hear it.&quot;,&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;:&quot;https://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Highly available is too vague; watch out when you read or hear it." title="Highly available is too vague; watch out when you read or hear it." srcset="https://substackcdn.com/image/fetch/$s_!Dnex!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.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><h1>Introduction</h1><p>Here are two database whitepapers:</p><ul><li><p><a href="https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf">Megastore</a>, a Google storage system:</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5dwy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5dwy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 424w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 848w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1272w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png" width="1270" height="298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:298,&quot;width&quot;:1270,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69127,&quot;alt&quot;:&quot;Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google.&quot;,&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;:&quot;https://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google." title="Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google." srcset="https://substackcdn.com/image/fetch/$s_!5dwy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 424w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 848w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1272w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><ul><li><p><a href="https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf">Dynamo</a>, an Amazon key-value store:</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tjAM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tjAM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 424w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 848w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1272w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png" width="1254" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60444,&quot;alt&quot;:&quot;Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon.&quot;,&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;:&quot;https://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon." title="Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon." srcset="https://substackcdn.com/image/fetch/$s_!tjAM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 424w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 848w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1272w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Both of these whitepapers use the term <em>highly available</em>. Of course, as a reader, we may expect these two whitepapers to mean the same thing when discussing high availability. After all, an orange is an orange, an apple is an apple, and a highly available system should be a highly available system. Yet, that&#8217;s not the case, and each paper means something different.</p><p>Let&#8217;s first look at what availability means, then discuss why high availability is a vague concept, and finally explore the different availability models.</p><h1>Availability</h1><p>In <a href="https://www.thecoder.cafe/p/cap">The CAP Theorem</a>, we already discussed availability as:</p><blockquote><p>Every request receives a non-error response, even if it may not contain the most up-to-date data.</p></blockquote><p>However, this definition missed a crucial dimension: <strong>response time</strong>. Technically, a system could be <em>available</em> even if it responds after an hour. While such a system technically provides a non-error response, it fails to deliver a usable experience, severely compromising its practical availability from a user perspective.</p><p>This is where <a href="https://www.thecoder.cafe/p/pacelc">The PACELC Theorem</a> offers a more practical perspective on availability. PACELC highlights that:</p><ul><li><p>In the presence of a partition, a system must choose between availability and consistency.</p></li><li><p>In the absence of partition, a system must choose between latency (the upper-bound limit during which a request should receive a non-error response) and consistency.</p></li></ul><p>So latency becomes part of availability. And that makes sense, right? If a system is too slow, it&#8217;s effectively down for the user. <strong>Availability isn&#8217;t just about uptime; it's also about whether the system is responsive in a meaningful timeframe.</strong></p><h1>High Availability</h1><p>The term high availability is vague. Does it mean 99.9% uptime? 99.999%?</p><p>ScyllaDB, in their <a href="https://www.scylladb.com/glossary/high-availability-database/">technical glossary</a> says it&#8217;s about <strong>maintaining levels of uptime that exceed normal SLAs</strong>. That&#8217;s fine, but it&#8217;s also easy to game.</p><p>Say we define an SLA at 50%, then run at 80%. Technically, we exceeded it. Yet, does that mean we&#8217;re offering a highly available database? Probably not.</p><p>The <a href="https://antithesis.com/resources/reliability_glossary">Antithesis reliability glossary</a> defines high availability as <strong>a system that is available more often than a single node</strong>. I quite like that one. If we take the availability of our best node and our system does worse than that, it&#8217;s not really highly available. Simple and practical.</p><p>Still, it&#8217;s not perfect. Let&#8217;s say we have five nodes, each available 50% of the time. With a write quorum of two, our write availability might still reach ~80%. But we&#8217;d still be down one request out of five. Hard to sell that as high availability.</p><p>To bring more clarity to the conversation, Antithesis introduced a set of availability models.</p><h1>Availability Models</h1><p><strong>An availability model is something to help us define when an operation should succeed.</strong></p><p>What do we mean by operation? It&#8217;s simply a request made to the system. That could be a read, a write, a ping, whatever the system is supposed to handle. Instead of thinking in terms of the whole system being up or down, we look at whether a specific request can succeed, even when parts of the system are failing.</p><p>Let&#8217;s explore three availability models.</p><h2>Majority available</h2><p><strong>Definition</strong>: A system is majority available if when a majority of non-faulty nodes can communicate with one another, these nodes can execute some operations.</p><p>Consider a database composed of five nodes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LM2b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LM2b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png" width="1456" height="435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41310,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.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_!LM2b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.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>In the nominal case, everything works: a client connects, and the database can process all operations.</p><p>Now, imagine two nodes go down. Maybe they crash, maybe there&#8217;s a network issue causing a partition:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ynkK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ynkK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 424w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 848w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1272w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png" width="1456" height="434" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51186,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.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_!ynkK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 424w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 848w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1272w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.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>We&#8217;re left with three nodes that can still talk to each other. That&#8217;s a majority. If the database can still perform operations in this situation, <strong>we say it&#8217;s majority available</strong>.</p><p>That&#8217;s how the <a href="https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf">Megastore whitepaper</a> defined <em>highly available</em>: being majority available.</p><p><strong>This model is often used when consistency matters.</strong> For example, when a write or a leader election requires a majority to agree before responding to the client. So even if some nodes are unreachable, the system can still make safe progress as long as the majority is intact.</p><h2>Total availability</h2><p><strong>Definition</strong>: A system is totally available if every non-faulty node can execute any operation.</p><p>Let&#8217;s take the same setup: a database with five nodes. This time, three of them are faulty:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DI0X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DI0X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png" width="1456" height="435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52716,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.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_!DI0X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.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>In a majority available model, we can&#8217;t do much as we don&#8217;t have a majority. <strong>But in a totally available model, the system can still handle operations.</strong></p><p>Indeed, in this model, each non-faulty node can act on its own. It doesn&#8217;t need to coordinate with others or wait for a network round-trip. This model favors latency. Just handle the request and move on.</p><p>That&#8217;s how the <a href="https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf">Dynamo whitepaper</a> defined <em>highly available</em>: being totally available.</p><p>The tradeoff is consistency. Totally available systems can&#8217;t enforce strong guarantees because the nodes don&#8217;t necessarily sync before responding. That&#8217;s why this model typically goes hand in hand with weaker <a href="https://read.thecoder.cafe/p/consistency-model">consistency models</a>.</p><h2>Sticky Available</h2><p><strong>Definition</strong>: A system is sticky available if whenever a client&#8217;s transactions are executed against a copy of database state that reflects all of the client&#8217;s prior operations, it eventually receives a response, even in the presence of indefinitely long partitions.</p><p>Let&#8217;s look at an example. Two clients, A and B, are connected to a database and make updates 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_!PMlD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PMlD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 424w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 848w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1272w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png" width="599" height="324.49918166939443" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:662,&quot;width&quot;:1222,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:54439,&quot;alt&quot;:&quot;&quot;,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!PMlD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 424w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 848w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1272w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.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">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Sticky available means:</p><ul><li><p>After update 5, client A will eventually get a response that reflects at least updates 1, 4, and 5.</p></li><li><p>After update 3, client B will eventually get a response that reflects at least updates 2 and 3.</p></li></ul><p>How can we achieve that? It depends on how replication is handled by the system.</p><h3>Fully Replicated System</h3><p>In a fully replicated system, all nodes store the full dataset. <strong>Sticky availability can be achieved by making sure a client always talks to the same node.</strong></p><p>Here&#8217;s the same example again, but now with client A always connected to node 1, and client B to node 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NBGQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NBGQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 424w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 848w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png" width="401" height="472.1308203991131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1062,&quot;width&quot;:902,&quot;resizeWidth&quot;:401,&quot;bytes&quot;:84558,&quot;alt&quot;:&quot;&quot;,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!NBGQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 424w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 848w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.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">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Here, node 2 hasn&#8217;t yet replicated update 5, and node 1 hasn&#8217;t yet replicated update 3. Still, since each client sticks to one node, <strong>they eventually see a consistent view of their own operations</strong>, despite possible failures such as a partition between the nodes.</p><h3>Partially Replicated System</h3><p>Now, let&#8217;s discuss a partially replicated system where nodes are replicas for subsets of data items.</p><p>Here&#8217;s a (dummy) partitioning system where even-numbered updates go to node 1 and odd-numbered ones to node 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!24-k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!24-k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 424w, https://substackcdn.com/image/fetch/$s_!24-k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 848w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1272w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png" width="399" height="381.3059866962306" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:862,&quot;width&quot;:902,&quot;resizeWidth&quot;:399,&quot;bytes&quot;:74500,&quot;alt&quot;:&quot;&quot;,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!24-k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 424w, https://substackcdn.com/image/fetch/$s_!24-k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 848w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1272w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.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">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Here, clients can&#8217;t just stick to a single node. <strong>Instead, they must maintain stickiness with a single logical copy of the database, which may consist of multiple nodes.</strong></p><p><strong>Clients can also help implement this model by acting as servers themselves.</strong> For example, a client could cache its own reads and writes, allowing it to return responses even during indefinitely long partitions.</p><h1>Summary</h1><ul><li><p>Highly available is too vague; watch out when you read or hear it. It might mean different things depending on the system or author.</p></li><li><p>Majority available means a majority of nodes can still perform some operations. This model supports stronger consistency.</p></li><li><p>Totally available means each non-faulty node can handle requests independently. It favors latency, but usually comes with weaker consistency.</p></li><li><p>Sticky available means clients can make progress as long as they keep talking to a replica that reflects their own history.</p></li><li><p>Availability models help us reason at the operation level, not just the system level. What matters is which operation can succeed, and under what conditions.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/pacelc">The PACELC Theorem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/exploring-database-isolation-levels">Exploring Database Isolation Levels</a></p></li><li><p><a href="https://read.thecoder.cafe/p/latency-and-user-experience">Latency and User Experience</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://antithesis.com/resources/reliability_glossary">A distributed systems reliability glossary - Antithesis</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.scylladb.com/glossary/high-availability-database/">High Availability Database Definition - ScyllaDB</a></p></li><li><p><a href="https://jepsen.io/consistency/models">Consistency Models - Jepsen</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like. It&#8217;s a helpful signal to decide what to write next.</em></p><p>&#128172; <em>When someone says their system is &#8220;highly available,&#8221; what do you assume they mean?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/availability-models/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.thecoder.cafe/p/availability-models/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[What Makes Code Beautiful]]></title><description><![CDATA[The more average the code, the more pleasurable it is to read and maintain.]]></description><link>https://read.thecoder.cafe/p/what-makes-code-beautiful</link><guid isPermaLink="false">https://read.thecoder.cafe/p/what-makes-code-beautiful</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 10 Jul 2025 10:01:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lbRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today we will discuss the concept of beauty in programming.</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_!lbRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lbRT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1656275,&quot;alt&quot;:&quot;The more average the code, the more pleasurable it is to read and maintain.&quot;,&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;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The more average the code, the more pleasurable it is to read and maintain." title="The more average the code, the more pleasurable it is to read and maintain." srcset="https://substackcdn.com/image/fetch/$s_!lbRT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.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>Let me ask you a simple question: <strong>what makes a code beautiful?</strong></p><p>Try thinking about this question (at least a little) before scrolling down.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K5jT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" width="725.5375366210938" height="362.7687683105469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:725.5375366210938,&quot;bytes&quot;:55063,&quot;alt&quot;:&quot;Time to think.&quot;,&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;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Time to think." title="Time to think." srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.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>You probably came up with a few characteristics: It&#8217;s readable and modular. Maybe it&#8217;s well tested. Or maybe it follows clean code principles or other familiar practices.</p><p><strong>What if I told you that beautiful code is just&#8230; average code</strong>? That might sound silly, but let&#8217;s walk through it.</p><p><em><a href="https://journals.sagepub.com/doi/10.1111/j.1467-9280.1990.tb00079.x">Attractive Faces Are Only Average</a></em> is a foundational study by Judith H. Langlois and Lori A. Roggman in the psychology of facial attractiveness. They created composite images by averaging multiple individual faces&#8212;noses, eyes, cheekbones&#8212;all mathematically averaged.</p><p>These composites were consistently rated as more attractive than the individual faces used to make them. <strong>In fact, the more individual faces were averaged into a composite, the more attractive the resulting face became</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_!aS4y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aS4y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg" width="445" height="341" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:341,&quot;width&quot;:445,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167328,&quot;alt&quot;:&quot;A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect.&quot;,&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;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect." title="A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect." srcset="https://substackcdn.com/image/fetch/$s_!aS4y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.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.snexplores.org/article/face-values">Credits</a></figcaption></figure></div><p>This suggests that facial features close to the population mean are generally preferred.</p><p>Why? The main theory is <em>processing fluency</em>: <strong>the easier something is for our brain to process, the more we like it</strong>. Average faces are easier to recognize and interpret, so they feel more pleasant.</p><p>This principle doesn&#8217;t stop at faces. It applies to advertising, art, or even decision-making. When something is easy to process, brain imaging studies show that it activates reward-related regions. We enjoy it more, without even realizing why.</p><p>So what happens when we apply this principle to code?</p><p>It means that the more average the code is, the more it aligns with what we&#8217;ve seen before, and the more beautiful it feels. The less surprising it is, the more pleasurable it is to read, understand, and maintain.</p><p>How can we write average code?</p><ul><li><p><strong>Use standard naming conventions</strong>: Stick to familiar names so others instantly know what things are.</p></li><li><p><strong>Follow language idioms and common patterns</strong>: Write code the way others expect it to be written.</p></li><li><p><strong>Favor clarity over cleverness</strong>: The easier it is to read, the more enjoyable it is to work with.</p></li><li><p><strong>Be consistent</strong>: Predictability makes everything easier to understand.</p></li><li><p><strong>Minimize unnecessary novelty</strong>: The more our code looks like what we&#8217;ve seen before, the faster it gets processed and the more it&#8217;s liked.</p></li></ul><p>Beautiful code is the kind that conforms to established patterns, idioms, and norms. It&#8217;s not flashy, novel, or overly clever. It&#8217;s clear, familiar, and quietly elegant. Just average.</p><p>What if next time, the best compliment your pull request could receive wasn&#8217;t that it was &#8220;brilliant&#8221; but simply &#8220;average&#8221;?</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/software-engineering">Software Engineering</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load: Reducing Mental Overhead in Software Design</a></p></li><li><p><a href="https://read.thecoder.cafe/p/readability">Readability: Understanding the What, the Why, and the How</a></p></li><li><p><a href="https://read.thecoder.cafe/p/premature-abstractions">Premature Abstractions: Avoiding Unnecessary Complexity in Software Design</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://journals.sagepub.com/doi/10.1111/j.1467-9280.1990.tb00079.x">Attractive Faces Are Only Average</a> <em>// The study mentioned in the post.</em></p></li><li><p><a href="https://pragprog.com/titles/atcrime2/your-code-as-a-crime-scene-second-edition/">Your Code as a Crime Scene</a> <em>// I read about this study from this book.</em></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.sciencedirect.com/science/article/pii/S0022103119302732">Processing fluency</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>Does this idea resonate with you or does it feel wrong? Curious to hear your perspective.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/what-makes-code-beautiful/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/what-makes-code-beautiful/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Don’t Be Ashamed to Say "I Don’t Know"]]></title><description><![CDATA[These three words that made us immediately trust her more than anyone else before:&#160;I don&#8217;t know.]]></description><link>https://read.thecoder.cafe/p/i-dont-know</link><guid isPermaLink="false">https://read.thecoder.cafe/p/i-dont-know</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 25 Jun 2025 10:01:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!b7KY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today, let&#8217;s discuss the power of &#8220;I don&#8217;t know&#8220; with a personal story.</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_!b7KY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b7KY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1656854,&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;:&quot;https://www.thecoder.cafe/i/164705765?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.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_!b7KY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.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>Last month, I was at the hospital with my partner for the birth of our newborn. During our stay, my partner experienced a specific symptom, and we wanted to understand what could be causing it. So we asked the midwife.</p><p>We immediately noticed the hesitation in her eyes. When she finally gave an answer, it came with a kind of forced confidence, and we both felt she wasn&#8217;t sure about it.</p><p>At our hospital, midwives do 12-hour shifts. So a few hours later, we asked the exact same question to the next midwife. Same hesitation, but this time, a different answer.</p><p>And so it went on. Every shift, we asked again. Every time, a different answer. Eventually, it even became a game between my partner and me: trying to guess what the next answer would be.</p><p>Until&#8230; The one. The one who broke this cycle.</p><p>We asked her the same question. She paused. Thought about it. And then said something unexpected:</p><div class="pullquote"><p>I don&#8217;t know.</p></div><p>It might seem counterintuitive, but these three words made us immediately trust her more than anyone else before<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>.</p><p>Twenty minutes later, she even came back to our room and said:</p><div class="pullquote"><p>I asked the doctor, the answer is because of [X]. Thanks for asking, I learned something.</p></div><p>That brief exchange resonated with me.</p><p>In our field, we often put a lot of weight on posture. We build up our position as the go-to person for a codebase, a data model, or a framework. The more we know, the more we are seen as the one to consult or include in any related discussion.</p><p>But from that posture, admitting we don&#8217;t know something can feel like pulling out the bottom card in a house of cards. Suddenly, it feels like everything we built to earn that status might collapse.</p><p>Yet, if we take a step back, admitting we don&#8217;t know shouldn&#8217;t be seen as something shameful or embarrassing. In fact, it&#8217;s often the most responsible thing we can do.</p><ul><li><p><strong>Pretending to know can lead to bad decisions.</strong> It creates false confidence and can steer a team in the wrong direction leading to possibly terrible outcomes.</p></li><li><p><strong>Authority isn&#8217;t built on knowing everything.</strong> It&#8217;s about being reliable and honest, someone others trust, and they can talk to with confidence.</p></li><li><p><strong>Teams work better when people feel safe to admit uncertainty.</strong> It fosters psychological safety among the team members, which Google identified as the top trait of effective teams.</p></li><li><p><strong>Curiosity + humility = real learning. </strong>Admitting we don&#8217;t know something is what keeps us learning and growing, no matter how experienced we are.</p></li></ul><p>Whether it&#8217;s for us or others, next time we don&#8217;t know something, let&#8217;s be like that midwife: let&#8217;s just admit it. Without shame.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/lateral-thinking">Lateral Thinking</a></p></li><li><p><a href="https://read.thecoder.cafe/p/streetlight-effect">Streetlight Effect</a></p></li><li><p><a href="https://read.thecoder.cafe/p/10-technical-writing-rules">10 Rules I Learned About Technical Writing</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://rework.withgoogle.com/en/guides/understanding-team-effectiveness">Understand team effectiveness</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>How comfortable are you with saying &#8220;I don&#8217;t know&#8220;?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/i-dont-know/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/i-dont-know/comments"><span>Leave a comment</span></a></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>Turns out, our gut feeling was right. She ended up being better than most of the other midwives we met.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Soft vs. Hard Dependency]]></title><description><![CDATA[Turning hard dependencies into soft ones is one of the most effective ways to improve the reliability of a system.]]></description><link>https://read.thecoder.cafe/p/soft-hard-dependency</link><guid isPermaLink="false">https://read.thecoder.cafe/p/soft-hard-dependency</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 18 Jun 2025 10:02:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!j645!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today, we&#8217;re exploring a key aspect of distributed systems: how to think about dependencies between components and why it matters for reliability.</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_!j645!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!j645!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!j645!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!j645!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!j645!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!j645!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1672275,&quot;alt&quot;:&quot;Turning hard dependencies into soft ones is one of the most effective ways to improve the reliability of a system.&quot;,&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;:&quot;https://www.thecoder.cafe/i/163403483?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Turning hard dependencies into soft ones is one of the most effective ways to improve the reliability of a system." title="Turning hard dependencies into soft ones is one of the most effective ways to improve the reliability of a system." srcset="https://substackcdn.com/image/fetch/$s_!j645!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!j645!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!j645!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!j645!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41235100-fef0-486f-b9f9-fbeb25563181_1600x800.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><h1>Introduction</h1><p>When we build a system composed of multiple components (e.g., database, services, caches), it&#8217;s important to understand the dependency graph. For example, a service might depend on:</p><ul><li><p>A database to store data</p></li><li><p>A messaging layer to exchange information</p></li><li><p>A cache to reduce latency</p></li></ul><p>Having a clear understanding of the dependencies in a system helps us maintain it more efficiently. But there's one question we often overlook: Are these dependencies soft or hard?</p><ul><li><p><strong>Soft dependency</strong>: One that is <strong>non-critical</strong> for the service to operate properly.</p></li><li><p><strong>Hard dependency</strong>: One that is <strong>critical</strong> for the service to operate properly.</p></li></ul><p>&#8220;Operate properly&#8221; in this context means, for example, that a service responds to requests, doesn&#8217;t lose data, and maintains an acceptable level of performance. In short, <strong>the service works reliably</strong>. </p><p>Two examples to illustrate the concept of soft and hard dependencies:</p><ul><li><p>A recommendation service is a <strong>soft dependency</strong> for a video platform. If it&#8217;s down, users can still watch videos, just without personalized suggestions.</p></li><li><p>An authentication service is a <strong>hard dependency</strong> for a system that requires users to log in. If authentication is down, users can&#8217;t access the system.</p></li></ul><h1>Why It Matters</h1><p>Understanding the type of dependency helps us make the right decisions:</p><ul><li><p><strong>Reliability expectations</strong>:</p><ul><li><p>Soft: High reliability expectation may not be necessary. Back to the example of a recommendation service for a streaming system, this service doesn&#8217;t need 5 9s availability (99.999%) if it isn&#8217;t on the critical user journey.</p></li><li><p>Hard: A hard dependency must match or even exceed the reliability of the dependent service. If a critical backend is only available 99.5% of the time but our own SLO is 99.9%, we have a structural problem. Setting the right expectation for a hard dependency is critical.</p></li></ul></li><li><p><strong><a href="https://www.thecoder.cafe/i/148164701/fault-tolerant">Fault-tolerance</a> strategy</strong>:</p><ul><li><p>Soft: If the dependency is unavailable, we are not obliged to build a proper fault-tolerant strategy. We can let it degrade gracefully and wait for it to be back.</p></li><li><p>Hard: If the dependency is unavailable, we need to work on a strategy, such as establishing an efficient fallback strategy to keep our service running.</p></li></ul></li><li><p><strong>Observability and alerting</strong>:</p><ul><li><p>Soft: Observability is still important, but alerts can often have a lower priority or be routed differently.</p></li><li><p>Hard: The dependency must be tightly monitored. Failures or even minor degradation, such as latency spikes, error rates, or availability dips, must be tracked continuously.</p></li></ul></li><li><p><strong>Rollout and change management</strong>:</p><ul><li><p>Soft: Changes can be managed with more flexibility. Rollout may not require tight coordination or strict sequencing, and temporary failures might be acceptable.</p></li><li><p>Hard: Rollouts become delicate operations. We often need tight orchestration between teams, version compatibility checks, gradual rollouts with validation at each step, and well-tested rollback mechanisms. Any mistake could trigger a production incident.</p></li></ul></li></ul><h1>Soft or Hard Dependency?</h1><p>Classifying a dependency isn&#8217;t always obvious.</p><p>In some cases, it&#8217;s fairly straightforward. For example, if a REST endpoint requires a database query, that database is a hard dependency. But gray areas are fairly common, for example:</p><ul><li><p>A service can run without a certain dependency at runtime, but it still needs that dependency at startup to initialize. In this case, the dependency is hard from an operational point of view. If it&#8217;s down during a deploy or a scale-out, we can&#8217;t even get the service running.</p></li><li><p>A service calls a soft dependency, but the RPC call has no timeout or fallback. If the dependency becomes unresponsive, the latency of our service spikes, possibly exhausting thread pools or request queues. What was supposed to be a soft dependency now puts the entire system at risk.</p></li></ul><p>These are examples of soft dependencies not handled correctly, turning into hard ones in practice. <strong>Whether a dependency is technically optional doesn't matter if the failure of this dependency ends up blocking our service</strong>.</p><p>In many systems, identifying these cases is not trivial. Approaches like deliberately breaking dependencies or introducing hazardous conditions (e.g., random network delays) can help reveal which dependencies are truly non-critical and which ones only appear to be.</p><h1>Evolutions Over Time</h1><p>To make things even more complex, we need to keep in mind that the type of a dependency is not set in stone. <strong>A dependency that starts as soft can easily turn into a hard one over time</strong>.</p><p>Let&#8217;s consider a service that reads data from a database. We introduce a cache to reduce latency. Initially, this cache is a soft dependency. If it goes down, we fall back to the database, which results in an acceptable latency increase.</p><p>Yet, as traffic grows, the service begins to rely on the cache not just for latency but for throughput. At some point, if the cache becomes cold and every request hits the database, the database may no longer be able to handle the load.</p><p>In this example, the cache was a soft dependency, but it became a hard one due to changes in system conditions (more traffic).</p><p>This evolution (from soft to hard) is, unfortunately, much more common than the reverse. Without active effort on efficient maintenance and continuous testing, it&#8217;s fairly common for a soft dependency to turn silently into a hard one.</p><h1>Improving Reliability</h1><p>On the other hand, with active and continuous effort, <strong>it&#8217;s possible to turn a hard dependency into a soft one</strong>. One effective approach is to design a fallback strategy that makes the dependency&#8217;s downtime essentially invisible.</p><p>Designing a solid fallback is anything but simple (we&#8217;ll explore this in a future post). However one principle stands out: <strong>fallbacks need to be tested, and they need to be tested continuously</strong>. A fallback that hasn&#8217;t been exercised in months isn&#8217;t a fallback. It&#8217;s dead code.</p><p>Once we&#8217;ve reached a point where the dependency can go down and users don&#8217;t notice, then the dependency is soft. Turning hard dependencies into soft ones is one of the most effective ways to improve the reliability of a system.</p><h1>Conclusion</h1><ul><li><p>To manage dependencies effectively, we need to classify them as either soft or hard.</p></li><li><p>To avoid surprises, we must understand that soft dependencies can turn hard without warning, especially as systems scale.</p></li><li><p>To improve reliability, we should actively turn hard dependencies into soft ones using strategies like efficient fallbacks.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/reliability">Reliability</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/reliability">Reliability: The Most Important Feature a System Can Have</a></p></li><li><p><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable? The Key Differences Explained</a></p></li><li><p><a href="https://read.thecoder.cafe/p/graceful-degradation">Graceful Degradation: Preventing Complete System Failures</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://cloud.google.com/blog/products/devops-sre/defining-slos-for-services-with-dependencies-cre-life-lessons">Defining SLOs for services with dependencies - Google Cloud</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>Have you seen a soft dependency quietly become critical over time?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/soft-hard-dependency/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/soft-hard-dependency/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Keeping a Mistake Journal]]></title><description><![CDATA[Research suggests that reflecting on errors is one of the most effective ways to reinforce learning.]]></description><link>https://read.thecoder.cafe/p/mistake-journal</link><guid isPermaLink="false">https://read.thecoder.cafe/p/mistake-journal</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 28 May 2025 08:00:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ZylC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today, I wanted to share with you a method I&#8217;ve been personally using to learn from my mistakes.</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_!ZylC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZylC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZylC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab185522-4c15-42e8-b194-5e808869a276_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1660162,&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;:&quot;https://www.thecoder.cafe/i/158852422?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.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_!ZylC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!ZylC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab185522-4c15-42e8-b194-5e808869a276_1600x800.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><h1>Why Track Mistakes?</h1><p>Making mistakes is inevitable. Personally, I even wrote a <a href="https://www.goodreads.com/book/show/58571862-100-go-mistakes-and-how-to-avoid-them">book</a> about mistakes, and, as I mentioned in it, I was a great source of inspiration for the content.</p><p>But what really matters is not <strong>making the same mistakes over and over</strong>. Ideally, we make a mistake once, extract a lesson, and ensure we never repeat it.</p><p>Do you know that making mistakes can actually help us grow? Research by cognitive scientist Janet Metcalfe suggests that <strong>reflecting on errors</strong> is one of the most effective ways to reinforce learning. Indeed, when we consciously analyze our mistakes, they don&#8217;t just fade away; instead, they reshape our thinking, helping us adapt and avoid repeating them in the future.</p><p>That&#8217;s why, for the past two years, I&#8217;ve been following a simple yet effective system to track, reflect on, and learn from my own mistakes. Of course, I don&#8217;t log every tiny one. Yet, my rule is simple: if a mistake makes me <strong>frustrated with myself</strong>, it&#8217;s worth tracking.</p><h1>Entry Format</h1><p>Each mistake I log follows a structured format:</p><ul><li><p><strong>Name:</strong> A short, descriptive name.</p></li><li><p><strong>Tags:</strong> Relevant categories.</p></li><li><p><strong>Context:</strong> The situation in which the mistake happened.</p></li><li><p><strong>Problem:</strong> A description of the mistake itself.</p></li><li><p><strong>Impacts:</strong> The possible consequences of making this mistake.</p></li><li><p><strong>Lessons learned:</strong> What I can take away from it.</p></li><li><p><strong>Correction plan:</strong> What I will do to prevent this mistake in the future.</p></li><li><p><strong>Latest occurrence:</strong> When I last made this mistake.</p></li><li><p><strong>Repetition:</strong> How many times I made this mistake.</p></li></ul><p>Here&#8217;s an example:</p><ul><li><p><strong>Name</strong>: Skimming instead of reading carefully.</p></li><li><p><strong>Tags</strong>: Critical thinking, Attention to detail.</p></li><li><p><strong>Context</strong>: When reviewing an email, document, or technical spec.</p></li><li><p><strong>Problem</strong>: To save time, I sometimes skim through important content instead of reading it properly.</p></li><li><p><strong>Impacts</strong>:</p><ol><li><p>Leads to a partial understanding of a context.</p></li><li><p>Causes misunderstandings, requiring additional clarifications.</p></li><li><p>It can result in wrong decisions based on incomplete information, and/or I can look like an idiot.</p></li></ol></li><li><p><strong>Correction plan: </strong>Better assessment of whether full attention is required. If it is, commit to reading properly.</p></li></ul><p>Personally, I keep my mistake journal in <a href="https://www.notion.com/">Notion</a>, but I guess any tool or even a physical journal could work.</p><h1>Final Thoughts</h1><p>Since implementing this system, I have noticed:</p><ul><li><p><strong>Fewer repeated mistakes</strong>: I make the same mistakes less often.</p></li><li><p><strong>Pattern detection</strong>: It helped me recognize patterns in my own mistakes and better understand my own biases.</p></li><li><p><strong>Better decision-making</strong>: I catch potential mistakes earlier.</p></li></ul><p>Mistakes are part of learning; they don&#8217;t have to be failures if we learn from them. By tracking them, we can turn them into lessons that help us grow and improve over time.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/confirmation-bias">Confirmation Bias</a></p></li><li><p><a href="https://read.thecoder.cafe/p/survivor-bias">Survivor Bias</a></p></li><li><p><a href="https://read.thecoder.cafe/p/10-technical-writing-rules">10 Rules I Learned About Technical Writing</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://pubmed.ncbi.nlm.nih.gov/27648988/">Learning from Errors - Janet Metcalfe</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>Do you also track your mistakes? If yes, what&#8217;s your approach?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/mistake-journal/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/mistake-journal/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Property-Based Testing]]></title><description><![CDATA[Traditional tests don&#8217;t guarantee a bug-free system; a passing test only&#160;confirms that the tested scenario behaves as expected.]]></description><link>https://read.thecoder.cafe/p/property-based-testing</link><guid isPermaLink="false">https://read.thecoder.cafe/p/property-based-testing</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 21 May 2025 08:00:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wNtI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! We recently hit 2,000 subscribers, so thank you very much for the support! &#127881;</em></p><p><em>Today, let&#8217;s dive into the world of testing and explore Property-Based Testing. In this post, we will discuss traditional tests, explore their limitations, and see how Property-Based Testing can help us improve our testing strategy by focusing on the fundamental concept of properties.</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_!wNtI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wNtI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wNtI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1677533,&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;:&quot;https://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.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_!wNtI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!wNtI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c974cd-3b98-45bd-860b-fec6499e3d18_1600x800.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><h1>Traditional Tests</h1><p>Imagine this white box contains all the behaviors implemented in a software:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PZKe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PZKe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 424w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 848w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 1272w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PZKe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png" width="450" height="480.61224489795916" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:882,&quot;resizeWidth&quot;:450,&quot;bytes&quot;:40368,&quot;alt&quot;:&quot;Diagram representing a software system under test, depicted as a white box symbolizing all implemented behaviors in the software.&quot;,&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;:&quot;https://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram representing a software system under test, depicted as a white box symbolizing all implemented behaviors in the software." title="Diagram representing a software system under test, depicted as a white box symbolizing all implemented behaviors in the software." srcset="https://substackcdn.com/image/fetch/$s_!PZKe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 424w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 848w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.png 1272w, https://substackcdn.com/image/fetch/$s_!PZKe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf87eda4-10c9-4d01-9afb-4675986036ed_882x942.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>Of course, like with any codebase, our software contains bugs (imagine how boring bugs-free software would be!). Let&#8217;s make the green part represent all the valid behaviors while the red part the invalid ones (the bugs):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!orcL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!orcL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 424w, https://substackcdn.com/image/fetch/$s_!orcL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 848w, https://substackcdn.com/image/fetch/$s_!orcL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 1272w, https://substackcdn.com/image/fetch/$s_!orcL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!orcL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png" width="451" height="481.6108597285068" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb5f183b-456f-4c13-b615-c2a34c380631_884x944.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:944,&quot;width&quot;:884,&quot;resizeWidth&quot;:451,&quot;bytes&quot;:37407,&quot;alt&quot;:&quot;Diagram representing a software system under test, with a green section symbolizing valid behaviors and a red section at the bottom indicating bugs or invalid behaviors.&quot;,&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;:&quot;https://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram representing a software system under test, with a green section symbolizing valid behaviors and a red section at the bottom indicating bugs or invalid behaviors." title="Diagram representing a software system under test, with a green section symbolizing valid behaviors and a red section at the bottom indicating bugs or invalid behaviors." srcset="https://substackcdn.com/image/fetch/$s_!orcL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 424w, https://substackcdn.com/image/fetch/$s_!orcL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 848w, https://substackcdn.com/image/fetch/$s_!orcL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.png 1272w, https://substackcdn.com/image/fetch/$s_!orcL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb5f183b-456f-4c13-b615-c2a34c380631_884x944.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>Now, let&#8217;s write some tests to validate our code. For the sake of visualizations, we will partition the tests written into three sets: A, B, and C&#8212;all of them will be <strong>passing</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_!RR48!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RR48!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!RR48!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!RR48!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!RR48!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RR48!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png" width="600" height="462.5204582651391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:1222,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:66500,&quot;alt&quot;:&quot;Diagram illustrating the partitioning of software tests into three sets: Tests set A (covering valid behaviors), Tests set B (covering some invalid behaviors), and Tests set C (covering nonexistent behaviors).&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating the partitioning of software tests into three sets: Tests set A (covering valid behaviors), Tests set B (covering some invalid behaviors), and Tests set C (covering nonexistent behaviors)." title="Diagram illustrating the partitioning of software tests into three sets: Tests set A (covering valid behaviors), Tests set B (covering some invalid behaviors), and Tests set C (covering nonexistent behaviors)." srcset="https://substackcdn.com/image/fetch/$s_!RR48!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!RR48!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!RR48!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!RR48!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b85f679-68e8-4f19-9851-61343e1f1744_1222x942.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">Test set A covers 50% of the valid behaviors. Test set B covers 75% of the invalid behaviors. Test set C covers nonexistent behaviors.</figcaption></figure></div><ul><li><p><strong>Test set A: </strong>The true positive tests that correctly verify valid behaviors exhibited by the software. The remaining visible green part represents valid behaviors not covered by tests.</p></li><li><p><strong>Test set B</strong>: The false negative tests that <em>should</em> catch bugs, but they don&#8217;t because they are flawed. The remaining visible red part represents invalid behaviors not covered by tests.</p></li><li><p><strong>Test set C: </strong>The invalid tests that check for behaviors that&#8230; don&#8217;t even exist. They typically arise from misunderstandings of how a feature is supposed to work, and because the tests themselves are flawed, they fail to reveal this misalignment.</p></li></ul><p>Let&#8217;s break down the four main problems in this example, sorted in increasing order of severity:</p><ul><li><p><strong>1. Invalid tests covering nonexistent behavior:</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_!lzuJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lzuJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lzuJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png" width="600" height="462.5204582651391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa27a547-fa97-4063-969c-86769c051547_1222x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:1222,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:68614,&quot;alt&quot;:&quot;Diagram highlighting Tests set C in a blue crosshatched area, emphasizing that these tests cover nonexistent behaviors that do not exist in the software system.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram highlighting Tests set C in a blue crosshatched area, emphasizing that these tests cover nonexistent behaviors that do not exist in the software system." title="Diagram highlighting Tests set C in a blue crosshatched area, emphasizing that these tests cover nonexistent behaviors that do not exist in the software system." srcset="https://substackcdn.com/image/fetch/$s_!lzuJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!lzuJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa27a547-fa97-4063-969c-86769c051547_1222x942.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>These tests are fundamentally misaligned with reality. They cause unnecessary maintenance overhead and can mislead developers if tests serve as living documentation (see <a href="https://www.thecoder.cafe/p/unit-tests-as-documentation">Unit Tests As Documentation</a>).</p></li><li><p><strong>2. Test coverage gaps:</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_!VHNd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VHNd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VHNd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png" width="600" height="462.5204582651391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d592169e-9295-4abc-aba7-a1903d643c09_1222x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:1222,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:81764,&quot;alt&quot;:&quot;Diagram highlighting test coverage gaps with a blue crosshatched area, indicating uncovered valid behaviors within the software system that are not tested, posing a risk of undetected regressions.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram highlighting test coverage gaps with a blue crosshatched area, indicating uncovered valid behaviors within the software system that are not tested, posing a risk of undetected regressions." title="Diagram highlighting test coverage gaps with a blue crosshatched area, indicating uncovered valid behaviors within the software system that are not tested, posing a risk of undetected regressions." srcset="https://substackcdn.com/image/fetch/$s_!VHNd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!VHNd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd592169e-9295-4abc-aba7-a1903d643c09_1222x942.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>For now, this is <em>okay</em>. Yet, if something changes later in the uncovered area, regressions may go unnoticed.</p></li><li><p><strong>3. Missing tests lead to undetected bugs:</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_!EBbK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EBbK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EBbK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png" width="600" height="462.5204582651391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:1222,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:68016,&quot;alt&quot;:&quot;Diagram highlighting undetected bugs with a blue crosshatched area, representing invalid behaviors that exist within the system but remain untested, allowing them to go unnoticed and potentially cause issues.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram highlighting undetected bugs with a blue crosshatched area, representing invalid behaviors that exist within the system but remain untested, allowing them to go unnoticed and potentially cause issues." title="Diagram highlighting undetected bugs with a blue crosshatched area, representing invalid behaviors that exist within the system but remain untested, allowing them to go unnoticed and potentially cause issues." srcset="https://substackcdn.com/image/fetch/$s_!EBbK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!EBbK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F451b696f-eca3-4c3a-aa77-24e98a10dd98_1222x942.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 consequences start to escalate. Here, bugs exist, but as there&#8217;s no test for them, they remain invisible.</p></li><li><p><strong>4. Flawed tests hiding bugs:</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_!tzRE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tzRE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tzRE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png" width="600" height="462.5204582651391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:942,&quot;width&quot;:1222,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:70268,&quot;alt&quot;:&quot;Diagram highlighting flawed tests hiding bugs with a blue crosshatched area, indicating that Tests set B should detect bugs but fail to do so, leading to a false sense of security.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram highlighting flawed tests hiding bugs with a blue crosshatched area, indicating that Tests set B should detect bugs but fail to do so, leading to a false sense of security." title="Diagram highlighting flawed tests hiding bugs with a blue crosshatched area, indicating that Tests set B should detect bugs but fail to do so, leading to a false sense of security." srcset="https://substackcdn.com/image/fetch/$s_!tzRE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 424w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 848w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.png 1272w, https://substackcdn.com/image/fetch/$s_!tzRE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00fed25f-3342-4937-8f96-8c18e43ec65a_1222x942.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>Even worse than 3., the tests here should detect bugs but they don&#8217;t. This is arguably worse than missing tests because it gives us a false sense of security: we think our software works as intended when it isn&#8217;t.</p></li></ul><h1>The Limitations of Traditional Tests</h1><p>In this example, we rely on <strong>traditional tests</strong>. Regardless of whether we&#8217;re talking about unit tests, integration tests, or else, traditional tests follow a common structure:</p><ul><li><p>Define a starting state.</p></li><li><p>Apply specific inputs.</p></li><li><p>Assert that output matches expectations.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GQB2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GQB2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 424w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 848w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 1272w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GQB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png" width="600" height="214.21319796954316" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:1182,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:43961,&quot;alt&quot;:&quot;Diagram illustrating the traditional testing process, where inputs are fed into the software under test, producing outputs, which are then validated through assertions.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating the traditional testing process, where inputs are fed into the software under test, producing outputs, which are then validated through assertions." title="Diagram illustrating the traditional testing process, where inputs are fed into the software under test, producing outputs, which are then validated through assertions." srcset="https://substackcdn.com/image/fetch/$s_!GQB2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 424w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 848w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 1272w, https://substackcdn.com/image/fetch/$s_!GQB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F039a1afa-a8ba-489b-9579-675c1b2b4e08_1182x422.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This method has been proven effective for decades, but it has limitations, including:</p><ul><li><p><strong>Tests are manually designed</strong>, so some scenarios may be forgotten. Indeed, since traditional tests are written by humans, they are limited by our own assumptions and understanding of the software. Therefore, we can miss edge cases or unexpected situations.</p></li><li><p><strong>Passing tests don&#8217;t guarantee a bug-free system</strong>. A passing test only confirms that the tested scenario behaves as expected, not that the software works as expected. If the test is flawed, bugs can remain unnoticed.</p></li><li><p><strong>Test maintenance may become a burden over time</strong>. In contexts where high coverage is enforced, the more tests and edge cases we add, the more tightly coupled our tests become with the implementation, leading to increasing maintenance effort.</p></li></ul><p>These limitations highlight a key challenge: <strong>traditional tests are only as good as the cases we manually define</strong>. They check specific scenarios but don&#8217;t ensure broader correctness across all possible inputs. This is where a different approach comes in, one that shifts the focus away from manually defining tests cases and instead focus on the fundamental concept of properties.</p><h1>Property-Based Testing</h1><p>Instead of defining specific inputs and expected outputs, <strong>Property-Based Testing (PBT) focuses on properties</strong>, meaning rules that must always hold, regardless of the input.</p><p>Rather than asking:  &#8220;<em>For this input, do I get this expected output?</em>&#8220; We&#8217;re asking: &#8220;<em>Regardless of the input, does this property always hold?</em>&#8220;</p><p>To give a concrete example, let&#8217;s discuss a common type of PBT tests known as <strong>fuzzing</strong>.</p><p>In general, fuzzing tests focus on the property: &#8220;<em>My software shouldn&#8217;t crash</em>&#8220;. For example, imagine we wrote a function that manipulates a string. Instead of manually testing edge cases, we can use a fuzzing library to generate random inputs (including unexpected formats or extreme values) to ensure our function doesn&#8217;t crash <strong>without requiring us to think of every possible edge case</strong>.</p><p>So, what&#8217;s the difference between fuzzing and property-based testing? To be honest, the boundary isn&#8217;t always crystal clear.</p><p>My working understanding is based on blog posts from Hypothesis, a property-based testing in Python (the post is referenced in the <a href="https://www.thecoder.cafe/i/158864822/sources">Sources</a> section). In a nutshell, we should see fuzzing as a subset of PBT:</p><ul><li><p><strong>Fuzzing</strong>: Primarily used to find crashes or unexpected behaviors by feeding random inputs. It doesn&#8217;t typically require a deep knowledge of the software&#8217;s expected properties.</p></li><li><p><strong>Property-based testing</strong>: Instead of just detecting crashes, PBT defines general properties that the software must always satisfy and generates test cases to verify them. This approach goes beyond failure detection and requires more structured thinking about correctness.</p></li></ul><p>Both fuzzing and PBT start with randomized inputs (often called a fuzzer), but while fuzzing primarily focuses on crashes, PBT goes beyond that to formally validate expected system behavior.</p><p>So, what kind of properties can we define in property-based tests? Here are some examples:</p><ul><li><p><strong>Structural properties</strong>: Ensure an operation preserves certain structural characteristics of the data, such as a length.</p></li><li><p><strong>Idempotency properties</strong>: Ensure that an idempotent function produces the same output when applied multiple times.</p></li><li><p><strong>Commutativity properties</strong>: Ensure that a function is commutative, meaning changing the order of its argument gives the same result.</p></li><li><p><strong>Roundtrip properties</strong>: For serialization or encoding functions, encoding followed by decoding should return the original value.</p></li></ul><p>These are some <em>classic</em> properties we can think of in the context of PBT. Ultimately, PBT is about viewing code as a whole and identifying the fundamental properties it should always preserve. Instead of verifying isolated cases, we validate broader correctness guarantees:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BUGf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BUGf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 424w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 848w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 1272w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BUGf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png" width="601" height="296.9407783417936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:584,&quot;width&quot;:1182,&quot;resizeWidth&quot;:601,&quot;bytes&quot;:59337,&quot;alt&quot;:&quot;Diagram illustrating Property-Based Testing (PBT), where inputs are processed by the software under test, and multiple properties (A, B, and C) are validated alongside the outputs to ensure broader correctness guarantees.&quot;,&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://www.thecoder.cafe/i/158864822?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating Property-Based Testing (PBT), where inputs are processed by the software under test, and multiple properties (A, B, and C) are validated alongside the outputs to ensure broader correctness guarantees." title="Diagram illustrating Property-Based Testing (PBT), where inputs are processed by the software under test, and multiple properties (A, B, and C) are validated alongside the outputs to ensure broader correctness guarantees." srcset="https://substackcdn.com/image/fetch/$s_!BUGf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 424w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 848w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.png 1272w, https://substackcdn.com/image/fetch/$s_!BUGf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a139a42-0048-4dff-b7c7-19b98bb00d63_1182x584.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><h1>Going Beyond </h1><p>So far, the properties discussed in this post share similarities with unit tests, as they focus on local functions.</p><p>However, nothing in the concept of PBT prevents us from taking a step back and applying it at a broader level, such as at the API level or even at the system level, where multiple applications interact.</p><p>Once we extend this perspective, we can consider properties such as:</p><ul><li><p><strong>Temporal properties</strong>: &#8220;<em>99% of API calls must complete in less than 30ms</em>&#8220;.</p></li><li><p><strong>Consistency properties</strong>: &#8220;<em>The database must respect causal consistency</em>&#8221;.</p></li><li><p><strong>Application invariants</strong>: &#8220;<em>Financial transaction must be balanced (debits = credits)</em>&#8221;.</p></li><li><p><strong>Reliability properties</strong>: &#8220;<em>Retrying failed requests must not result in duplicate transactions</em>&#8221;.</p></li></ul><p>PBT is not limited to low-level function testing; it can be applied at multiple levels, from local functions to system level to assess property that must always hold for a group of applications.</p><p>With PBT, we can take any system, inject randomized inputs, and ensure that it behaves correctly&#8212;not by verifying specific test cases, but by enforcing fundamental system properties that must always hold, regardless of the input. This approach moves beyond individual test cases and shifts the focus to system-wide correctness.</p><h1>Final Thoughts</h1><p>PBT changes how we think about testing. Instead of manually defining scenario which may lead to issues like false negatives, PBT takes a step back and focuses on defining the fundamental properties or invariants that must always hold.</p><p>Beyond improving test coverage, PBT also serves as living documentation, as the properties capture essential rules that must govern our software or systems.</p><p>That said, PBT shouldn&#8217;t be seen as a replacement for traditional tests, <strong>it&#8217;s a complementary approach</strong>. The real challenge is recognizing that some parts of a system may be too complex to assess manually. In such cases, relying on randomized inputs and predefined properties can be a more effective and simpler way to catch bugs.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/testing">Testing</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/code-coverage">Code Coverage</a></p></li><li><p><a href="https://read.thecoder.cafe/p/test-behavior-not-implementation">Test Behavior, Not Implementation</a></p></li><li><p><a href="https://read.thecoder.cafe/p/avoiding-logic-in-tests">Avoiding Logic in Tests</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://hypothesis.works/articles/what-is-property-based-testing/">What is Property Based Testing? - Hypothesis Blog</a> // <em>The source I referenced in the post.</em></p></li><li><p><a href="https://increment.com/testing/in-praise-of-property-based-testing/">In praise of property-based testing</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://antithesis.com/blog/reliability_series_part_1/">Software reliability, part 1: What is property-based testing? - Antithesis blog</a></p></li><li><p>Property based testing: let your testing library work for you By Magda Stoz&#775;ek - Devoxx</p><div id="youtube2-0NBy4IcSJcA" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;0NBy4IcSJcA&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/0NBy4IcSJcA?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li><li><p><a href="https://dev.to/zelenya/proper-and-basic-property-based-testing-3311">Proper and Basic Property-Based Testing</a></p></li></ul><p></p><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172;<em> I purposely avoided discussing library-specific features because I wanted this post to encourage you to think about whether properties-based tests make sense for the systems you manage. Let me know what you think about PBT in the comments!</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/property-based-testing/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/property-based-testing/comments"><span>Leave a comment</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://antithesis.com/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:476837,&quot;alt&quot;:&quot;Antithesis logo.&quot;,&quot;title&quot;:&quot;Antithesis logo.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://antithesis.com/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/157821219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Antithesis logo." title="Antithesis logo." srcset="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.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>&#128227; <em>This post is part of a series written in collaboration with Antithesis, an autonomous testing platform. They are not sponsoring this post&#8212;I reached out to them because I was genuinely intrigued by what they were building and ended up falling in love with their solution. We will dive deeper into it in an upcoming post titled Deterministic Simulation Testing. In the meantime, feel free to check out their <a href="https://antithesis.com/">website</a> or their <a href="https://antithesis.com/blog/">great blog</a>.</em></p>]]></content:encoded></item><item><title><![CDATA[Don’t Forget About Your Mental Health]]></title><description><![CDATA[Taking care of our minds isn&#8217;t optional: it&#8217;s a critical part of the process to keep growing over time.]]></description><link>https://read.thecoder.cafe/p/mental-health</link><guid isPermaLink="false">https://read.thecoder.cafe/p/mental-health</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 14 May 2025 14:02:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Kqow!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This week marks <a href="https://www.mentalhealth.org.uk/our-work/public-engagement/mental-health-awareness-week">Mental Health Awareness Week</a> in the UK. Given this important occasion, I wanted to take some time to reflect on mental health, especially in tech, where it isn't always openly discussed.</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_!Kqow!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kqow!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kqow!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1670152,&quot;alt&quot;:&quot;Taking care of our minds isn&#8217;t optional: it&#8217;s a critical part of the process to keep growing over time.&quot;,&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;:&quot;https://www.thecoder.cafe/i/159763704?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Taking care of our minds isn&#8217;t optional: it&#8217;s a critical part of the process to keep growing over time." title="Taking care of our minds isn&#8217;t optional: it&#8217;s a critical part of the process to keep growing over time." srcset="https://substackcdn.com/image/fetch/$s_!Kqow!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Kqow!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cea3af0-2850-4aeb-ba8a-884adc67afc8_1600x800.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>In tech, we often celebrate how much we accomplish: how fast we ship, how many hours we invest, how many open-source projects we juggle after work, etc. Yet, behind all these celebrations, something important often gets overlooked: <strong>our mental health</strong>.</p><p>We rarely talk openly about mental struggles or the exhaustion that may come from working in an industry that rewards constant hustle.</p><p>This post is a reminder (for all of us, including me) that taking care of our minds isn&#8217;t optional: it&#8217;s a critical part of the process to keep growing over time.</p><h1>Manage Your Energy, Not Your Time</h1><p>Time is constant<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. We all get the same 24 hours, day after day. Yet, have you noticed how some days feel wildly more productive than others, even when our schedule looks exactly the same?</p><p>That difference usually isn&#8217;t about having more time. It&#8217;s about having more energy, especially <strong>mental energy</strong>.</p><p>We tend to think burnout happens when we run out of time. But burnout really sets in when we run out of energy and keep pushing anyway, when we ignore what our mind and body are telling us just because our calendar says we&#8217;re &#8220;free&#8220;.</p><p>If our energy is low, our mental health is trying to tell us something, and we should listen.</p><p>Managing our energy instead of our time means respecting our limits and acknowledging that we are not machines. For example, there are days when my energy is low, and through experience, I&#8217;ve learned it&#8217;s usually far better to take care of myself first rather than forcing myself to write another post. Do whatever helps you refill your energy: rest, take a walk, play video games, whatever works for you.</p><p>It&#8217;s not laziness. A career is a marathon, not a sprint. Burnout happens when we push ourselves too hard, too often. Thinking long-term means paying attention to our energy because it&#8217;s the best indicator we have for how sustainable our pace really is.</p><h1>Don&#8217;t Compare Yourself to Others</h1><p>One of the quickest ways to harm our mental health is by constantly comparing ourselves to others. When we keep looking at what everyone else is doing, we start to question if we&#8217;re doing enough.</p><p>A few years ago, I saw a former classmate working as a senior software engineer at Netflix. At the time, it made me feel like I was falling behind. But looking back, I realize I was just being too hard on myself.</p><p>If you've ever felt the same, remind yourself of this: <strong>you're not behind, you're just moving at your own pace.</strong></p><p>Comparing ourselves to others becomes even more harmful on social media. It's easy to scroll through and see people who seem more successful than we are. But the truth is, social media rarely shows the full story. We don't see their struggles, rejections, or failures. We're mostly seeing the bright side.</p><p>If scrolling leaves us feeling anxious or not good enough, it&#8217;s totally okay to take a break. Stepping back helps us refocus on ourselves and reminds us what truly matters: <strong>our own journey at our own pace</strong>.</p><h1>It&#8217;s Okay to Struggle Sometimes</h1><p>Sometimes, we can go through tough periods, not just bad days, but weeks or even months. We might feel anxious, unmotivated, disconnected. It can be hard to focus, hard to care, hard to show up. <strong>That doesn&#8217;t mean we&#8217;re weak; it means we&#8217;re human</strong>.</p><p>We don&#8217;t have to be perfect all the time. We don&#8217;t have to hide our struggles or pretend everything is fine. Life has ups and downs, and it&#8217;s okay to move through these difficult periods without guilt, regardless of the reasons.</p><p>When we're struggling, one of the best things we can do is talk to someone: a friend, a partner, a mental health professional, whoever. There's always someone who can help us carry the load. Just sharing what we're feeling out loud can lighten the emotional weight a little.</p><p>And if we're in an company where we can't openly talk about mental health, where we can't admit we're struggling without fear or judgment then that's a company issue, not ours. If our working environment doesn't support our well-being, it&#8217;s probably not the right place for us.</p><p>Everyone goes through hard times. What matters most is <strong>giving ourselves permission to feel, heal, and reach out when we need support</strong>.</p><h1>Final Thoughts</h1><p>Mental health isn&#8217;t something separate from our work; it&#8217;s at the heart of it. Managing our energy, avoiding comparison, and accepting that it's normal to struggle are essential for a healthy, sustainable career.</p><p>Remember: we are humans first, engineers second. Taking care of ourselves isn&#8217;t just good for us; <strong>it's good for everything and everyone around us</strong>.</p><p>Let&#8217;s keep building thoughtfully, sustainably, and kindly, together.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/cognitive-biases">Cognitive Biases</a></p></li><li><p><a href="https://read.thecoder.cafe/p/mistake-journal">Keeping a Mistake Journal</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://leaddev.com/management/how-manage-mental-health-tech-industry">How to manage mental health in the tech industry</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>I would genuinely love to hear your thoughts on this post. How do you take care of yourself when things get hard?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/mental-health/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/mental-health/comments"><span>Leave a comment</span></a></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>Well, <a href="https://www.amnh.org/exhibitions/einstein/time/a-matter-of-time">kind of</a>.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Working on Complex Systems]]></title><description><![CDATA[This is why recognizing whether a system is complicated or complex is so important: it shapes how we should approach problem-solving.]]></description><link>https://read.thecoder.cafe/p/complex-systems</link><guid isPermaLink="false">https://read.thecoder.cafe/p/complex-systems</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 07 May 2025 08:00:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3DSY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today, let&#8217;s discuss a fascinating topic: complex systems.</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_!3DSY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3DSY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3DSY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1291210,&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;:&quot;https://www.thecoder.cafe/i/157821219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.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_!3DSY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!3DSY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3b2bd0-b19b-4a8b-9b75-167b3b00412e_1600x800.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><h1><strong>Introduction</strong></h1><p>Throughout my career, I&#8217;ve worked in many complicated environments. For instance, I worked on optimizing driver-passenger matching in ride-hailing at a Uber's competitor. This context, like others, was technically challenging. Yet, nothing comes close in terms of complexity with my current experience at Google and two years there have refined my perception of complexity.</p><p>In this post, we will break down the very concept of complexity. Next, we will take a step back to understand what makes certain environments rather complex than complicated and then explore patterns for navigating complex systems effectively.</p><h1>Complicated vs. Complex</h1><p>Understanding the distinction between complicated and complex problems is crucial because each requires a fundamentally different approach:</p><ul><li><p><strong>Complicated problems are intricate but predictable</strong>. They followed structured, repeatable solutions. For example, filing taxes is complicated, but it's a structured and conventional problem since the process remains mostly the same year after year.</p></li><li><p><strong>Complex problems are intricate but unique</strong>. They require adaptive and often novel solutions. For example, climate change mitigation is a complex problem because it requires new and adaptive solutions and existing methods alone can&#8217;t really address its evolving challenges.</p></li></ul><p>Back to software engineering, at the Uber competitor, <strong>one of the challenges was to efficiently find the nearest driver for a passenger</strong>. This was far from trivial, but it wasn't <em>complex</em> per se. Indeed, many solutions exist, such as applying geo-hashing (<a href="https://medium.com/@abhirup.acharya009/how-companies-like-uber-google-and-airbnb-disrupt-industries-with-location-intelligence-f4fb6ddc3808">example</a>), and implementing one of these solutions was the right approach.</p><p>At Google, I work as a Site Reliability Engineer (SRE), focusing on the systems powering Google&#8217;s ML infrastructure. Here, <strong>I consider the challenges genuinely complex</strong>, as new paradigms and scheduling approaches are required, especially at Google&#8217;s scale.</p><p>Recognizing whether a system is complicated or complex is really important. Indeed, we mentioned that complicated systems are by definition repeatable, while complex systems require unique and customized approaches. Therefore, if we try to apply a common solution to a complex problem, <strong>it may not lead to effective results</strong>.</p><h1><strong>Characteristics of Complex Systems</strong></h1><p>In this section, we will discuss five common characteristics that help identify complex systems. Not all complex systems share every characteristic, but they tend to exhibit at least some of the following.</p><h2>Emergent Behavior</h2><p>Emergent behavior arises when a system's overall behavior <strong>cannot be predicted solely by analyzing its individual components in isolation</strong>.</p><p>For example, Gemini producing <a href="https://x.com/lox/status/1797761630769688701">unexpected results</a> was an emergent behavior. While I can't disclose the root cause, this behavior was nearly impossible to foresee by analyzing all the different components separately.</p><p>This is one possible characteristic of complex systems: they behave in ways that can hardly be predicted just by looking at their parts, making them harder to debug and manage.</p><h2>Delayed Consequences</h2><p>Another possible characteristic of complex systems is delayed consequences, where actions <strong>don't always have immediate effects</strong>, and instead, consequences may only become apparent much later.</p><p>For example, deploying a new version of a system might introduce a subtle issue that only appears days or even weeks later. This delay complicates debugging since identifying the root cause becomes much harder compared to immediate impacts.</p><p>In complex systems, relying solely on immediate feedback can create a false sense of stability, leading to major surprises when an issue finally emerges. Keeping in mind that consequences may take time to surface is essential when working in such environments.</p><h2><strong>Local vs. Global Optimization</strong></h2><p>In complex systems, <strong>optimizing one part doesn&#8217;t necessarily improve the whole system</strong>, and in some cases, it can even make things worse.</p><p>Unlike in non-complex systems, where improving one part generally leads to positive gains, complex systems are much more difficult to reason about. The components interact in non-obvious ways, and local optimizations can create ripple effects that are difficult to predict, sometimes leading to negative outcomes at the system level.</p><p>This highlights a key trait of complex systems: the whole is more than the sum of its parts. As a result, local gains don&#8217;t always translate into global improvements and in some cases, they can even degrade the overall system.</p><h2><strong>Hysteresis</strong></h2><p>Hysteresis describes how a system's <strong>past state continues to influence its behavior</strong>, even after the original cause is removed.</p><p>A real-world example to illustrate hysteresis is traffic congestion: even after a road accident is cleared, delays persist because vehicles remain clustered. Similarly, in distributed systems, failures can cause cascading slowdowns, even after the root issue is fixed. Indeed, dependent systems may take time to recover for various reasons, such as caches, retries, or queued requests.</p><p>In complex systems, simply fixing the root cause is not always enough. Therefore, it's crucial to assess whether a system is prone to hysteresis and, if so, anticipate its effects.</p><h2><strong>Nonlinearity</strong></h2><p>In complex systems, <strong>small changes can produce disproportionately large or unpredictable effects</strong>.</p><p>For example, in queueing theory, system load increases latency predictably. However, as a queue approaches saturation, even a small increase in requests can cause response times to spike exponentially.</p><p>Complex systems often reach tipping points, where behaviors shift suddenly, making past trends unreliable for prediction. This nonlinearity means that traditional linear assumptions where inputs map predictably to outputs isn't always effective for designing, testing, and reasoning about complex systems.</p><h2>Summary</h2><p>To summarize this section, complex systems:</p><ul><li><p>Are difficult to understand just by looking at its parts separately.</p></li><li><p>Don&#8217;t always show their effects right away, consequences can be delayed.</p></li><li><p>Don&#8217;t always improve as a whole when one part is optimized and changes can sometimes make things worse.</p></li><li><p>Can keep being influenced by past states, even after the original cause is gone.</p></li><li><p>Can react to small changes with big or unexpected effects.</p></li></ul><p>Note that scale alone doesn&#8217;t make a system complex: even small systems can exhibit complex behaviors like emergence or nonlinearity.</p><h1><strong>Patterns for Navigating Complex Systems</strong></h1><p>Given these characteristics, how can we operate effectively in complex environments? Below are some strategies that I personally found effective.</p><h2><strong>Reversibility</strong></h2><p>When dealing with complex systems, we should favor <strong>reversible decisions</strong> whenever possible, meaning changes that can be undone if they don't work out.</p><p>Amazon's one-way vs. two-way doors framework captures this idea quite well:</p><ul><li><p><strong>One-way doors</strong> represent irreversible decisions that require careful deliberation.</p></li><li><p><strong>Two-way doors</strong> represent reversible decisions, allowing us to move fast and iterate with lower risk.</p></li></ul><p>In many contexts, especially in complex systems, favoring two-way doors leads to better outcomes because we can experiment, learn, and refine rather than overengineering upfront.</p><p>That being said, not all decisions should be reversible. For example, some choices like security policies or compliance-related changes require upfront commitment. The key is knowing <strong>when to optimize for speed and iteration versus when to be deliberate and careful</strong>.</p><h2><strong>Think Beyond Immediate Metrics</strong></h2><p>Because complex systems don't always respond predictably to local optimizations, defining the <strong>right metrics for success</strong> is probably just as important as the changes we make. Indeed, focusing too much on isolated, local metrics can create a false sense of success while masking unintended negative consequences elsewhere in the system.</p><p>To avoid this, before making a change, we should define both <strong>local and global metrics</strong> to get a holistic view of system health. This ensures that we measure impact beyond the immediate area of focus and consider the system as a whole.</p><p>Well-chosen metrics shouldn't just confirm the success of a local change; instead, they should help us make better decisions and ensure meaningful improvements at the system level, not just isolated areas.</p><h2><strong>Innovation</strong></h2><p>As discussed, complex systems often demand unique solutions. Since conventional strategies may not always apply, we must be willing to <strong>think out of the box and embrace innovation</strong>.</p><p>I recall one of my first meetings at Google. Someone presented a problem that seemed absurd in terms of complexity, especially given the scale. My immediate reaction in my head was: "<em>This is impossible</em>". But then, a teammate said: "<em>But we're Google, we should be able to manage it!</em>".</p><p>That remark stuck with me. While not every company obviously has Google's resources, I think <strong>the mindset is what truly matters</strong>. When facing a complex problem, we should assume it's solvable, then break it down, experiment, and iterate until we find a path forward.</p><p>One may find this section clich&#233;, but again, complex problems demand unconventional thinking. In many cases, being open to innovative solutions when facing a complex problem isn&#8217;t just helpful, it&#8217;s necessary.</p><h2><strong>Controlled Rollout</strong></h2><p>When deploying changes in complex systems, we should rely on proven best practices to minimize risk. These include:</p><ul><li><p><strong>Feature flags</strong>: Enable or disable functionality dynamically without deploying new code, allowing for safe experimentation and quicker rollbacks.</p></li><li><p><strong>Canary release</strong>: A limited rollout to a small, controlled subset of production, well suited for environments with only a few production instances.</p></li><li><p><strong>Progressive rollouts</strong>: Gradually increasing the scope of a rollout, best suited for large-scale production setups with multiple clusters or regions.</p></li><li><p><strong>Shadow testing</strong>: Running a change in parallel with production traffic without impacting real users. This helps validate the correctness of a change before enabling it.</p></li></ul><p>By leveraging these techniques, we reduce the <strong>blast radius of failures</strong>, improving the confidence in our changes and enabling faster iterations.</p><h2><strong>Observability</strong></h2><p>Observability is one of the <strong>main pillars of complex systems</strong>. My working definition of observability (mainly inspired by <a href="https://www.oreilly.com/library/view/observability-engineering/9781492076438/">Observability Engineering</a>) is the following:</p><blockquote><p>You can understand any state of your system (no matter how novel or bizarre) by slicing and dicing high-cardinality and high-dimensionality telemetry data without needing to ship new code.</p></blockquote><p>Without observability:</p><ul><li><p>Systems become more fragile as unknown issues remain hidden until they cause real impacts.</p></li><li><p>Debugging unexpected failures becomes significantly harder.</p></li><li><p>Innovation is slowed down due to a lack of efficient feedback loops.</p></li></ul><p>In complex environments, where unknowns are inevitable, observability is essential. It enable teams to navigate uncertainty, experiment more safely and getting short feedback loops to continuously improve systems.</p><p>Without proper observability, <strong>changes remain opinions rather than informed decisions</strong>.</p><h2><strong>Simulation</strong></h2><p>Predicting the behavior of complex systems is rarely simple, and, sometimes, <strong>nearly impossible</strong>.</p><p>I recall a case where we spent considerable time designing a change, carefully backing every assumption with data. Yet, due to unaccounted factors such as <a href="https://www.thecoder.cafe/p/lurking-variables">lurking variables</a>, the change was ultimately ineffective<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>.</p><p>Sometimes, instead of relying solely on predictions, a more effective approach can be to <strong>simulate</strong> a change before rolling it out. There are multiple ways to leverage simulation testing, including:</p><ul><li><p><strong>Replaying past events</strong>: If we design a system to record all its input, we can replay past events against our new version and analyze its impact. This allows us to validate changes in a controlled manner, reducing uncertainty and improving decision-making in complex systems.</p></li><li><p><strong>Deterministic simulation testing</strong>: Instead of relying on real-world data, we can create controlled, repeatable simulations that model system behavior under specific conditions. This allows us to test how a system reacts under various conditions in a fully deterministic way.</p></li></ul><p>Note that the ideas presented in this section also rely heavily on observability.</p><h2><strong>Machine Learning</strong></h2><p>In complex environments, rules-based approaches often reach their limit because of the complexity of anticipating all scenarios. In these contexts, <strong>ML can become particularly effective</strong>.</p><p>Indeed, unlike static heuristics, ML models can continuously adapt based on feedback loops and learn from real-world data rather than relying on rigid, predefined logic.</p><p>This allows systems to:</p><ul><li><p>Detect emerging patterns that weren't explicitly programmed.</p></li><li><p>Adapt dynamically to changes without requiring constant human intervention.</p></li><li><p>Make probabilistic decisions rather than relying on strict if-else conditions.</p></li></ul><h2><strong>Strong Team Collaboration</strong></h2><p>Last but not least, I believe that in complex environments, more than anywhere else, <strong>strong team collaboration</strong> is an absolute necessity. For instance, clearly conveying why a change is complex, discussing available options, and debating trade-offs with teammates are all critical skills.</p><p>In complex systems, there's often no <em>single</em> right answer. Therefore, a team that collaborates effectively and navigates ambiguity together can make a huge difference, ultimately leading to stronger decision-making.</p><h1>Final Thoughts</h1><p>Again, complicated problems can be solved with repeatable solutions, whereas <strong>complex systems require adaptability and a different way of thinking</strong>. This is why recognizing whether a system is complicated or complex is so important: it shapes how we should approach problem-solving.</p><p>However, in many environments, systems are neither purely complicated nor purely complex. Some parts can follow structured, predictable solutions, while others require adaptability and novel approaches. The key is learning to recognize <strong>when adaptability is needed and when structured solutions are enough</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/latency-and-user-experience">Latency and User Experience</a></p></li><li><p><a href="https://read.thecoder.cafe/p/isolation-level">Isolation Level</a></p></li><li><p><a href="https://read.thecoder.cafe/p/probabilistic-increment">Probabilistic Increment</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://sloanreview.mit.edu/article/the-critical-difference-between-complex-and-complicated/">The Critical Difference Between Complex and Complicated</a></p></li><li><p>Jeff Bezos explains one-way door decisions and two-way door decisions:</p><div id="youtube2-rxsdOQa_QkM" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;rxsdOQa_QkM&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/rxsdOQa_QkM?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://news.ycombinator.com/item?id=43971177">Hacker News discussion</a></p></li><li><p><a href="https://fellow.app/blog/productivity/simple-complicated-complex-and-chaotic-systems/">Simple, Complicated, Complex, and Chaotic Systems</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>I hope this post has helped you recognize the characteristics of complex environments and provided you with practical patterns to navigate them effectively.</em> <em>Did any of these patterns resonate with you? What other strategies have you used in complex environments? Let me know in the comments.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/complex-systems/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/complex-systems/comments"><span>Leave a comment</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://antithesis.com/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:476837,&quot;alt&quot;:&quot;Antithesis logo.&quot;,&quot;title&quot;:&quot;Antithesis logo.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://antithesis.com/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/157821219?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Antithesis logo." title="Antithesis logo." srcset="https://substackcdn.com/image/fetch/$s_!4Kzx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!4Kzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bc7149b-5dea-4237-8ead-ed5c924d5ede_1200x630.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>&#128227; <em>This post is part of a series written in collaboration with Antithesis, an autonomous testing platform. They are not sponsoring this post&#8212;I reached out to them because I was genuinely intrigued by what they were building and ended up falling in love with their solution. We will dive deeper into their solutions in a future post. In the meantime, feel free to check out their <a href="https://antithesis.com/">website</a> or their <a href="https://antithesis.com/blog/">great blog</a>.</em></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>Yet, that wasn&#8217;t necessarily a bad decision per se. See why <a href="https://pbs.twimg.com/media/GkFWVk-XgAEuQaU?format=jpg&amp;name=4096x4096">here</a>.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Ford-Fulkerson Algorithm]]></title><description><![CDATA[The maximum flow problem involves finding the highest possible flow that can travel from a source to a sink in a flow network without exceeding edge capacities.]]></description><link>https://read.thecoder.cafe/p/ford-fulkerson</link><guid isPermaLink="false">https://read.thecoder.cafe/p/ford-fulkerson</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 30 Apr 2025 08:00:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-c5e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! This post is a follow-up to <a href="https://read.thecoder.cafe/p/1000">1,000 Subscribers, 1 Coding Challenge!</a>, where we announced a coding challenge. Today, we will explore one possible solution: the Ford-Fulkerson algorithm. The solution will be given at the end.</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_!-c5e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-c5e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-c5e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1287849,&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;:&quot;https://www.thecoder.cafe/i/156795208?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.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_!-c5e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!-c5e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82db5d2f-afe0-4dda-ae32-883a59b8996e_1600x800.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><h1>Understanding the Max Flow Problem</h1><p>The <strong>maximum flow problem</strong> involves finding the highest possible flow that can travel from a source to a sink in a flow network without exceeding edge capacities.</p><p>Key terminology:</p><ul><li><p><strong>Flow</strong>: The amount of &#8220;stuff&#8220; (e.g., water, data, cars) passing through an edge without exceeding the edge&#8217;s capacity.</p></li><li><p><strong>Capacity</strong>: The maximum amount of flow an edge can handle.</p></li><li><p><strong>Vertex</strong>: A node in the network where the flow can enter or exit.</p></li><li><p><strong>Edge</strong>: A directed connection between two vertices that carries flow and has a capacity limit.</p></li><li><p><strong>Source</strong>: The starting point of the flow, where all the "stuff" originates.</p></li><li><p><strong>Sink</strong>: The endpoint where all the "stuff" is collected.</p></li></ul><p>Some real-world applications:</p><ul><li><p><strong>Water pipeline system</strong>: A network of pipes where water flows from a reservoir to homes with pipes having different capacities. What&#8217;s the maximum water flow that can be transported?</p></li><li><p><strong>Data networks</strong>: Internet packets traveling through routers, where each connection has a bandwidth limit. What&#8217;s the maximum throughput between two routers?</p></li><li><p><strong>Traffic flow</strong>: Routes connecting cities, where cars move from an entry point to an exit, and each route has a capacity limit. What&#8217;s the maximum number of cars that can travel between two cities?</p></li></ul><h1>Augmenting Path</h1><p>Before diving into the algorithm, we first need to define the concept of <strong>augmenting path</strong>:</p><ul><li><p><strong>A path</strong> from the source to the sink is a sequence of connected vertices that begins at the source and ends at the sink.</p></li><li><p><strong>An augmenting path</strong> is a path from the source to the sink in which every edge has available capacity for additional flow.</p></li></ul><p>For example:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NxdN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NxdN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 424w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 848w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 1272w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NxdN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png" width="500" height="404.98812351543944" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a951ef54-09c2-49e2-85cb-6693715909b0_842x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:842,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:63442,&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_!NxdN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 424w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 848w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.png 1272w, https://substackcdn.com/image/fetch/$s_!NxdN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa951ef54-09c2-49e2-85cb-6693715909b0_842x682.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><code>A &#8594; B &#8594; D</code> is both a valid path and an augmenting path because all edges along the path have remaining capacity.</p></li><li><p><code>A &#8594; C &#8594; D</code> is a valid path but <strong>not</strong> an augmenting path because <code>C &#8594; D</code> has no remaining capacity, meaning no additional flow can pass through this path.</p></li></ul><h1>Ford-Fulkerson Algorithm</h1><p>Consider the following graph where we need to find the maximum flow from <code>A</code> to <code>F</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!puTF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!puTF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!puTF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!puTF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!puTF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!puTF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:86058,&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_!puTF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!puTF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!puTF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!puTF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7841f05f-cbae-4413-8a76-0158295e9ed2_1242x682.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>Intuition Behind the Algorithm</h2><p>One possible intuition for solving this problem could be:</p><ol><li><p><strong>Find an augmenting path</strong> from <code>A</code> to <code>F</code> (i.e., a valid path where all the edges have remaining capacity).</p></li><li><p><strong>Calculate the bottleneck capacity</strong>&#8212;the maximum flow that this path can carry, limited by the edge with the smallest available capacity.</p></li><li><p><strong>Update the capacity</strong> of the edges along this path by subtracting the bottleneck flow.</p></li><li><p><strong>Repeat steps 1-3</strong> until no more augmenting paths exist.</p></li></ol><p>Let&#8217;s follow this intuition and apply it step by step.</p><h2>Finding Augmenting Paths</h2><p>Note that the Ford-Fulkerson algorithm doesn&#8217;t impose a specific way to find augmenting paths. For this example, we use Depth-First Search (DFS).</p><p>Suppose the first augmenting path found is <code>A &#8594; B &#8594; E &#8594; F</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OEjK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OEjK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84809,&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_!OEjK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.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 bottleneck for this path is 2 as any additional flow would exceed <code>A &#8594; B</code> capacity.</p><p>We push a flow of 2 through this path. Then, to reflect on the flow that has been sent, we update the remaining capacity of all edges in this path by removing 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BzWV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BzWV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 424w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 848w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 1272w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BzWV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png" width="1242" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79215,&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_!BzWV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 424w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 848w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.png 1272w, https://substackcdn.com/image/fetch/$s_!BzWV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a5aa767-0689-43a2-897e-fcdbb938bc4f_1242x684.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>Capacity updates:</p><ul><li><p><code>A &#8594; B</code>: The capacity went from 2 to 0 (-2), so we removed the edge. We could also keep a capacity of 0; it doesn&#8217;t really matter.</p></li><li><p><code>B &#8594; E</code>: The capacity went from 3 to 1 (-2).</p></li><li><p><code>E &#8594; F</code>: The capacity went from 4 to 2 (-2).</p></li></ul><p>Now, let&#8217;s find another augmenting path using the same technique, DFS. Suppose the next path found is <code>A &#8594; C &#8594; E &#8594; F</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EUBM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EUBM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EUBM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71036,&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_!EUBM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!EUBM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb01f830b-f4b3-4e4f-a69f-d2180bea495b_1242x682.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 bottleneck for this path is 2 (bounded by <code>E &#8594; F</code>). So again, we update the remaining capacity of all the edges in this path:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UmOy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UmOy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UmOy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0da810f1-bf19-43e6-9669-77292647133e_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78062,&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_!UmOy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!UmOy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da810f1-bf19-43e6-9669-77292647133e_1242x682.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>Capacity updates:</p><ul><li><p><code>A &#8594; C</code>: The capacity went from 8 to 6 (-2).</p></li><li><p><code>C &#8594; E</code>: The capacity went from 6 to 4 (-2).</p></li><li><p><code>E &#8594; F</code>: The capacity went from 2 to 0 (-2), so we removed the edge.</p></li></ul><h2>A Correct Solution?</h2><p>At this stage, <strong>there is no more augmenting path left from </strong><code>A</code><strong> to </strong><code>F</code>. Let&#8217;s summarize:</p><ul><li><p>We found a first augmenting path <code>A &#8594; B &#8594; E &#8594; F</code> with a max flow of 2.</p></li><li><p>We found a second augmenting path <code>A &#8594; C &#8594; E &#8594; F</code> with a max flow of 2.</p></li></ul><p>Therefore, if our intuition was correct, the maximum flow between <code>A</code> and <code>F</code> should be 4. <strong>However, this isn&#8217;t the right solution</strong>. Instead, we should have considered these two augmenting paths:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VYmZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VYmZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VYmZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74972,&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_!VYmZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!VYmZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7150f14b-d4af-44d9-ab5a-5986b6420a22_1242x682.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><code>A &#8594; B &#8594; D &#8594; F</code>: 2</p></li><li><p><code>A &#8594; C &#8594; E &#8594; F</code>: 4</p></li></ul><p>If we had taken these two augmenting paths, we would have found the correct solution: 6.</p><h2>What Went Wrong?</h2><p>Should we refine our way of selecting augmenting paths? <strong>Not with Ford-Fulkerson</strong>. As we said, augmented paths in Ford-Fulkerson can be selected arbitrarily, so let&#8217;s keep using DFS.</p><p>Instead, we&#8217;re missing a crucial step: whenever we select an augmented path and send flow through an edge, <strong>a backward edge with the same flow value must be created</strong>.</p><p>The purpose of this step is to allow <strong>flow redistribution</strong>, meaning if an unlucky selection of augmenting paths leads to a suboptimal result, the algorithm can undo and redistribute the flow when needed. Let&#8217;s see how that works.</p><h2>Incorporating Backward Edges</h2><p>We restart the algorithm to find the maximum flow from <code>A</code> to <code>F</code>, this time properly incorporating backward edges.</p><p>The first augmented path found is still <code>A &#8594; B &#8594; D &#8594; F</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OEjK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OEjK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84809,&quot;alt&quot;:&quot;&quot;,&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!OEjK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!OEjK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f9b12a4-2fa3-4be8-966d-80f715fc07de_1242x682.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>Now, instead of just adapting the capacity, we will create a backward edge based on the flow sent. In this case, the flow sent is 2 so we will create three backward edges with a capacity of 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q-sZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 424w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 848w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 1272w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png" width="1242" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87530,&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_!Q-sZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 424w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 848w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.png 1272w, https://substackcdn.com/image/fetch/$s_!Q-sZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbcf647c-d2d8-4ae6-9332-0d20ba9687d2_1242x684.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 edges represent the backward edges created during Ford-Fulkerson.</figcaption></figure></div><p>Capacity updates:</p><ul><li><p><code>A &#8594; B</code>: The capacity went from 2 to 0 (-2), so we removed the edge.</p></li><li><p><code>B &#8594; E</code>: The capacity went from 3 to 1 (-2).</p></li><li><p><code>E &#8594; F</code>: The capacity went from 4 to 2 (-2).</p></li></ul><p>Meanwhile, we added three backward edges with a capacity based on the flow sent (2):</p><ul><li><p><code>B &#8594; A</code>: 2</p></li><li><p><code>E &#8594; B</code>: 2</p></li><li><p><code>F &#8594; E</code>: 2</p></li></ul><p>Why we&#8217;re doing this may not be clear yet, but let&#8217;s keep going&#8212;you will soon see why it makes sense.</p><p>Now, let&#8217;s consider the second path, <code>A &#8594; C &#8594; E &#8594; F</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JLmT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JLmT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JLmT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png" width="1242" height="682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:682,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87878,&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_!JLmT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 424w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 848w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.png 1272w, https://substackcdn.com/image/fetch/$s_!JLmT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6306f735-20b8-4a92-b25c-9c6a382b48bf_1242x682.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 max flow for this path is 2. We follow the same steps by updating the capacity for all the edges in the path (-2) and all the backward edges (+2).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4BiX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4BiX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 424w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 848w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 1272w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4BiX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png" width="1242" height="822" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:822,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96616,&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_!4BiX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 424w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 848w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.png 1272w, https://substackcdn.com/image/fetch/$s_!4BiX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d8e59fe-7c47-44a0-9fb1-86970e5e5d6d_1242x822.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>We update all the capacity and create 2 new backward edges:</p><ul><li><p><code>C &#8594; A</code>: 2</p></li><li><p><code>E &#8594; C</code>: 2</p></li></ul><p>The <code>F &#8594; E</code> backward edge was already present from the first augmented path, so we increment its capacity: 2 + 2 = 4.</p><p>At this stage, we are at the same point as before, where we have found two augmenting paths with a flow of 2. However, there&#8217;s now a major difference: thanks to backward edges<strong>, there is one more remaining augmenting path</strong>: <code>A &#8594; C &#8594; E &#8594; B &#8594; D &#8594; F</code>. Note that this new path uses a backward edge that we created: <code>E &#8594; B</code>. Let&#8217;s consider this path:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bOT0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bOT0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 424w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 848w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 1272w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bOT0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png" width="1242" height="822" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:822,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95697,&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_!bOT0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 424w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 848w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.png 1272w, https://substackcdn.com/image/fetch/$s_!bOT0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c3fdc55-f746-4ca4-a4ec-958287d6ab82_1242x822.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 path&#8217;s bottleneck is 2 (bounded by <code>E &#8594; B</code>). Let&#8217;s adapt the capacities:</p><ul><li><p>-2 for all the edges in the path (including <code>E &#8594; F</code>).</p></li><li><p>+2 for all the backward edges.</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_!6qMh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6qMh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 424w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 848w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 1272w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6qMh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png" width="1244" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1244,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:106304,&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_!6qMh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 424w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 848w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.png 1272w, https://substackcdn.com/image/fetch/$s_!6qMh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3282f645-ca89-4053-8446-ac00b942c31a_1244x962.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>Note that as we decreased by 2 the capacity of <code>E &#8594; B</code>, it reached a capacity of 0, so we removed the edge.</p><p>Is there a remaining edge? No, that&#8217;s <strong>the termination condition of Ford-Fulkerson</strong>. Here are all the augmenting paths that we found and their corresponding flows:</p><ul><li><p><code>A &#8594; B &#8594; E &#8594; F</code>: 2</p></li><li><p><code>A &#8594; C &#8594; E &#8594; F</code>: 2</p></li><li><p><code>A &#8594; C &#8594; E &#8594; B &#8594; D &#8594; F</code>: 2</p></li></ul><p>If we sum all the flows, we get 6, which is the correct maximum flow.</p><p>This is how the Ford-Fulkerson algorithm guarantees that, <strong>even with arbitrary augmenting path selection</strong>, it will always find the correct <strong>maximum flow thanks to backward edges</strong> allowing flow redistribution.</p><h1>Code</h1><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nBIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nBIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 424w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 848w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 1272w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nBIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png" width="449" height="136.72252252252252" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:169,&quot;width&quot;:555,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:58422,&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://www.thecoder.cafe/i/156795208?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.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_!nBIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 424w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 848w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 1272w, https://substackcdn.com/image/fetch/$s_!nBIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5c4cb-d279-4743-9a9b-a6c22306a9d0_555x169.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>Pseudo-code:</p><pre><code>def ford_fulkerson(graph, source, sink):
    res = 0
    while True:
        path = get_next_augmenting_path(graph, source, sink)
        if path is None:
            break
        
        bottleneck = get_bottleneck(path)
        for edge in path.get_edges():
            edge.capacity -= bottleneck

            backward_edge = get_backward_edge(graph, edge)
            backward_edge.capacity += bottleneck
        
        res += bottleneck
    
    return res</code></pre></li><li><p>You can also look at my <a href="https://github.com/teivah/thecodercafe/blob/main/res/contest/skylink/solution.go">Go solution</a>.</p></li></ul><h1>Complexity</h1><p>The time complexity of Ford-Fulkerson algorithm is <code>O(EU)</code>, where:</p><ul><li><p><code>E</code> is the number of edges in the graph.</p></li><li><p><code>U</code> is the maximum possible flow (i.e., the solution).</p></li></ul><p>It&#8217;s quite interesting to note that the algorithm&#8217;s complexity depends on the final solution itself. This is something fairly unusual because, ideally, we don&#8217;t want to solve the problem first just to determine its time complexity. </p><p>We can, however, approximate <code>U</code>, as it depends on the edge capacities. If we increase the edge capacities, then in most cases, the maximum flow <code>U</code> will also increase. Yet, this isn&#8217;t the only factor and we should also consider:</p><ul><li><p><strong>Bottlenecks</strong>: If a single edge has low capacity, it limits <code>U</code> no matter how large other edges are.</p></li><li><p><strong>Graph structure</strong>: Even if edges have large capacities, if there are few paths from source to sink, <code>U</code> may not be very large.</p></li><li><p><strong>Parallel paths</strong>: If there are many disjoint paths from the source to the sink, <code>U</code> will be higher even if individual edges have small capacities.</p></li></ul><p>Yet, one important question: What if we need an algorithm whose <strong>complexity doesn&#8217;t depend on </strong><code>U</code> since <code>U</code> isn&#8217;t straightforward to estimate?</p><p>Amazingly, the solution is to <em>simply</em> change how we determine augmenting paths. In our example, we used DFS, which led to an <code>O(EU)</code> complexity. However, if we switch <strong>Breadth-First Search (BFS)</strong> instead, the time complexity becomes <code>O(VE&#178;)</code>, where:</p><ul><li><p><code>V</code> is the number of vertices (nodes) in the graph.</p></li><li><p><code>E</code> is the number of edges in the graph.</p></li></ul><p>Said differently, with BFS, the time complexity depends only on the graph structure (vertices and edges). This removes the difficulty of predicting an accurate value of <code>U</code>.</p><p>This specialization of Ford-Fulkerson using BFS is known as the <strong>Edmonds-Karp algorithm</strong>.</p><h1><strong>Summary</strong></h1><ul><li><p>Ford-Fulkerson repeatedly finds augmenting paths and pushes flow through them.</p></li><li><p>Backward edges allow redistribution of flow, which corrects any suboptimal choices made by selecting arbitrary augmenting paths.</p></li><li><p>The algorithm terminates when no more augmenting paths exist.</p></li><li><p>Using DFS, the time complexity is <code>O(EU)</code>, which depends on the final solution, but switching to BFS (Edmonds-Karp variation) results in a time complexity of <code>O(VE&#178;)</code>, making it dependent only on the graph structure.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">Missing direction in your tech career? At The Coder Cafe, we serve timeless concepts with your coffee to help you master the fundamentals. Written by a Google SWE and trusted by thousands of readers, we support your growth as an engineer, one coffee at a time.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/coding">Coding</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/topological-sort">Topological Sort</a></p></li><li><p><a href="https://read.thecoder.cafe/p/arrays-vs-linked-lists">Arrays vs. Linked Lists</a></p></li><li><p><a href="https://read.thecoder.cafe/p/binary-heaps">Binary Heaps</a></p></li></ul><h2>Sources</h2><ul><li><p>Maximum flow problem - Ford Fulkerson algorithm <strong>// </strong><em>The graph example I used in this post is taken from this video. If you struggle with my explanation, this video may help you.</em></p><div id="youtube2-VbeTl1gG4l4" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;VbeTl1gG4l4&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/VbeTl1gG4l4?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.youtube.com/watch?v=M6cm8UeeziI">Dinic&#8217;s Algorithm - YouTube</a> <em>// An explanation of Dinic&#8217;s network flow algorithm, another way to solve max flow problems.</em></p></li></ul><div><hr></div><h1><strong>&#127881; </strong>Solution</h1><p><strong>The correct solution to the </strong><em><strong><a href="https://read.thecoder.cafe/p/1000">1,000 Subscribers, 1 Coding Challenge!</a></strong></em><strong> was 56.</strong> Congratulations to everyone who solved it! The winners (Simon, Mar&#237;a, Alexandr, Brian, Vadim), chosen randomly from all correct submissions, will be notified by email.</p><p>Thanks to all who participated! I hope you enjoyed the challenge. Let me know if you'd like to see more of these in the future!</p><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p>]]></content:encoded></item></channel></rss>