<?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[Engineering Knowledge]]></title><description><![CDATA[How to prosper in times of AI, ever-increasing information overload, and life-long learning as a knowledge worker (coder or not).]]></description><link>https://engineeringknowledge.blog</link><image><url>https://substackcdn.com/image/fetch/$s_!IfBY!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be39815-47d8-444e-a115-36c3bc9ac331_256x256.png</url><title>Engineering Knowledge</title><link>https://engineeringknowledge.blog</link></image><generator>Substack</generator><lastBuildDate>Thu, 23 Apr 2026 12:32:34 GMT</lastBuildDate><atom:link href="https://engineeringknowledge.blog/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Bernhard Wenzel]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[mail@bernhardwenzel.com]]></webMaster><itunes:owner><itunes:email><![CDATA[mail@bernhardwenzel.com]]></itunes:email><itunes:name><![CDATA[Bernhard Wenzel]]></itunes:name></itunes:owner><itunes:author><![CDATA[Bernhard Wenzel]]></itunes:author><googleplay:owner><![CDATA[mail@bernhardwenzel.com]]></googleplay:owner><googleplay:email><![CDATA[mail@bernhardwenzel.com]]></googleplay:email><googleplay:author><![CDATA[Bernhard Wenzel]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Quality attributes and constraints]]></title><description><![CDATA[Unfortunately, there is no escape from making trade-offs (not even in a parallel universe)]]></description><link>https://engineeringknowledge.blog/p/quality-attributes-and-constraints</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/quality-attributes-and-constraints</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Fri, 06 Jun 2025 17:32:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oJYZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>We want more quality (almost always)</h1><p>The word &#8220;quality&#8221; is not mentioned in the  <a href="https://www.un.org/en/about-us/universal-declaration-of-human-rights">Universal Declaration of Human Rights</a>, but it is not hard to see why increasing quality makes life generally better.&nbsp;</p><p>As consumers, we want our food to be fresh, nutritious and tasty. The cars we drive should be reliable, safe and comfortable. We want the new coffee machine to last long, be easy to use and grind quietly. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Engineering Knowledge is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>As workers, we take pride in producing quality results. When the things we create do what they are supposed to do and our bosses and clients are happy, we gain satisfaction.</p><p>There are also downsides to quality, though. Quality products take more time and effort to produce, have a higher risk of economic failure (which can motivate producers to cheat or take shortcuts). A high quality goal may not be achievable or realistic, which can be frustrating.</p><p>Still, although quality has a cost, neglecting to consider quality requirements will, in most cases, have negative long-term consequences. </p><p>I already mentioned some quality attributes. Fresh, reliable, safe, quiet and so on. The list is endless. The Wikipedia article about software quality attributes<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> mentions only "notable attributes" and still arrives at over 50 entries.</p><p>Picking desirable attributes is easy. The more the better one may think. The problem is that every attribute has an opposing counter-part. Optimizing one attribute always means clashing with another one. If we equally value two opposing attributes, we are in a predicament. Which leads to the unfortunate fact of life that there is no escape from having to make trade-offs.</p><h2>Why are there always trade-offs?</h2><p>Have you wondered why that is, actually? Why is there not one quality aspect that we can optimize without any downsides? </p><p>There are two reasons: </p><ol><li><p>Resources are limited</p></li><li><p>Inherent logical constraints</p></li></ol><h3>Resources are limited</h3><p>The most fundamental resources are time and money. If you want to develop lots of features: it will take more time (and/or more money). If you want something developed faster: it will cost more (and/or take longer). Scope, time and cost create a *triangle* that bounds every project we undertake. In this triangle, we can optimize two but never all three attributes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y1uq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y1uq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 424w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 848w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 1272w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y1uq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png" width="392" height="274" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:274,&quot;width&quot;:392,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37591,&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://engineeringknowledge.blog/i/165358244?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.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_!y1uq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 424w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 848w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.png 1272w, https://substackcdn.com/image/fetch/$s_!y1uq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de79419-f3d2-4abb-a10d-f79f5c6b1918_392x274.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>More features &amp; faster =&gt; that costs more</p></li><li><p>Cheaper &amp; faster =&gt; we have to drop features</p></li><li><p>Cheaper &amp; more features =&gt; that requires more time</p></li></ul><p>We can not escape this limitation. </p><p><em>What if we lived in a parallel universe?</em></p><p>Let's imagine a world where automation can produce anything instantly. Then we can keep making things cheaper while continue to add more features (this is what, to a certain degree, progress of the modern world is all about). </p><p>If we can in addition imagine that in this world resources are also unlimited and free to produce: then yes, we can simply add more and more features without requiring more time or more money.</p><p>Yet, even in this imaginary fantastic world, we would still not be free of having to make trade-offs.</p><h3>Logical constraints</h3><p>Just because we can produce anything immediately and at no cost, we are still bound by this other, nasty unescapable condition called <em>complexity</em>. </p><p>Let's say you want <em>simplicity</em> and <em>flexibility</em> at the same time. You want your coffee machine to be as easy to use as possible. So you give it exactly one button. Put your mug, press the button. That's it. However, if you also want to be able to configure your coffee to your many tastes (foam-strength, roast intensity, amount of water), that's not going to work with just one button. You will need many buttons (or other types of widgets).</p><p>What about if in the future we have computer brain interfaces, where I can just think of a "cappuccino, extra hot, half milk, strong roast"? I wouldn't need any dial at all and yet can configure whatever coffee I can imagine. Have we escaped the trade-off?</p><p>No. All we have done is move the problem from the interface of the coffee machine to the interface of your computer-brain-chip. Instead of your fingers, you will use your brain waves to interact with the machine. Now you want a chip that works for all "brain types". How many nerves contacts does the chip require? Simple to implant versus high "brain compatibility" (you may be surprised, but I am actually not a brain surgeon, so I am entirely making things up here). </p><p>The thing is: <em>complexity can only be shifted, it can't be reduced</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.  </p><p>Similarly to the limitation of resources, there is a boundary of complexity that we can't escape.</p><p>We also have <em>complexity constraint triangles</em>. Consider a classic software architecture triangle<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Tz5J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Tz5J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 424w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 848w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Tz5J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png" width="476" height="234" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:476,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40479,&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://engineeringknowledge.blog/i/165358244?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.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_!Tz5J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 424w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 848w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 1272w, https://substackcdn.com/image/fetch/$s_!Tz5J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F787faee9-cddc-4f4b-8cfb-a4621f762d3b_476x234.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>You want high cohesion with low coupling - every function does one thing, there are little to no dependencies - but now you need to duplicate functionality across your system so you wont be able to achieve clean modularity. </p><p>Similar is true for high modularity with low coupling - clean modules with little dependency on each other - now your modules need to have multiple responsibilities. </p><p>High modularity with high cohesion -  cleanly separated modules, and they do one or only a few things well - now you will have lots of cross-references and dependencies between the modules, they will be tightly coupled.</p><h2>Pick your attributes well</h2><p>As we can see now, it is important to choose your quality goals well. Otherwise, you may have to explain to your client that they can't have it both ways. This should be the first thing to figure out with stakeholders and everyone interested in what you want to design and deliver: what are the trade-offs to make and where do we plant our goal post between competing quality requirements? </p><p>We already said there are many attributes to choose from resulting in all sorts of trade-offs. Where do we start? That's what quality frameworks are for.</p><p>There are many to choose from (ISO-25010 etc). I want to introduce briefly the <a href="https://quality.arc42.org/">Arc42 Quality Model</a> because it is nicely condensed and intuitive. Instead of  considering all possible attributes (which go into hundreds in some models), it lists <em>eight key system properties</em> that connect to everything else.</p><p>The properties are (diagram taken from their website):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oJYZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oJYZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 424w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 848w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 1272w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oJYZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png" width="631" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:631,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36419,&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://engineeringknowledge.blog/i/165358244?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.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_!oJYZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 424w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 848w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.png 1272w, https://substackcdn.com/image/fetch/$s_!oJYZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d389bc7-2e24-469f-96af-3133612f78a6_631x342.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>I like to take these properties and think about priorities. The main goal of quality frameworks is to describe the complete landscape of all possible attributes, to ensure every angle of a system has been considered. But before thinking about completeness, we need to decide what to build first and what to focus on (especially in agile settings). This is useful for any project and can help steer the discussion between stakeholders and those who implement the solution.</p><p>If you could choose exactly one goal of any project, which one would that be? I think it is this: the most important objective is that we deliver what the client had asked us to build.</p><p>There is no point in shipping something highly performant if it doesn't solve the clients problem. If your employer asks you to build a shopping website, and you deliver a banking software, it simply does not matter that it is the fastest, most secure piece of software ever conceived.</p><p>Arc42 calls this property <strong>suitable</strong>, and I think it should be the first thing to think about. Suitability is where function requirements meet non-functional quality attributes. As with every system property, suitable means something different depending on the role someone has. Suitable code for a developer means something entirely different than suitable application for a user. It depends what matters to the client, but in general, we need to first make sure we understand what is means to build the "right" solution. </p><p>Next, the solution we deliver should be <strong>reliable</strong>. Delivering exactly what the client needs is great, but it does not matter much if the product does not work reliably. As with every attribute, there is a range. Reliable can mean performance, up-time, correctness etc. In the beginning, it may be fine for the client if the solution does not work all the time, for example, in a proof-of-concept project. As long as everyone agrees on what the expectations are.</p><p>Two properties can be equally important to reliability. Those are <strong>secure</strong> and <strong>safe</strong>. They are often inherently important, but given their high value (or risk of damage) it is particularly important to specify them. </p><p>What is the difference? It is "safe to use" versus "secure from mis-use". If there is any potential personal harm for a user, safety is even more important than reliability. If all we deliver is a website that shows public data, it may be acceptable to deliver a website without any user authentication. </p><p>Next I see equally important properties of <strong>operable</strong> and <strong>usable</strong>. So far, we are building a product that does what it should, that is secure and safe, now we need to consider its operation and use. In terms of requirements, this is where MVPs often neglect operability and usability in favor of speed and cost. A product that solves an urgent need may not to be the most usable tool. It may also be difficult to operate or deploy, but as long as we are able to get it out there and receive feedback we can be fine with little automation and manual lifting.</p><p>As the remaining two properties deal more with future requirements, they have lower priority. After a successful launch and once our application has proven to create demand, we want it to be <strong>efficient</strong>. Running software consumes resources that if, not done efficiently, may cause the business to fail when costs outweigh profits (the fate of many cloud apps). </p><p>Finally, our solution is working in full swing and new requirements come in regularly. Hopefully we have built something that is <strong>flexible</strong>, our final attribute. How well can we extend or adjust the product and evolve over time?</p><p>If you consider those eight properties together, you cover a lot of ground. </p><p>The resulting map looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tSYt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tSYt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 424w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 848w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 1272w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tSYt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png" width="1352" height="620" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:1352,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56442,&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://engineeringknowledge.blog/i/165358244?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.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_!tSYt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 424w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 848w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.png 1272w, https://substackcdn.com/image/fetch/$s_!tSYt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e05cadf-ef98-44a4-b07d-4b5d0514f0e2_1352x620.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><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://en.wikipedia.org/wiki/List_of_system_quality_attributes">https://en.wikipedia.org/wiki/List_of_system_quality_attributes</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><a href="https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity">https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>Another famous example: <a href="https://en.wikipedia.org/wiki/CAP_theorem">https://en.wikipedia.org/wiki/CAP_theorem </a></p></div></div>]]></content:encoded></item><item><title><![CDATA[Where the bug is a feature - using LLMs as a learning companion]]></title><description><![CDATA[Using LLMs as a learning companion.]]></description><link>https://engineeringknowledge.blog/p/where-the-bug-is-a-feature</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/where-the-bug-is-a-feature</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Mon, 27 Jan 2025 08:00:52 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b07d5fb9-b377-4f42-9cab-6a8f1dc5557d_482x494.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TxAH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TxAH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TxAH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:915919,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TxAH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TxAH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6614db9a-50d9-4d3e-9bb7-aac49a6b179d_1792x1024.jpeg 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>Large Language Models are at a pivotal point. On one hand, we still don't understand how they work or why they work so well - could human thought be nothing more than a pattern that these models have somehow uncovered? On the other hand, there's growing concern that LLMs are hitting a wall<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, that current approaches (i.e. throwing ever more money and computation on training) won't fix its biggest shortcomings (e.g. hallucinations), and that the alarmingly high valuations and expectations may come crushing down soon.</p><p>But whatever the future holds, as of early 2025, LLMs have demonstrated their usefulness in various ways. One specific use case - this blog's hobby horse - is using language models as a learning companion.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Engineering Knowledge is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>When the student is ready, the master will appear</h2><p>What would an ideal teacher look like? Imagine the perfect mentor on your side. Someone who is vastly more knowledgeable than you, but capable of speaking in a language you understand. Someone who knows your strengths and weaknesses, and can support or challenge you in just the right way. Above all, someone who is always available, endlessly patient and never gets tired.</p><p>How do chatbots compare to these ideal traits?</p><ul><li><p><strong>Endless patience</strong>. This is an undeniable match. Your favorite chatbot is always available, never gets tired, is always nice and never offended (unless you somehow get beyond their guardrails). That is the unbeatable advantage of a machine.</p></li><li><p><strong>Speaking your language</strong>. This is possible to accomplish, more or less, depending on how hard you try. Ask the chatbot to talk "as if to a child" and similar prompts can adjust the language to a level you understand.</p></li><li><p><strong>Vast knowledge</strong>. True and false, depending on your level of expertise. While LLMs are surpassing any single human's knowledge after having devoured the entire internet (and running out of training data), they are also prone to hallucinations, which make them highly unreliable.</p></li><li><p><strong>Understanding your strengths and weaknesses</strong>. LLMs don't know you, and have no agency to care for or plan your progress. However, with the right prompts and sufficient persistence, we can get them to emulate a useful mentor, as I explain below.</p></li></ul><p>LLM-based chatbots are comparable to highly capable interns with endless ambition and energy, who are extremely well-read, but have no life or work experience and demonstrate a dangerous lack of common sense. They are helpful hands but require constant supervision.</p><p>They do bring something new, however - something that computers could not achieve before: the ability to adapt to any written input. Until recently, human-computer-interfaces have mostly been static. Input was limited to a predefined set of controls, and the same input lead to the same output. Two different people get the same Wikipedia page and search engine results (except where advertisement may skew what is presented). Variations in output, such as in computer games, have mostly been random, not tailored to the individual player.</p><p>LLMs are way more malleable than other systems. While randomness still exists, the key difference lies in their quantum leap in understanding of written input. The ability to describe the context of my question in my own words - and have the system adjust to even subtle changes in how I express my intent - opens up entirely new possibilities for merging my mental model with new knowledge. That is, <em>if</em> we use these tools the right way.</p><h2>Every thought is a mental model</h2><p>In the book "Why Don't Students Like School?"<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, author Daniel T. Willingham describes the learning process in a beautiful way: <strong>"Understanding is remembering in disguise"</strong>. We learn new ideas by comparing them to old ideas. However, not just any old ideas. Learning occurs if we are able to pull up the <em>right</em> existing ideas from long-term storage, bring them into working memory, and arrange them in a way such that new ideas fit in.</p><p>The act of &#8220;loading old ideas&#8221; into working memory is crucial process, one that we can make more efficient by deliberately <a href="https://substack.com/@engineeringknowledge/p-40229495">describing, testing and extending our existing mental model</a>. The best thing about LLMs is that we can do all that directly at the prompt. This not only leverages what makes chatbots so useful<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><sup> </sup>but also makes our learning efforts significantly more productive.</p><p>For example, if two users ask, <em>"What is Kubernetes?"</em>, the chatbot will likely provide both users with similar responses. Using a language model that way, all we get is, at best, a better search engine.</p><p>However, if I begin with my personal mental model of Kubernetes&#8212;whatever it may be (and <a href="https://youtu.be/Vx-6-3HRazI?t=128">we always have a mental model</a>) - I can engage with the chatbot building on what I already know. This makes the responses more useful.</p><p>For example, I may provide the following prompt:</p><blockquote><p>I want to learn about Kubernetes. Here is what I believe.</p><p>Kubernetes is a framework to manage containerized applications. Kubernetes are built on top of containerization software like Docker. Kubernetes can use any kind of container run-time, but let us assume we are using Docker. Kubernetes extends Docker with new ways to define and manage applications.</p><p>On a high-level, Kubernetes creates two applications inside Docker: a control node and data nodes. The control node delivers the Kubernetes API and is the entry point to any Kubernetes cluster. The data nodes contain the application. There is at least one data node, but there can be more in case the application needs to scale up.</p><p>What I don't understand is how nodes are created and how Kubernetes uses Docker. Evaluate my understanding and explain what I don't know.</p></blockquote><p>(I have added a sample response below).</p><p>This way of prompting achieves two things: </p><p>1) I am describing my existing mental model to the chatbot - <em>and to myself</em>. (It is my model - you may not understand at all what I say, find it trivial or completely wrong, depending where you are on your journey). This activity alone is immensely valuable. Even if I don't press <em>send</em>, the act of articulating my thoughts helps clarify my doubts and enabling me to engage more actively with the subject. </p><p>2) I provide the LLM with a more detailed context, allowing it to generate a response tailored specifically to my problem.</p><p>Of course, you can start with the Wikipedia-style question and answer and go from there. They key is to drill down to your specific areas where you need clarification.</p><h2>Where the bug is the feature: an exercise in critical thinking</h2><p>Like any powerful tool, AIs can be either a boon or a bane, depending on how they are used. While I've discussed advantages of LLMs, it's equally important to address the caveats.</p><p>LLMs are designed to write well and please the user, which can easily create a misleading impression of authority. They are prone to errors, or worse, to fabricating completely false information. This inherent unreliability may never allow us to fully trust their output. In many fields, this poses a significant problem that could hinder widespread adoption.</p><p>In our situation, however, we can turn this flaw into an advantage.</p><p>Like an <a href="https://en.wikipedia.org/wiki/Unreliable_narrator">unreliable narrator</a> in fiction, who keeps us on our toes and makes us question the story in front of us, knowing that LLMs are flawed means we must always be ready to doubt their output. The first grave mistake to avoid, therefore, is to <strong>blindly trust any AI generated text</strong>, no matter how well articulated or convincing it may seem.</p><p>This is also called <em>critical thinking</em>, a basic skill useful in any context. By questioning and verifying the output, we are compelled to actively engage with the subject and continuously test our mental models. LLMs are particularly useful in areas that have <em>verifiable truthiness</em>. Engineering, for instance, is a suitable subject, because often it becomes immediately apparent if something works or not.</p><p>The unreliability of LLMs also prevent us from making the second grave mistake when using these new tools: <strong>outsource all our thinking to an AI</strong>. A chatbot may spit out the correct answer for you and fix your problem, but if your goal is to learn and grow intellectually, letting an AI do all thinking for you would achieve the opposite. It&#8217;s like saying, <em>&#8220;Cars can get me from A to B much faster, so what's the point of exercising.&#8221;</em></p><p>Instead, we need to figure out what parts of the thinking process to automate and where to do the heavy lifting ourselves. For example, if you are an experienced developer, using a coding AI to generate boilerplate code can be helpful, allowing you to focus on more complex and valuable tasks.</p><p>What about surrendering the ability to read maps by relying solely on GPS? I am not sure about this. I would not deliberately turn off route guidance (<em>"real men don't need GPS"</em>) but I believe that we may lose something deeper if we are not able to read maps anymore and orient ourselves in the world like generations before.</p><p>However, completely giving up on solving problems yourself and simply copying and pastings answers from an AI is a terrible idea. After all, if you stop thinking critically and let a machine do it for you, what's to stop someone replacing you with this machine?</p><p>Instead, use the LLM as a sparring partner. Let it generate ideas to spark your thinking and use it as a tool to find and fill gaps in your knowledge. Let it help you become smarter and focus on what is valuable and can not be automated.</p><p>Even if AIs were to become fully reliable, the third and ultimate mistake would be to <strong>replace human interaction with chatting to a bot</strong>. Humans are flawed, emotional, have hidden agendas, but the richness of <em>human connection</em> remains far beyond the reach of machines - and I doubt they'll ever come close (well, that's a topic for novelists to explore). A good human teacher connects with their students on multiple levels, offering a depth of engagement that no AI can replicate.</p><p>However, the LLM at your side can boost your efforts - for example, by helping you prepare a meeting with another human or by refining your writing to communicate more clearly (as it did for this post - thanks, dear AI editor).</p><div><hr></div><h2>Appendix: A sample response to my mental model</h2><p>Your understanding of Kubernetes is generally correct, but there are a few nuances and details that need clarification to give you a more complete picture. Let&#8217;s break it down:</p><h3>What You've Got Right:</h3><ol><li><p><strong>Kubernetes and Containerized Applications</strong>: Kubernetes ... provides the orchestration needed to deploy, scale, and manage containerized applications.</p></li><li><p><strong>Kubernetes and Docker</strong>: Kubernetes ... can work with other container runtimes as well, like containerd or CRI-O. Docker was historically the default container runtime for Kubernetes, though it's no longer the default in recent Kubernetes versions.</p></li><li><p><strong>Control Plane and Worker Nodes</strong>: Your description of the control plane (which you referred to as the "control node") and worker nodes (which you called "data nodes") is broadly correct. The control plane is responsible for managing the cluster, including scheduling applications (pods), maintaining the desired state, and exposing the Kubernetes API. Worker nodes run the actual containerized applications.</p></li><li><p><strong>Scaling</strong>: ... Kubernetes allows applications to scale by adding more worker nodes.</p></li></ol><h3>What Needs Clarification:</h3><ol><li><p><strong>Nodes and Their Creation</strong>:</p></li><li><p><strong>Node Types</strong>: Kubernetes clusters consist of <strong>two types of nodes</strong>: the <strong>control plane nodes</strong> and <strong>worker nodes</strong> (not just one control node). The control plane typically consists of multiple nodes (for high availability), which collectively manage the cluster.</p></li><li><p><strong>Node Creation</strong>: Nodes are typically physical or virtual machines (VMs) that you add to the Kubernetes cluster. These machines are prepared (or &#8220;provisioned&#8221;) and then registered with the Kubernetes control plane. Kubernetes doesn&#8217;t create these nodes by itself; they are provisioned through external systems or cloud providers like AWS, GCP, or Azure, which can automate the creation and addition of these nodes to the cluster.</p></li><li><p><strong>How Kubernetes Uses Docker</strong>:</p></li><li><p><strong>Docker and Kubernetes</strong>: When using Docker as the container runtime, Docker is responsible for running the containers, but it does so under the orchestration and management of Kubernetes.</p></li><li><p><strong>Kubernetes Components and Docker</strong>: The Kubernetes control plane manages everything. When a new application (or &#8220;pod&#8221;) is scheduled on a worker node, the kubelet (a Kubernetes component that runs on each node) instructs Docker to pull the necessary container image and start the container. The kubelet then continuously monitors these containers and reports back to the control plane.</p></li><li><p><strong>Pods and Containers</strong>: Kubernetes doesn&#8217;t directly create Docker containers; it creates <strong>pods</strong>. A pod is the smallest deployable unit in Kubernetes and can contain one or more containers. When Kubernetes schedules a pod, Docker (or the container runtime) runs the containers inside the pod. Thus, Kubernetes abstracts away the direct handling of Docker containers and instead manages pods.</p></li><li><p><strong>Control Plane Details</strong>:</p></li><li><p>The <strong>control plane</strong> consists of multiple components, including the <strong>API server</strong> (which exposes the Kubernetes API), the <strong>etcd</strong> database (which stores the cluster state), the <strong>scheduler</strong> (which decides which node runs a new pod), and the <strong>controller manager</strong> (which enforces the desired state of the cluster).</p></li><li><p><strong>Worker Nodes</strong>:</p></li><li><p>Worker nodes run a <strong>kubelet</strong>, which communicates with the control plane, and a <strong>container runtime</strong> (e.g., Docker) to run the containers. They also have a <strong>kube-proxy</strong> component that manages networking for the pods.</p></li></ol><h3>What You Don't Know (Based on Your Description):</h3><ol><li><p><strong>Node Provisioning</strong>: Nodes are not automatically created by Kubernetes; they need to be provisioned and added to the cluster through an external process. Kubernetes then manages these nodes once they are part of the cluster.</p></li><li><p><strong>Pods vs. Containers</strong>: Kubernetes doesn&#8217;t manage individual containers directly; it manages pods, which can contain one or more tightly coupled containers. The concept of a pod is central to Kubernetes and is a layer of abstraction above containers.</p></li><li><p><strong>Control Plane Components</strong>: The control plane is not a single application or node but a set of components working together across potentially multiple nodes to manage the entire cluster.</p></li></ol><h3>In Summary:</h3><p>You have a good foundational understanding of Kubernetes, ... However, to fully grasp Kubernetes, it's essential to understand the concepts of nodes (control plane and worker nodes), pods as the basic unit of work, the interaction between Kubernetes and Docker, and the broader architecture involving multiple components working together to manage the cluster.</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>It is an open discussion whether or not <a href="https://garymarcus.substack.com/p/confirmed-llms-have-indeed-reached">LLMs have peaked</a>.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>Why Don't Students Like School? by Daniel T. Willingham is a intriguing book for teachers and learners, that provides a few counter intuitive insights, for example, debunking the myth attributed to Einstein that "Imagination is more important than knowledge" - that fuzzy notion that we all can dream up innovative thoughts without the need to study hard facts, were in reality, knowing a lot of facts (which Einstein certainly did) is the precondition to build any kind of expert skill.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>AIs ability to adapt to user input is very useful, but others might say dangerous - depending on how you look at it, e.g. from a security standpoint (or your intentions).</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[An extremely short developer's guide to OpenAI (and the basics of generative AI)]]></title><description><![CDATA[The AI Service Provider]]></description><link>https://engineeringknowledge.blog/p/an-extremely-short-developers-guide</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/an-extremely-short-developers-guide</guid><pubDate>Sat, 17 Feb 2024 10:20:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rRxq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0zoD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0zoD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 424w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 848w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 1272w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0zoD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png" width="348" height="288" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:288,&quot;width&quot;:348,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0zoD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 424w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 848w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.png 1272w, https://substackcdn.com/image/fetch/$s_!0zoD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70387d96-5ba2-45ef-a771-72d6d3744fda_348x288.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><em>The AI Service Provider</em></p><p>An AI service provides intelligent capabilities that developers can integrate into their applications. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Engineering Knowledge is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>The depth and breadth of these capabilities depend on two things: 1) the quality of the models the service uses, and 2) how well developers can tap into those models (via an API).</p><p>Using OpenAI (<a href="https://platform.openai.com/docs/">https://platform.openai.com/docs/</a>) as an example, let&#8217;s examine each of the three components: models, capabilities, and the API, and learn the fundamentals of generative AI in the process.</p><h2>Models</h2><p>Generative AI has grown out of deep learning (with the help of a few milestone inventions, namely, Generative Adversarial Networks (GANs), Variational Autoencoders (VAEs), and Transformer Models), where vast neural networks are trained on large datasets to produce models that are used to accomplish intelligent tasks. What a model can perform is determined by the type of data used to train it and how much fine-tuning went into it.</p><p><em>Models and Training</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_!rRxq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rRxq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rRxq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg" width="1456" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:165038,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rRxq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rRxq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac980a3-a54b-42ee-8daa-09d3fb931725_3312x1207.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Models trained on images, for example, produce images, models trained on images + text, produce images based on text and so on.</p><p>The first thing to do when examining an AI service is, therefore, to look at the models they offer.</p><p>OpenAI's models are listed here: <a href="https://platform.openai.com/docs/models/overview">https://platform.openai.com/docs/models/overview</a></p><p>They include: </p><ul><li><p>GPTs for generating natural language</p></li><li><p>DALL-E for generating images</p></li><li><p>Whisper for converting audio into text</p></li><li><p>and many more.</p></li></ul><p>But what is a model, <em>actually</em>? A model is nothing other than a set of parameters (that represent the weights of the neural network that came out of the training). When you install, for example, an open-source large-language-model like Llama-2 on your computer, you will find a 100s GB large file on your drive that captures exactly those parameters (plus another file that handles the user interaction - see a video by Karpathy<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> for an excellent introduction).</p><p>One more thing to know about models is that they are trained during (at least) two phases: </p><ul><li><p>the <em>base training</em> uses a massive amount of data (e.g. large chunks of the internet) to produce a general model that is not yet that useful for the end user</p></li><li><p>followed by a <em>fine-tuning</em> phase that turns the base model into something better, like a question-and-answering assistant (e.g. ChatGPT)</p></li></ul><p>Fine-tuning doesn&#8217;t stop here. </p><p>A model can further be fine-tuned by the user. Either through more training or directly on the prompt by including the sample data in the chat (so-called "few-shot prompting"<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>)</p><h2>Capabilities</h2><p>Let's look at <a href="https://platform.openai.com/docs/guides/text-generation">OpenAI's capabilities</a>. A few we have already mentioned. </p><p><em>Model capabilities</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_!Zv3b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zv3b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zv3b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg" width="1456" height="523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:187330,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Zv3b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Zv3b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F864fd5c9-d7b8-46b4-84e2-75fe5cd9b87d_3335x1199.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><em>Text generation</em>: The key function of large language models is to generate text based on text input provided by the user (also called "prompts"). LLMs have been trained to understand language and behave in a question-and-answer manner.</p></li><li><p><em>Image generation</em>: Takes text or images to produce new images.</p></li><li><p><em>Vision</em>: Takes an image and allows to ask questions about it. </p></li><li><p><em>Text-to-speech</em> and <em>Speech-to-text</em>: Can be used to transcribe voice or produce audio based on text.</p></li><li><p><em>Moderation</em>: Takes text as input and flags the content for potential policy violations. Can be used to filter user input. </p></li><li><p><em>Function-calling</em>: Allows to connect a model with external tools provided by the user. </p></li><li><p><em>Embeddings</em>: An embedding is a numerical representation of text, allowing efficient handling of text search and other use cases.</p></li><li><p><em>Fine-tuning</em>: Creates a new model based on custom training data and default instructions. Useful for repetitive tasks that require additional training, complex prompts or rules. After fine-tuning, the customisation is integrated into the new model.</p></li><li><p>Some capabilities provide immediate value (e.g., text generation), while others are only useful in combination with other tools (e.g., function calling).</p></li></ul><p>The remaining question now is to figure out how to access those capabilities. OpenAI offers two APIs: <em>endpoints</em> and <em>assistants</em>.</p><h2>API </h2><h3>Endpoints</h3><p>Here are again the capabilities, but this time we include the endpoints. </p><p><em>Endpoints and capabilities</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_!Fe8N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fe8N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fe8N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg" width="1456" height="1085" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1085,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:184182,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Fe8N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Fe8N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ebce16-6385-42ad-b18a-6c2218526775_2316x1726.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As we can see, some capabilities can be accessed directly from an endpoint, while others are only available indirectly through a generic endpoint (<code>Chat</code> and <code>Audio</code>).</p><p><code>Chat</code> is the most capable endpoint, resembling a chat with ChatGPT. Previously called "chat completion," it works by sending a question to the endpoint and, depending on the question asked, returning more or less complex answers. It combines text completion, image recognition and function calling. <code>Audio</code> is the access point to create speech from text and vice versa.  The remaining capabilities have their own endpoint.</p><h3>Assistants API</h3><p>The endpoints we have mentioned so far directly tap into a capability. The Assistants API offers a more sophisticated experience. </p><p><em>Assistants API</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_!il5t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!il5t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 424w, https://substackcdn.com/image/fetch/$s_!il5t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 848w, https://substackcdn.com/image/fetch/$s_!il5t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!il5t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!il5t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg" width="1456" height="1435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1435,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:189000,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!il5t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 424w, https://substackcdn.com/image/fetch/$s_!il5t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 848w, https://substackcdn.com/image/fetch/$s_!il5t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!il5t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09bb0eb5-0a2b-4dc0-8d6f-55759117ad8d_2014x1985.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can think of it as the <code>Chat</code> endpoint but with more features. Mainly, conversations with an assistant are captured with <code>Threads</code> and <code>Runs</code>, making it possible to have several ongoing chat sessions. Also, assistants make it possible to provide files to the AI (to ask questions about them, or for "Knowledge Retrieval", see below).</p><p>Assistants have access to so-called "Tools," which are additional capabilities, only available through the Assistants API (except for function-calling, which is possible with the <code>Chat</code> endpoint). <code>Code Interpreter</code> "allows the Assistants API to write and run Python code in a sandboxed execution environment". <code>Knowledge Retrieval</code> gives the Assistant access to your own documents. It works by uploading a File to Open AI, which then automatically chunks, indexes and stores the embeddings so that the assistant can search and retrieve the document's content. </p><h2>Tokens, Embeddings, Prompt Engineering</h2><p>There are a few more things left worth mentioning:</p><ul><li><p><strong>Tokens</strong>: models process text in chunks called tokens<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>. The details don't matter much when using an LLM, except that the cost of using a service is based on the amount of tokens that have been used.</p></li><li><p><strong>Embeddings</strong>: we have already mentioned that they are a numerical representation of text in the form of a vector, which makes it possible to compare the similarity between documents by comparing the vectors mathematically.</p></li><li><p><strong>Prompt Engineering</strong>: working with LLMs is vastly different from how humans have interacted with computers so far. In the past, a computer required *exact* instructions, that would produce the same outcome with every execution. A slight mistake in the input could produce a useless result. LLMs are often capable of handling faulty or incomplete input (e.g. spelling mistakes), but they can make mistakes no matter how well the input was conceived. Also, the ability of LLMs to be "creative" leads to producing a different answer every time you ask the same question. This new approach to human-machine interaction is called "prompt engineering," and it is very worthwhile to invest time studying to make the best out of the new tools. </p><p></p></li></ul><p>Thanks for reading. Please reach out for comments, questions, or suggestions.</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.youtube.com/watch?v=zjkBMFhNj_g">Karpathy - Intro to Large Language Models</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><a href="https://platform.openai.com/docs/guides/prompt-engineering/tactic-provide-examples">OpenAI Prompt Engineering Guide - Few Shot Prompting</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><a href="https://platform.openai.com/docs/introduction/tokens">https://platform.openai.com/docs/introduction/tokens</a></p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Video - How to think about scalability]]></title><description><![CDATA[A first mental framework for dealing with scale]]></description><link>https://engineeringknowledge.blog/p/video-how-to-think-about-scalability</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/video-how-to-think-about-scalability</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Mon, 19 Jun 2023 11:41:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CLp1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CLp1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CLp1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg" width="1342" height="896" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:896,&quot;width&quot;:1342,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108226,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CLp1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CLp1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5e94cf-3034-4bae-b3b5-3a35496fd905_1342x896.jpeg 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>If you haven&#8217;t thought about scalability before, this short video provides you with the basic concept of scaling. </p><p>It also prepares you well to read the (highly-recommended) book &#8220;Designing Data-Intensive Applications&#8221; (https://dataintensive.net/), in particular, the first chapter.</p>]]></content:encoded></item><item><title><![CDATA[Thinking In Lists]]></title><description><![CDATA[Have you ever tried playing chess against yourself?]]></description><link>https://engineeringknowledge.blog/p/thinking-in-lists</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/thinking-in-lists</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Fri, 03 Mar 2023 14:20:39 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aS11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aS11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aS11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aS11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg" width="1440" height="846" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:846,&quot;width&quot;:1440,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98990,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aS11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5823c28f-7fd7-4fa9-b157-276dada44896_1440x846.jpeg 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>Have you ever tried playing chess against yourself? Unless you are a chess purist or have a split personality, it is not much fun.</p><p>The pleasure of engaging in a game like chess comes from challenging another mind (human or otherwise). From not knowing what the other is planning and the uncertainty that comes with it. When two opponents share the same brain, there are no secrets or surprises.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Thanks for reading Software Mental Models! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Another player makes the game &#8220;real.&#8221; When you have found a weakness in the opposing position and hatch a plan to exploit it, your opponent will prove your plot right or wrong. The stronger the rival, the harder your ideas will be tested. Left alone, that &#8220;clash with reality&#8221; can&#8217;t occur. You can try hard to emulate both separate sides, but as the two are coming from the same mind, all you do is evaluate yourself, which has limited value.</p><p>We are in a similar predicament every time we are trying to understand something or come up with an explanation. Because we are the creator of our thoughts as well as their recipient, we are <strong>biting our own tails</strong> whenever we try to figure out if what we think is correct or not.</p><p>To overcome the lack of outside perspective, we intend to look at a problem from all angles. The trouble is that not only is seeing the forest from the trees difficult, but that <strong>thinking itself is flawed</strong>. The mind&#8217;s default operational mode is not rationality, and it has no incentive to spot inconsistencies. Instead, it happily paints over blind spots, leaving us unaware of our imperfections.</p><p>Why is this so? Wouldn&#8217;t it be beneficial to our species to ensure that our thinking is consistent and flawless? The short answer is no. <strong>The mind is not designed to think.</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> From an evolutionary point of view, it is more beneficial for our survival to automate thinking as much as possible. Active, hard pondering of problems consumes valuable energy that would be better spent on spotting danger or other life-preserving activities.</p><p>The brain is arguably the most wonderful thing in the universe (as far as we know, that is). It can do marvelous things like seeing, hearing, memorizing, beating a heart, all at the same time and while giving birth to consciousness. But when it comes to learning and rational reasoning, the organ inside our skull is a broken tool, like a water bucket with holes.</p><p>Without a clear picture of what we actually think (rather than what we believe to think), efficient learning is difficult. It is essential to shine a bright light on the gaps in our reasoning and bring them out into the open. Learning is as much about gaining new insights as it is about getting rid of false beliefs.</p><p>What can we do?</p><p>Ideally, you&#8217;d have a few like-minded people at your disposal interested in your stuff who could challenge and inspire you (could this be an AI in the future? That would be tremendous).</p><p>Lacking such a sophisticated support group, the next best thing to do is to <strong>break the mind&#8217;s self-evaluation-loop</strong> by putting distance between the moment we generate an idea and the time we evaluate it.</p><p>Humanity has invented a tool for exactly that problem - pen and paper. Writing helps us capture our fuzzy thoughts and make them explicit and observable. The problem is it can be a laborious word-wrangling exercise to express ourselves. Luckily, for our purposes, we can skip most of the arduous parts of translating our intentions into sentences and simply transpose our raw thoughts onto paper. This can be done much easier and faster by <strong>making a list</strong>.</p><p>The difference between a list and &#8220;normal&#8221; writing is the intended audience. Usually, we write for others, which makes it so hard because the reader does not know anything about us. We need to give as much context and be exact as possible to avoid ambiguity. The list, on the other hand, is only meant to be read by the author. No need to explain where we are coming from; we can be as esoteric in our descriptions as we like.</p><p>There is one non-negotiable requirement, though: <strong>Everything on the list has to be written using our very own words.</strong> This is crucial to make the list fulfill its purpose.</p><p>Looking up answers and copying-pasting them into our list does not help at all - rather the opposite, it only strengthens the gaps in our understanding because it creates the illusion of knowledge. We may write down correct facts, but they are not coming from us.</p><p>This is one reason why highlighting passages in a book does very little to increase comprehension of a text. It looks like learning because the passages are important, but they are not our words, they are expressions of someone else&#8217;s thinking (underlining text passages can still be a useful activity, but the highlights are merely bookmarks, helping navigate a large amount of information).</p><p>Definitions, buzzwords, or concepts we don&#8217;t fully grasp don&#8217;t belong on the list. Unless we write down precisely this - that we don&#8217;t understand those terms (e.g., &#8220;Technology X is a distributed-self-contained management system - what the heck does that mean?&#8221;)</p><p>We list what we know (or believe to know) and what we don&#8217;t know or understand. This is a fast and fluent exercise. It does not require much thinking. Then, very soon, we will have exhausted what&#8217;s on our mind.</p><p><strong>I love making lists</strong>. Whenever I am stuck, I start listing my thoughts. This post here started as a list (as all others have) that I then successively transformed into full sentences. The moment I got stuck, I switched back into list mode, and so forth. I&#8217;m always shifting modes. From slow and exact writing, building up a single line of argument, to the immediate and quick jotting down of multiple strands of thoughts (there are other modes, but that&#8217;s a subject for another post).</p><p>When I begin a new task, I start with a list. To clarify my intentions and beliefs and to prepare myself for the work ahead by bringing into focus the things I&#8217;m sure about and those I&#8217;m not. This way, I prime my mind to find answers for the gaps I have and to look for confirmation of what I assume to be true.</p><p>Lists are helpful for any kind of mental task. They expand our short-term memory. They force us to think sequentially and turn vagueness into explicitness. And list-making is a fun activity, even relaxing, similar to meditation with its benefits, where we step back from being mindlessly captured by thoughts and instead gain control through observing our mental states.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Thanks for reading Software Mental Models! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="http://www.danielwillingham.com/books.html">Daniel T. Willingham - Why Don&#8217;t Students Like School?: Chapter 1 - The Mind is not designed for thinking</a></p></div></div>]]></content:encoded></item><item><title><![CDATA[Video - How to learn confidently with mental models]]></title><description><![CDATA[This is the video version of my intro post about software mental models. I give a summary of the key points (I might do a more condensed and polished 5-minute version at some point)]]></description><link>https://engineeringknowledge.blog/p/video-how-to-learn-confidently-with</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/video-how-to-learn-confidently-with</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Tue, 25 Oct 2022 08:59:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/Vx-6-3HRazI" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is the video version of my <a href="https://softwarementalmodels.com/p/software-mental-models">intro post about software mental models</a>. I give a summary of the key points (I might do a more condensed and polished 5-minute version at some point)</p><div id="youtube2-Vx-6-3HRazI" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Vx-6-3HRazI&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/Vx-6-3HRazI?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> </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Thanks for reading Software Mental Models! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Knowledge As Design]]></title><description><![CDATA[Does knowledge have a purpose?]]></description><link>https://engineeringknowledge.blog/p/knowledge-as-design</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/knowledge-as-design</guid><pubDate>Thu, 08 Sep 2022 12:43:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zevu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zevu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zevu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zevu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zevu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zevu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zevu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg" width="458" height="690" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:132183,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zevu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zevu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zevu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zevu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4730629e-64e3-4e8d-a2d9-7542743de990_458x690.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>What do we value most in life? Health is an obvious choice, next to love and meaningful friendships. Money is certainly on the list too, but controversial, at least when pursued narrowly at the cost of everything else (though few would dispute that a good life depends on owning a sufficient amount of it).</p><p>Uncontroversial is the value of another item: knowledge. Our post-industrial society increasingly depends on the creation and transfer of know-how and technical expertise. We usually consider knowledgeable people as intelligent, which often correlates with higher social status and financial reward. </p><p>But what is knowledge? It is surprisingly hard to define. Does memorization of a lot of facts (e.g historical dates) count as knowledge? Then your internet-connected computer would be the most knowledgeable entity ever created. Facts are data points. Taken by themselves, they have limited value if we can't explain their existence and are unable to predict future facts. In other words, we lack understanding.<br>Furthermore, the value of knowledge depends on its usefulness to solve a problem. In particular, to solve <em>my</em> problem. Ask "How much do you know about X?" and I would reply "to accomplish what?" (which is nicer than an engineer's favorite retort of "it depends..."). I know that a combustion engine needs oil and gas to function and have a dim idea about gears. Enough knowledge for me to drive a car, understand the meaning of warning lights and abstain from shifting into reverse while the car is moving forward. If you ask me, I know all there is about cars. However, if tomorrow I wanted to start a new career as an auto mechanic, I would immediately find out that I know very little.</p><p>Figuring out the <strong>purpose</strong> of knowledge not only affects how we think about it but also fundamentally changes how we teach and learn. By asking about the reason for knowledge we move from passive consumption of facts to an active inquiry about the why, how, how well and so on.</p><p><br>How purpose and knowledge relate to each is the subject of the fascinating book  <strong>&#8220;Knowledge as Design" </strong>by D.N. Perkins<strong>. </strong>As the title suggests, the author considers knowledge not something that is out there, given to be consumed without critical analysis (he calls this "truth mongering") but something that has a purpose, or, in a broader sense, a design. </p><p>The first thing to note is that the word <em>design</em> may be misleading. If you, like me, haven't thought much about design before you may equate it with style (fashion, brands, websites) or a blueprint to build something (design of a house). The author takes a wider look and defines design more accurately:</p><blockquote><p><strong>Design is the human endeavor of shaping objects to purposes</strong></p></blockquote><p><br>Almost everything is a design. A knife is an object adapted to the purpose of cutting things. Academic knowledge is also designed - Newton's laws are a mathematical tool to explain the motion of bodies. So are processes, claims, and even historic dates as a part of a larger story (for example, the year 1492 marks a milestone in western civilization). There are only a few things that are not designs (like natural phenomena).<br>So how does thinking about design help us with acquiring knowledge? Knowing the purpose of a design is crucial, but purpose alone only explains the reason a design exists, it does not say anything about how it solves a problem.</p><h2>The four design questions</h2><p>The author gives us a tool to examine designs by formulating <strong>four design questions</strong> that make up the heart of the book. <br>The questions to ask about a design are the following:</p><ol><li><p>What is its purpose?</p></li><li><p>What is its structure?</p></li><li><p>What are the model cases of it?</p></li><li><p>What are the arguments for and against its usefulness? </p></li></ol><p>"Purpose" we have already discussed. The <strong>structure</strong> of a design deals with the parts, components, materials, relations, and so forth of the object in question. A knife has a cutting edge attached to a handle. </p><p><strong>Model cases</strong> are examples of the object or knowledge (imagine photos of different types of knives). Model cases are in some sense mental models, but in a much narrower way (I come back to this later).</p><p><br><strong>Arguments</strong>, the last of the four questions, evaluate a design. How well does it do its job? Given the purpose, is the design well-thought-out or could it be better? While the former three questions could be answered without much context, here we depend on our subjective understanding of the object at hand. I can't say anything about the effectiveness of a design if I don't understand what it does or how it differs from other solutions. </p><p><br>The book discusses at length how the four questions can be applied to practically everything. It turns out that looking at the world through design glasses is tremendously useful. Be it how to write an essay, how to come up with new insights or how to improve learning and teaching in general.<br>Since knowledge plays such an important role in our life, it is worth looking at how this new way of thinking about knowledge (as design) compares to our default way (as information).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zrFK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zrFK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 424w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 848w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 1272w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zrFK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png" width="1320" height="628" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/d119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:308442,&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_!zrFK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 424w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 848w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.png 1272w, https://substackcdn.com/image/fetch/$s_!zrFK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119c6a7-22ff-450b-a18b-f1324ffb1825_1320x628.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 shift from the left to the right, from the passive to the active, by connecting what we learn to each of the four design questions.</p><p>So how does all this help us with our mental models? Is one better than the other?</p><h2>How do software mental models (SMM) compare with the four design questions (4DQ)?</h2><p>The short answer is that 4DQs are a tool to evaluate the subject at hand that leads to a conclusion, while SMMs are a process that keeps evolving. There is overlap between the two but also significant differences. Let's have a look at each of the four questions.</p><h3>Model cases</h3><p>We start with likely the most confusing part. Aren't mental models the same as model cases? Not really. Mental models, at least the way I use them, are internal representations of reality, that can differ significantly from the actual object. Model cases are examples (of object types, procedures, formulas, etc). In contrast, mental models are simplifications that are (hopefully) so useful that they can explain complex processes with a few elegant analogies. Coming back to the simple example of a knife, model cases would present all the different types of knives (we could, for example, present their evolution from the stone age until today), whereas the mental model of a knife depends on what goal I have. In my case, I mostly think about knives in the context of a kitchen, so I have mental models about how the sharp side of a blade works and what knife to use for certain materials (e.g. bread versus meat). A chef has vastly more complex internal representations of knives. She might think about angles, handles, all kinds of materials, cutting techniques, and so on.</p><h3><br>Structure</h3><p>The structure of a design describes the elements and parts of the object or knowledge. Mental models include structure, too, but only those parts that are useful for achieving the goal. When learning something new, the structure of a model will be similar to a structure of a design. The more advanced the models get, the more abstract they become until they may have nothing in common anymore with the actual object.</p><h3>Purpose</h3><p>The purpose of a design is similar to what I consider the goal of a mental model. However, in the case of SMMs, the goal is deeply personal, whereas the purpose of a design is meant to be independent of the learner. <br>The goal of a mental model gives clarity about what is important and what I can leave out. The goal evolves. In a design, the purpose is fixed - the reason the design exist stems from the purpose. <br>In reality, the purpose of a design is still to some degree subjective, because it depends on the knowledge of the learner. A physics beginner in school will come up with a different, simpler purpose for Newton's laws than a university graduate. </p><h3>Arguments</h3><p>Arguably, arguments are the most important of the four questions because they require the learner to conclude based entirely on their understanding and experience. Purpose, structure, and model cases lay the foundation upon which arguments are built. </p><p><em>SMMs don't have arguments at all</em>. If they are so important, how can this be? </p><p>The reason can be found in the fact that SMMs are a process. Arguments and purpose are two sides of a coin. The argument describes how well a design accomplishes its purpose with the outcome of an evaluation. SMMs don't have a final step. Instead, we evaluate models during the test phase, where we figure out where the models are inaccurate. Instead of giving a judgment, however, we correct the model and make it better during the refinement phase (or replace it with a better model if necessary). The argument is ingrained in the process. </p><p><br>In summary, we can say that <strong>SMMs are the agile version of 4DQ</strong>. </p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-QN2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-QN2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 424w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 848w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 1272w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-QN2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png" width="1272" height="908" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/b98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:908,&quot;width&quot;:1272,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:553187,&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_!-QN2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 424w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 848w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.png 1272w, https://substackcdn.com/image/fetch/$s_!-QN2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb98e1a76-0db9-43e8-832f-c9236ffca8a3_1272x908.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><em>The 4DQs are a very useful tool to structure thinking, learning, and writing. The book can be repetitive at times as it goes through the many possible applications of the theory, but once the main ideas are understood it is easy to skip content and focus on the parts that interest you. They are certainly useful for developing SMMs.</em></p><h3><br>Can you spot the 4DQ in this post?</h3><p>Writing an essay is among the use cases of the theory. Can you spot where in this post I have used the four questions?</p><p><br>Answer: </p><ul><li><p>The first half of this post explains the purpose and structure of the 4DQs. First I made claims about the importance of knowledge, and in particular, the value of looking at the purpose of knowledge</p></li><li><p>Then I described the structure of the 4DQs, describing each question. </p></li><li><p>I finished the first half by completing my description of the purpose of the 4DQ by demonstrating the value of moving from seeing knowledge as information to considering knowledge as design.</p></li><li><p>I use model cases of 4DQs throughout the post, most of the time using the example of a knife. And, to go fully recursive, this answer is another model case of the 4DQs.</p></li><li><p>In the second half I give arguments by comparing in detail the 4DQs with SMMs, with the conclusion that while there's overlap between the two ideas, SMMs fundamentally differ from 4DQs by being an ongoing process instead of a final evaluation of an object or piece of knowledge.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/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">Thanks for reading Software Mental Models! Subscribe for free to receive new posts and tell me that you like my work :-).</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The Mental Model Of Docker Container Shipping]]></title><description><![CDATA[How container shipping explains the inner workings of Docker]]></description><link>https://engineeringknowledge.blog/p/the-mental-model-of-docker-container</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/the-mental-model-of-docker-container</guid><pubDate>Thu, 19 May 2022 07:56:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MW1k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MW1k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MW1k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MW1k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg" width="720" height="403.875" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/ab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:359,&quot;width&quot;:640,&quot;resizeWidth&quot;:720,&quot;bytes&quot;:58958,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MW1k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MW1k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fab0059df-880f-4326-b1b7-a2f953f4b877_640x359.jpeg 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>Programming is a marvellous activity. By typing on a keyboard and feeding code to a computer, a programmer can create entirely new (virtual) worlds out of nothing. There are few constraints on what a program could be - the only limitations are memory and a CPU's processing power. Whatever you can think of, you could, in theory, bring into existence on a computer.&nbsp;</p><p>But since virtual worlds are created in the mind of a developer and not based on physical reality, it can be difficult to talk about what they are or how they work. There is no immediate language to refer to. To overcome this lack of terminology, engineers often use analogies from the real world to describe what software does.</p><p>Docker is no exception. At its centre stands the "container", the main building block of what Docker calls a "standard of shipping software". One can't help but see container ships towing heavy loads over oceans. Even the logo depicts the main idea:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rO-9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rO-9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 424w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 848w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 1272w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rO-9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png" width="262" height="216.69583333333333" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:397,&quot;width&quot;:480,&quot;resizeWidth&quot;:262,&quot;bytes&quot;:105298,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rO-9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 424w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 848w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 1272w, https://substackcdn.com/image/fetch/$s_!rO-9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F16522acb-02a4-42ac-a13f-80eff1a79e8b_480x397.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>&nbsp;<em>Containers and shipping software</em></p><p>When we learn about new technology with strong ties to another technology, we immediately apply our existing knowledge of the substitute technology to fill gaps in our understanding. This "replacement reasoning" can be helpful or misleading, depending on how accurate the analogy turns out to be. Therefore, to avoid misconceptions, it is beneficial to evaluate existing mental models first, as they are the ground on which we build our individual models.&nbsp;</p><p>In the case of Docker, we want to know how helpful the idea of "container shipping" is and how far we can take the analogy.</p><p>It turns out that there are many parallels between real and virtual containers and that the properties of container shipping cover quite a lot of concepts of Docker.&nbsp;</p><h2><strong>Containers (those made from steel)</strong></h2><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a3qd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a3qd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a3qd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg" width="476" height="364.5245901639344" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:854,&quot;resizeWidth&quot;:476,&quot;bytes&quot;:151040,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a3qd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a3qd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7faaaeff-d2e4-4a55-899a-d911251c4585_854x654.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Shipping containers revolutionized international trade by making it possible to move freight between different modes of transport without the need to re-package goods. Due to standardization and a complex system of docking ports, the cost and time it takes to ship goods worldwide have been significantly reduced.&nbsp;</p><p>What makes containers so valuable is that they can be stacked neatly on top of each other, thanks to their standardized dimensions. They can also carry nearly any kind of goods and can be used interchangeably.</p><h2><strong>Docker Containers</strong></h2><p>Like shipping containers, Docker containers also increased efficiency. Most applications run on Webservers. In the past, it was not possible to execute more than one application per server. Not only was managing a fleet of individual servers difficult, but it also lead to a waste of resources, as applications can vary significantly in their requirements that change over time (servers needed to keep a capacity reserve).&nbsp;</p><p>Then a company called VMWare came along and invented the virtual machine. I mentioned in the intro that computers create virtual worlds. They can also create&nbsp;<em>worlds inside worlds</em>. A virtual machine is an emulation of hardware. Each emulated hardware is a new virtual computer (creating computers inside a computer), making it possible to run multiple applications side by side on the same server.&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ew36!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ew36!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ew36!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ew36!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ew36!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ew36!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg" width="312" height="305.6842105263158" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:494,&quot;resizeWidth&quot;:312,&quot;bytes&quot;:56998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ew36!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ew36!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ew36!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ew36!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F313d134f-1852-40f0-b4fd-e0306565945d_494x484.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em>One OS per VM (Source: "Docker Deep Dive"&nbsp;<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>)</em></p><p>This makes deploying applications much more efficient. Applications run inside their own virtual machine (VM), and hardware resources can be individually distributed to meet the requirements of each application.&nbsp;</p><p>But VMs are big. Virtualizing the hardware requires each virtual machine to include an entire operating system.&nbsp;</p><p>Docker takes a different approach. Instead of virtualizing the hardware, it aims higher and abstracts away the operating system. Docker containers share the same OS resources, making them more lightweight <a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dMQ3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dMQ3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dMQ3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg" width="344" height="236.94605809128632" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:332,&quot;width&quot;:482,&quot;resizeWidth&quot;:344,&quot;bytes&quot;:37878,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dMQ3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dMQ3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5d46ce25-9426-401c-92cc-30860ec936e2_482x332.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><em>Docker containers are smaller (Source: Docker Deep Dive)</em></p><p>We talked about why Docker exists, but we still haven't said what a container actually is.</p><h2><strong>How do Docker containers compare to physical containers?</strong></h2><p>The physical container is an enclosing made of steel that carries goods. Similarly, a Docker container provides applications with an isolated environment (the virtual equivalent of an enclosing).&nbsp;</p><p>Actual containers are filled with goods. A Docker container runs an application. To understand how the application ends up on a Docker container (and how that is done efficiently), we need to understand three basic concepts:&nbsp;</p><ul><li><p>Docker engine</p></li><li><p>Docker image</p></li><li><p>Containerizing an app</p></li></ul><h2><strong>Docker Engine</strong></h2><p>The word "Docker" can mean two things.</p><p>First, there is Docker,&nbsp;<em>the company</em>. They develop the tools and libraries required to run Docker and maintain the Docker hub, a central repository.&nbsp;</p><p>Then there is Docker,&nbsp;<em>the technology</em>. There are three main components <a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>:</p><ul><li><p>The&nbsp;<em>runtime</em>&nbsp;provides low-level libraries and components to run containers.</p></li><li><p>The&nbsp;<em>engine (or Daemon)</em>&nbsp;provides higher-level functionality, most of all the interface for Docker commands.</p></li><li><p>A&nbsp;<em>Client</em>&nbsp;is an application that talks to the Docker Daemon (e.g. the&nbsp;<code>docker</code>&nbsp;or&nbsp;<code>docker-compose</code>&nbsp;commands)</p></li></ul><p>When someone learns Docker, they will spend most of their time understanding the interactions of a Docker client with the Docker daemon.&nbsp;</p><p>Actual containers are made out of steel. Similarly, the Docker engine + runtime are "the fabric of Docker containers".</p><h2><strong>Docker image</strong></h2><p>The Docker glossary describes containers as a "runtime instance of an image" <a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>. An image is a collection of files that are executed when a container runs. They are, we could say, the "content" of a container - in other words, the application.&nbsp;</p><p>Images are constructed in layers, where each layer corresponds to a set of files of a container. More precisely, each layer is a set of file&nbsp;<em>changes</em>. When an image is built, layers are executed sequentially, possibly overriding files of a previous stage.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dw7R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dw7R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dw7R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg" width="468" height="266.76" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:600,&quot;resizeWidth&quot;:468,&quot;bytes&quot;:49101,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dw7R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dw7R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8fe1aad0-13be-4d79-9a0c-dfa0f33a899b_600x342.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em>Image layers, overriding changes (source: "Docker Deep Dive"&nbsp;<a href="#fn1-2629">1</a>)</em></p><p>Layers can be cached. That makes building images efficient because every time an image changes, we only need to update those layers that have changed.&nbsp;</p><h2><strong>Containerizing an application</strong></h2><p>The final piece of the Docker puzzle is the so-called process of "containerizing an application". Or in other words, how do we turn an application into an image that we can then execute on a container?&nbsp;</p><p>This is done via a&nbsp;<em>Docker file</em>. In the container shipping model analogy, a Docker file is similar to a list of items that describe the content of a container. Except that it not only lists the files but also describes the order of their occurrence or modification.</p><h2><strong>Side-by-side comparison of container shipping and Docker</strong></h2><p>Finally, we get to the fun part! How far can we take the analogy of container shipping to create a mental model of Docker?&nbsp;</p><p>Container shipping is straightforward to visualize - starting with containers loaded with goods to the cranes lifting them onto ships and so forth until they reach their destination. For every step in the journey of a container, we can find a similar action in the Docker world. </p><p>Let's compare them side-by-side.</p><p><em>(sorry for the suboptimal formatting using images - substack please make it possible to insert tables! You can read the post <a href="https://bernhardwenzel.com/2022/the-mental-model-of-docker-container-shipping/">here as well</a> with better rendering)</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_!Gdec!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gdec!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gdec!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg" width="1456" height="1208" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1208,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:536740,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gdec!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Gdec!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a4a201e-19f0-400b-a1ed-ea5abaacc205_1798x1492.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lL_8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lL_8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lL_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg" width="1456" height="1107" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1107,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:346925,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lL_8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lL_8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F772fac4c-1127-4915-8c4d-2d1fdc2a87d3_1794x1364.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p> We can even create a little diagram that compares both worlds:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9sFI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9sFI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9sFI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg" width="820" height="468" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/c3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:468,&quot;width&quot;:820,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9sFI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9sFI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3ebac17-d693-495a-913e-b4db775ac977_820x468.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Think of a Docker container as a vessel for applications.</p></li><li><p>The Docker engine (and runtime) provides the enclosing for goods, similar to steel used to fabricate a physical container.</p></li><li><p>The Dockerfile is like a description of the contents of a container.</p></li><li><p>The image provides the content of a container, each file (change) is like a single good.</p></li><li><p>Building and uploading an image prepares the content of a container.</p></li><li><p>Downloading an image and creating a container is like a crane lifting a container onto a ship.</p></li><li><p>Running the container can be compared to a ship transporting containers over the ocean.</p></li><li><p>Stopping a container, destroying it and deleting an image is similar to a crane lifting a container off a ship, taking out the goods and scraping the empty container.</p><p></p></li></ul><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://learning.oreilly.com/library/view/docker-deep-dive/9781800565135">Docker Deep Dive by Nigel Poulton - Safari Bookshelf</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>The disadvantage of Docker is that all applications need to run on the same OS - but since Linux is the de-facto standard for most applications, this is usually not a problem.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>A fourth component,&nbsp;<em>swarm</em>, is often mentioned as well, which coordinates multiple instances of containers</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><a href="https://docs.docker.com/glossary/#container">https://docs.docker.com/glossary/#container</a></p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[First Git Mental Model]]></title><description><![CDATA[How to develop a mental model, using Git as an example]]></description><link>https://engineeringknowledge.blog/p/first-git-mental-model</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/first-git-mental-model</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Wed, 10 Nov 2021 09:01:20 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RoeP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RoeP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RoeP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 424w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 848w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 1272w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RoeP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png" width="894" height="549" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/d6411148-d891-4c4d-a213-8cd796f1c637_894x549.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:894,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RoeP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 424w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 848w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.png 1272w, https://substackcdn.com/image/fetch/$s_!RoeP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6411148-d891-4c4d-a213-8cd796f1c637_894x549.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 make sense of the world through models we create in our minds. How well we understand reality depends on the accuracy of those models. However, we are often not aware that our internal representation can be inaccurate or, worse, we may not even realise that we use mental models at all. By bringing our thought processes into the open, we can shed light on the gaps in our understanding and learn more efficiently.</p><p>I have written about the <a href="https://softwarementalmodels.com/p/software-mental-models">role of mental models in software engineering</a>. I recommend reading that first if you haven&#8217;t done so, as it explains the main idea. In this post (and more to follow), I take an existing tool, framework or subject and look at it through the lenses of mental models.</p><p>Today&#8217;s example is <strong>Git</strong>. It assumes little or no prior knowledge. If you are already well-versed in Git, I encourage you to keep reading nonetheless. The goal of this series is as much teaching a specific subject as it is about exploring how to construct good mental models in general. There is no shortcut to achieving accurate understanding. As good as an existing mental model may be, we still have to absorb and make it our own; we can&#8217;t just copy and paste it into our brains (unfortunately).</p><h2><strong>What is Git?</strong></h2><p>The official definition says this:</p><blockquote><p>Git is a distributed version control system.</p></blockquote><p>Does reading this sentence evoke any mental images for you? In my case, the word &#8220;distributed&#8221; brings to mind several computers running in distant locations. &#8220;Version control system&#8221; lets me see software that stores copies of documents in an orderly fashion.</p><p>This is rather vague. A better way to understand something is not to ask &#8220;what&#8221; it is, but &#8220;why&#8221; does it exist - what is its purpose?</p><h2><strong>What is the purpose of Git?</strong></h2><p>There are primarily two problems Git is trying to solve:</p><ol><li><p>How can multiple people work in parallel on the same documents without stepping on each other&#8217;s toes?</p></li><li><p>How can we provide a safe environment for making changes without worrying about losing previous work?</p></li></ol><p>2) is part of the solution for 1). However, it is also possible to only take advantage of 2) while ignoring 1) (if you use Git solely as a local version tracker, which is a legitimate use case).</p><h2><strong>1 - How can multiple people work on the same documents at the same time?</strong></h2><p>Let&#8217;s think about 1) - there is a group of people who want to work on the same set of documents simultaneously. How can they do that? Pose that question to yourself, and your brain will immediately start generating possible answers.</p><p>Depending on how much experience you have with a given problem, the solution you come up with can be complex or straightforward. A natural way to find a solution to a problem is to search in our memory for a similar situation that we can apply to the new challenge. How do people typically collaborate?</p><p>I see an office where several people are sitting around a table, with paper documents spread out in front of them. They pass files around, discuss changes, use pencil and eraser (or scissors and tape) to make changes.</p><p>Something like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NaVn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NaVn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 424w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 848w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 1272w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NaVn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png" width="706" height="434" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:706,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!NaVn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 424w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 848w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.png 1272w, https://substackcdn.com/image/fetch/$s_!NaVn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0a2430b6-2f97-40cf-b388-02bd28f936fa_706x434.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>Although this model describes collaboration, the participants can&#8217;t work in parallel, as they need to take turns to change a document. Let&#8217;s refine our model by having everyone work on copies instead of the original documents. To reflect that Git is a distributed system, we also let each worker have their own table.</p><p>Our new model looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nofv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nofv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 424w, https://substackcdn.com/image/fetch/$s_!nofv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 848w, https://substackcdn.com/image/fetch/$s_!nofv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 1272w, https://substackcdn.com/image/fetch/$s_!nofv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nofv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png" width="1026" height="508" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:508,&quot;width&quot;:1026,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!nofv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 424w, https://substackcdn.com/image/fetch/$s_!nofv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 848w, https://substackcdn.com/image/fetch/$s_!nofv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.png 1272w, https://substackcdn.com/image/fetch/$s_!nofv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8c9339fc-c46b-43bc-a12c-5b7ee4f9ad16_1026x508.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>How would that work? The table in the middle (let&#8217;s call it the &#8220;origin&#8221; table) contains the original documents. If I want to work on them, I first make copies of the documents and then grab one of the tables and go about making changes as I please. Then comes the moment to update the originals. I go back to the origin table and replace the sources with my edited copies.</p><p>There&#8217;s just one problem: what if someone else has already changed the originals? If I swap the documents, their changes will get lost.</p><p>So instead of swapping out entire documents, I need to &#8220;merge&#8221; my changes with whatever is on the origin table. This works most of the time, except when my change and someone else&#8217;s change are in &#8220;conflict&#8221;. For example, in a design document, someone changed the color of a button from red to green, but I changed it from red to yellow. Who&#8217;s change should persist?</p><p>A conflict:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-1GN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-1GN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 424w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 848w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 1272w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-1GN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png" width="858" height="322" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:322,&quot;width&quot;:858,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!-1GN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 424w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 848w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.png 1272w, https://substackcdn.com/image/fetch/$s_!-1GN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd74a64-0548-4702-8c22-a0ec2357ce20_858x322.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>I want to keep my version, but what if I change my mind later (because it turns out my colleague was right)? That is the second problem Git solves: as long as we track changes and can revert back to a previous state, we are safe to make changes.</p><p>How does Git make that possible?</p><p>Assume I have no spontaneous idea. We are then at a typical state during the learning process. We have exhausted fleshing out our mental model (or don&#8217;t want to speculate anymore), and we encountered a few areas where we can&#8217;t satisfyingly figure out how things work in reality.</p><p>This is a good moment to do some research and consult a book or a manual.</p><h3><strong>Sidenote: why start with the mental model?</strong></h3><p>You may ask why we didn&#8217;t start reading the book before building our model. Aren&#8217;t we wasting our time trying to come up with an explanation of how things work without having done research first? I disagree. By having made our current knowledge visible, the subsequent research becomes more targeted. We can locate gaps more quickly, know what kind of information we need or don&#8217;t need, and have a map to place new information.</p><h2><strong>2 - Keeping a log of changes</strong></h2><p>So how does Git keep a log of changes?</p><p>I use <a href="https://git-scm.com/book/en/v2">Pro Git</a> as reference documentation. A good chapter to start is <a href="https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F">What is Git?</a>, you may want to read it now.</p><p>The main point from that chapter leads us to the answer to our question:</p><blockquote><p>Git maintains snapshots of changes, not diffs</p></blockquote><p>In other words, every change in Git is stored as a snapshot of all files. Note that the word &#8220;snapshot&#8221; is another mental construct. Like a camera that catches a scene at a specific moment, a snapshot in computing is a copy of an entire state of a system at a certain time. We can use that information to extend our mental model.</p><p>Besides working on our copies of the original documents, we create additional copies of the copies and put them in boxes. Each box reflects a document change. To keep a log of changes, each box links to the previous box.</p><p>It looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eteF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eteF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 424w, https://substackcdn.com/image/fetch/$s_!eteF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 848w, https://substackcdn.com/image/fetch/$s_!eteF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 1272w, https://substackcdn.com/image/fetch/$s_!eteF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eteF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png" width="778" height="448" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/eea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:448,&quot;width&quot;:778,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!eteF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 424w, https://substackcdn.com/image/fetch/$s_!eteF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 848w, https://substackcdn.com/image/fetch/$s_!eteF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.png 1272w, https://substackcdn.com/image/fetch/$s_!eteF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feea0e83e-d9ec-4feb-bdff-cfec991a0f23_778x448.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>Those boxes are uniquely labelled. As you may have read in the book, Git creates so-called hashes of documents (you&#8217;ll find hashes everywhere in Git). A hash is a string of symbols that is unique for any possible state of documents.</p><h3><strong>Sidenote: focus on information to fill the most important gaps, ignore the rest</strong></h3><p>You may want to dig deeper to understand how hashing works under the hood. Or not? That is another common stage of any learning process. The question is this: should I figure out the inner workings of hashes, or should I just accept that they work in some way and move on?</p><p>Your mental model can guide you here as well. At this point, knowing how hashes work won&#8217;t help you with your understanding of Git. It won&#8217;t increase the accuracy of your model at this stage (being a beginner). It is the wrong rabbit hole to go down. Instead, for the sake of simplicity, we accept this gap in our understanding.</p><p>Good mental models strive for simplicity by conveying just enough details that are required to reliably predict the behaviour of the thing you are investigating. Any additional information will slow down progress (more about this at the end).</p><h3><strong>Log a change - but when?</strong></h3><p>Back to Git. Another question remains: when do we take a snapshot? Could we store <em>every</em> change? That would create an insurmountable amount of data and not be feasible.</p><p>Instead, what seems practical is that the author decides when to store a snapshot. Only they know when changes have reached a meaningful state that should be preserved.</p><p>How does Git make that possible?</p><p>The <a href="https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F">same Pro Git chapter mentioned above</a> answers that question. The relevant paragraph is called &#8220;the three states&#8221;.</p><h3><strong>Three states</strong></h3><p>A file in a Git repository can have three different states: it is either &#8220;untracked&#8221;, &#8220;staged&#8221;, or &#8220;committed&#8221;. Untracked files (or modifications) are not recorded yet. When files are &#8220;staged&#8221;, that&#8217;s the moment when we intend to take a snapshot (but we haven&#8217;t registered the change yet). Committing files is the final step of storing the snapshot.</p><p>The three states:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hYsQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hYsQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 424w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 848w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 1272w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hYsQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png" width="614" height="508" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:508,&quot;width&quot;:614,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!hYsQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 424w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 848w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.png 1272w, https://substackcdn.com/image/fetch/$s_!hYsQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4981c0b5-a637-479e-8b30-6e332fe41fc8_614x508.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>Coming back to the question of when to take a snapshot, the answer is that it is up to the user to make that decision.</p><p>By the way, Git introduces three states, although two would have been sufficient (e.g. committed - or not committed). The intermediate staging step makes preparing a snapshot easier, as we can add or remove files and change our minds before creating the record.</p><h2><strong>Testing our model</strong></h2><p>We have developed a set of mental models that cover the basics of Git. It is time to test the usefulness of those models by asking ourselves if they can sufficiently explain how things work for our purposes.</p><h3><strong>Branching</strong></h3><p>What is a branch? The word is already evoking a mental model of a real tree, with its main trunk and branches diverging into new directions.</p><p>You can read in detail about Git branches <a href="https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell">in Pro Git</a>, but we can already explain how branches work in principle. As discussed above, &#8220;how Git creates a log of changes&#8221;, a branch is nothing other than a series of snapshots that is different from the main development flow. Internally, Git uses pointers to make that work, but all we need to understand now is that changes are stored as snapshots and that each snapshot has a unique label (hash) attached to it. If you want to know if two branches are the same, all you have to do is compare the hashes.</p><h3><strong>Git commands</strong></h3><p>We test our model by looking at basic Git commands that you will likely have encountered when you first learned about Git.</p><pre><code>git clone
git add
git commit 
git push
git pull
</code></pre><p>If you are new to Git, I recommend running <code>git COMMAND --help</code> and start reading through the first paragraphs to see if the explanation fits our mental models.</p><pre><code>git clone --help</code></pre><blockquote><p>Clones a repository into a newly-created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch &#8211;remotes), and creates and checks out an initial branch that is forked from the cloned repository&#8217;s currently active branch.</p></blockquote><p>We may not fully understand every detail, but the overall idea fits our distributed tables model of making copies and branches.</p><pre><code>git add --help</code></pre><blockquote><p>This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.</p></blockquote><p>We don&#8217;t know yet what an index is but can explain most of what is said here with the three stages model. And we learn that <code>git add</code> moves changes from &#8220;untracked&#8221; to &#8220;staged&#8221;.</p><pre><code>git commit --help</code></pre><blockquote><p>Create a new commit containing the current contents of the index and the given log message describing the changes.</p></blockquote><p>Same here, and now we can conclude that the &#8220;index&#8221; tracks changes that have been &#8220;staged&#8221;.</p><pre><code>git push --help</code></pre><blockquote><p>Updates remote refs using local refs, while sending objects necessary to complete the given refs.</p></blockquote><p>We don&#8217;t know what a ref is but &#8220;sending objects&#8221; fits our model where we bring our documents to the &#8220;origin&#8221; table and merge our changes.</p><pre><code>git pull --help</code></pre><blockquote><p>Incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for Git fetch followed by Git merge FETCH_HEAD.</p></blockquote><p>This does not fit our mental model. So far, we said that when we are ready with our work, we bring our changes to the &#8220;origin&#8221; table. But in reality, we &#8220;pull&#8221; changes down to us. <em>We found a gap in our model</em>. Coming back to <a href="https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F">Pro git - What is git?</a> we can now understand what is meant by <em>Nearly Every Operation Is Local</em>. If Git was new to you and you followed along with the steps of this article, I bet you have now a stronger understanding of what &#8220;everything is local&#8221; means compared to when you first time read about it.</p><h2><strong>&#8220;Real-life&#8221; testing</strong></h2><p>The ultimate test occurs when we apply our knowledge to real-life situations. Whenever Git does not behave as expected, we find out where we need to improve the model.</p><h2><strong>Polish &amp; refine</strong></h2><p>As mentioned in the <a href="https://softwarementalmodels.com/p/software-mental-models">introduction post</a>, building mental models is a four-step process:</p><ol><li><p><strong>Define</strong> your model. We all use some kind of model, whether we are aware of it or not.</p></li><li><p><strong>Test</strong> your model. Either by researching or in real-life situations.</p></li><li><p><strong>Improve</strong> your model. Take what you have learned in 2) and improve it. Then test again.</p></li><li><p><strong>Simplify or go deeper</strong>. There will come a moment when steps 2) and 3) won&#8217;t bring any further improvements or when the model does not go deep enough because you have advanced in your understanding and tackling bigger challenges. You may be at a point where you can significantly simplify the model or build a new one.</p></li></ol><p>We have not yet exhausted steps 2) and 3), but we can still simplify our model. The table metaphor has gaps and is not that useful (but it helped to develop the model of snapshots).</p><p>Instead, the model of snapshots and the three file states together seem to be a good first mental model of Git.</p><h3><strong>The final Git mental model</strong></h3><p><em>Log of hashes &amp; three states</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_!nv6m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nv6m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 424w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 848w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 1272w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nv6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png" width="1080" height="686" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:686,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!nv6m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 424w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 848w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.png 1272w, https://substackcdn.com/image/fetch/$s_!nv6m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F52cf76c0-c8dc-4be5-adda-482b1834ff4d_1080x686.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><strong>Every committed change in Git is stored as a snapshot and referenced by a unique hash.</strong> A log of changes is represented by a log of hashes. To compare two branches, all we need to do is compare the hashes to know if they are the same or not.</p></li><li><p><strong>All files go through three possible states.</strong></p></li></ul><h2><strong>Summary</strong></h2><p>While developing an understanding of how Git works, we have gone through the process of constructing mental models. The key takeaways are the following:</p><p><strong>Always build your mental model first</strong>. Before you start reading a book or tutorial, sit down and visualise how you believe that the thing you are interested in works. That will make your subsequent research a lot more efficient, as you have a base that guides your reading and a place where you can place new information and relate it to existing knowledge. Remember the last time you read a book without any preparation. You may have highlighted sentences and written some notes in the margins - but how much of that information could you actually remember?</p><p><strong>Test and refine your model</strong>. That step is easy to forget, especially when it comes to improving your mental model. When you hit a plateau in your learning effort, that is the moment where you need to go back to your model and work out where the gaps are.</p><p><strong>Just enough information.</strong> Good mental models are simple, some even elegant, and they convey just enough information to be useful.</p><p><strong>The goal is not 100% correctness</strong>. A model is always an approximation and depends on your context and level of understanding. Don&#8217;t try to cram everything in it. Instead, figure out what are the most important facts of something. That exercise itself is very valuable to master a skill.</p><h2><strong>Next</strong></h2><p>With the model at hand, we can now go and apply it to our daily work.</p><p>A good idea might be to look at your <code>.git</code> folder and try to figure out what is going on there. That will give you a deeper understanding of the internals (the relevant chapter in Pro Git is <a href="https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain">Git Internals Plumbing and Porcelain</a>).</p><p>Or even better, don&#8217;t do anything and just use Git and wait until you hit a bump. That is the beauty of learning with mental models. There is no fixed path that you have to follow - real-life situations will show you where you need to improve.</p><p>I will come back to Git in a follow-up post and apply the model to more advanced situations, showcasing examples of where our model is sufficient and where it is not.</p>]]></content:encoded></item><item><title><![CDATA[Mental Models for Software Engineers]]></title><description><![CDATA[Or any knowledge worker]]></description><link>https://engineeringknowledge.blog/p/software-mental-models</link><guid isPermaLink="false">https://engineeringknowledge.blog/p/software-mental-models</guid><dc:creator><![CDATA[Bernhard Wenzel]]></dc:creator><pubDate>Thu, 19 Aug 2021 16:12:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RkHH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RkHH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RkHH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RkHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146942,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RkHH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RkHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F396bfc7f-662a-425b-8d4a-8ca1db217249_1500x844.jpeg 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>Software engineering is a rapidly evolving industry, putting developers in a perpetual state of having to learn new things while doing their actual job. This is a daunting task, not only because a full-time job leaves little room for training and catching up on the latest changes in tech, but also for the reason that it is becoming increasingly more difficult to decide what and how to learn. </p><p>For example, when faced with an engineering problem, the following questions may pop up in a developer's mind:</p><ul><li><p>Should I search the internet for a quick answer, hoping to find a copy-and-pasteable solution to my problem? This may or may not work. Often it leads to fruitless attempts and wasted hours.</p></li><li><p>Or should I better take out that textbook and try to understand the fundamental ideas? But books are long - where do I start? Maybe a shorter video is a better use of my time?</p></li><li><p>Or is it time to get more practical experience instead of indulging in theory and picking up a tutorial or working on a proof-of-concept? </p></li><li><p>Why do I seem to have hit a plateau in my understanding and what is required for me to move ahead?</p></li><li><p>Why do others appear to grasp things faster while I struggle to get my head around this problem?</p></li></ul><p>As we can all testify, the issue is not that there isn't enough information to solve a problem. It is the opposite: how can I make sure I invest time in the right activity to learn as efficiently as possible?</p><p>I believe there is an answer to all those questions and that it is possible to be confident about what and how to learn. The answer can be found by paying close attention to how we learn. </p><p>What does it mean to understand something? Understanding is related to knowledge. The deeper my understanding goes, the more "complete" my knowledge. Gaps in knowledge, on the other hand, are causing a lack of understanding. So when is my understanding "complete"? </p><p>I offer the following definition: </p><blockquote><p><strong>My understanding is complete if my knowledge about something is sufficient enough so that I can reliably predict future behaviour</strong></p></blockquote><p>The ability to <em>reliably predict</em> the behavior of the thing or process I'm interested in determines my level of understanding. The fewer surprises I encounter, the more I can explain behavior and the deeper my understanding.</p><p>However, all this depends on the purpose of what I'm doing and how deep I need to look into something.</p><p>For example, I don't need to understand how bits are moved on a chip to program a website that runs on a standard server. Knowing about hardware would not increase my ability to predict the behavior of my code. However, move away from a traditional operating system to specialized hardware, and the situation changes. Now my knowledge is <em>not sufficient anymore</em> to reliably predict the result of my work.</p><p>If our goal is to continuously widen our understanding over time the accuracy of our prediction would look similar to the following graph:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dRo_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dRo_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 424w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 848w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 1272w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dRo_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png" width="1428" height="982" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:982,&quot;width&quot;:1428,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:133202,&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_!dRo_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 424w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 848w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.png 1272w, https://substackcdn.com/image/fetch/$s_!dRo_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9953c849-5e7d-43ad-9535-0c4e66ecad33_1428x982.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><em>Prediction accuracy over time</em>. Our understanding grows until we hit a plateau. To overcome it, we need to switch the context and go deeper into the subject. This might require extending our mental model or creating a new one, which will, in the beginning, cause the accuracy of our predictions to decrease, but once the improved model gets more accurate, our overall understanding becomes wider.</p><p>To avoid any gaps, why don't we learn everything there is about computers? Because we can't. Grey matter memory is limited. We would never get past all there is to know about hardware before we could even start figuring out how to program something.</p><p>That is true for almost everything else. Reality is by far too complex for the human brain to absorb completely. Instead, the brain creates a <em>simplified inner model</em> of the outer world that we use to reason about reality.  Models help us to reduce complexity so we can spend our "brain power" on other things. The more accurate our models are, the fewer unexpected events we encounter in our daily life. </p><p>Mental models can go far and explain complex processes. Take, for example, the model of "supply and demand" <a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, which in simple terms, describes how the cost of goods changes over time. More demand with the same supply will increase the price; more supply with less or the same demand decreases the price. This mental model has become so natural to us that talking about it seems trivial, but if I wanted to describe the economics of, let's say, hardware chips going from research to production to sales, I would need to dive into far more complex processes than mere supply and demand - yet the model is good enough to predict many use cases. </p><p>The first takeaway is that <strong>we use mental models for all of our thinking</strong>. </p><p>Unfortunately, models can be inaccurate or wrong. If we learn something new, our model is likely to be incorrect. That is fine as long as we continuously improve the model. The problem is that often we are not aware that we are using a model, even less so a wrong one. Having an inner image is so intrinsic that we don't realize that this image exists and that it might be wrong.</p><p>The second takeaway is that <strong>often, we are not aware that we use models at all, and worse, that we use wrong models</strong>. </p><h2>Mental models are a "power" tool for efficient learning</h2><p>A mental model is a tool that enhances our ability to think. As a physical tool enhances the human body's abilities (e.g. a bicycle amplifies the ability of my legs), mental tools extend brainpower. </p><p>What makes a good mental model? It is concise and ideally elegant so that it significantly simplifies the outer world without losing accuracy. The simpler the model, the easier it is for us to absorb it and make it our own. </p><p>The model enables us to make predictions. If I can simplify a model while the accuracy of my predictions stays the same, the simpler model is better.</p><p>But finding a good model is only the first step. When moving through the stages from beginner to expert, the changing purpose and context will make the best model inaccurate ("All models are wrong, but some are useful" <a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>). What matters more than the model itself is the <em>ability to improve any model</em>. </p><p>Taking an existing good mental model alone won't be sufficient. We can't just "copy-and-paste" the image into our brain and hope to gain understanding immediately. We still have to find meaning and have to "make it our own" (what I mean by that exactly is subject to another post). I believe improving the model requires deliberate practice and that having an accurate model can make learning vastly more efficient.</p><p>What would such a "practice" look like? The steps are something like the following:</p><p>1. <strong>Define</strong>. Be aware that you are using a model and make it visible. That can happen through writing, drawing diagrams, or teaching others. You have to express the model so you can actively measure and alter it.</p><p>2. <strong>Test</strong>. Find out where your model is wrong or not detailed enough. Do you encounter behavior that you can't explain? Has something unexpected happened? Those are the places that need work.</p><p>3. <strong>Improve</strong>. Increase the accuracy of the model. You have multiple options for doing that, depending on experience (are you a beginner or expert?), availability of resources, and how good the model is - more about this below. </p><p>4. <strong>Simplify or go deeper</strong>. Now that your model is primarily accurate, try simplifying it as much as possible. You can significantly increase leverage and deepen your understanding. Can you find a more elegant explanation? What parts of your model are essential, and which are superfluous? If you have reached a point where you can't make more gains, it is time to widen or go deeper. Switch the context.</p><h2>How to learn efficiently and with confidence</h2><p>With this in mind, we can answer the questions from above and solve the dilemma of how to best make use of the little we have available for learning.</p><p>If your model is mostly off, copy-and-paste answers from the internet will do little to improve understanding and likely cause more problems along the way. Instead, it is time to sit down and do step 2) from above: express your model and make it visible. Then learn the fundamentals (grab a book, watch a video, do an online course) and improve your model until you get to a stage where you can broadly explain behavior and make accurate predictions. </p><p>If you have done the above but still have not advanced much in your understanding, the next step is to get practical experience. Most likely, you need both: theory and practice. During your phase of gathering theoretical knowledge, you build your model. During practice, you test it with real-life situations. </p><p>If your model seems about right but has minor gaps, then look for quick answers. You will have a map where you can place the answer and are able to tweak your model.</p><p>If you feel you have hit a plateau and don't advance in your understanding while others seem to have a deeper grasp of things, you need to change the context of your challenge and go deeper. You likely need to create a new, more sophisticated model or come up with several related ones. Think like a scientist. Observe reality, make assumptions (which means formulate a model), and then run experiments to prove or disprove your model. Rinse and repeat. </p><p>If your model seems accurate but feels that you are generally slow and need to look up things often, then, and only then, is it time to memorize knowledge. This is the right time to, for example, learn the details of your Git CLI. Those commands that you keep forgetting. This requires practice. You may even use techniques like <a href="https://en.wikipedia.org/wiki/Spaced_repetition">spaced repetition</a> with flashcards (which can be helpful in any stage to deepen your internal models).  </p><h2>Mental models are overlooked in software engineering.</h2><p>In software engineering, we lack good mental models. I see the reason for that in the fact that programming is an inherently practical exercise. Feedback loops are usually short - this is what makes programming such a satisfying experience. However, it can lead to a "just try things out until it works"-mentality without having gained a deeper understanding of how things work under the hood. </p><p>Also, as mentioned before, there is so much to learn that we simply don't have the time to look deeper. So we skip understanding the fundamentals. But this behavior is short-sighted because, in the long term, we become much faster and more productive once we have built a solid foundation of our knowledge.</p><p>The final takeaway is I'm convinced that <strong>having crisp mental models is by far the most significant leverage for becoming an efficient learner (and knowledge worker/software engineer)</strong>. It lets you know where the gaps in your understanding are and what you need to do next. You can see what is essential and what is not. You can look beyond details and see the big picture, relieving you from the need to "cram" knowledge and rely on short-term memory. </p><p>For this reason, I created this site with the following two goals: </p><ul><li><p>describe mental models about selected subjects in software engineering (and related areas)</p></li></ul><ul><li><p>and, more importantly, explore and investigate how to develop and improve mental models in general</p></li></ul><p>I consider the second goal more valuable than the first (because knowing the model alone won't get you far, but if you can develop and improve your own models, you don't necessarily need an external model - though a good starting point can undoubtedly accelerate learning). Because of that, even though I mostly talk about mental models that occur in software engineering (because that is my day job), I do hope that anyone will benefit from this series.</p><p>Please subscribe if you want to keep up-to-date - or reach out if you'd like to share your thoughts.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://engineeringknowledge.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://engineeringknowledge.blog/subscribe?"><span>Subscribe now</span></a></p><p><em>(*) Photo by <a href="https://unsplash.com/@d_mccullough?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Daniel McCullough</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>Mental model of Supply and Demand <a href="https://fs.blog/2009/07/mental-model-supply-and-demand">https://fs.blog/2009/07/mental-model-supply-and-demand</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>&#8220;All models are wrong&#8221; <a href="https://en.wikipedia.org/wiki/All_models_are_wrong">https://en.wikipedia.org/wiki/All_models_are_wrong</a></p></div></div>]]></content:encoded></item></channel></rss>