<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Steven Atkinson Tech Blog</title><description>Explore tech, programming, and effective work. Stay updated, optimise productivity, and thrive in the digital era.</description><link>https://www.mrstebo.co.uk/</link><language>en-gb</language><image><url>https://www.mrstebo.co.uk/favicon-192.png</url><title>Steven Atkinson Tech Blog</title><link>https://www.mrstebo.co.uk</link></image><item><title>Leaving Ghost: Rebuilding My Blog with Astro</title><link>https://www.mrstebo.co.uk/leaving-ghost-for-astro/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/leaving-ghost-for-astro/</guid><description>I swapped a Ghost subscription I was barely using for a static Astro site of my own, hosted on AWS. Here&apos;s what inspired it, how I broke the old blog down into blocks, and how 131 posts made the move without breaking a single link.</description><pubDate>Sat, 21 Nov 2026 09:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/leaving-ghost-for-astro.CWsyNVpe_Z1BL2SW.jpg&quot; alt=&quot;A faded ghost with a crossed-out £9/month price tag, and blog posts flying along a dotted trail into a glowing browser window showing the new mrstebo.co.uk&quot; width=&quot;1200&quot; height=&quot;630&quot;&gt;&lt;/p&gt;
&lt;p&gt;I have a confession to make. For the last few years I&amp;#39;ve been paying for a blogging platform and using about a fifth of it.&lt;/p&gt;
&lt;p&gt;This blog ran on &lt;a href=&quot;https://ghost.org&quot; rel=&quot;noopener&quot;&gt;Ghost&lt;/a&gt;. It didn&amp;#39;t start there, though. My first posts went out on &lt;a href=&quot;https://medium.com&quot; rel=&quot;noopener&quot;&gt;Medium&lt;/a&gt;, which was free, but I wanted more flexibility over how my blog looked and worked than Medium gave me. So I moved to Ghost. And Ghost is great! It has memberships, paid subscriptions, newsletters, comments, a slick editor... and I really only used the editor 🙈 Everything else just sat there, quietly being paid for.&lt;/p&gt;
&lt;p&gt;I did have a few subscribers (hello, if that&amp;#39;s you 👋). But the more I used Ghost, the more it felt like a platform built for a different kind of writer: write posts to grow a list of subscribers, then upsell premium content to them. That&amp;#39;s never been my goal. I&amp;#39;m a serial over-sharer! If I&amp;#39;ve learned something, I want to put it out there for anyone who might find it useful, not lock it behind a paywall.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t a lot of money. Around &lt;strong&gt;£8-9 a month&lt;/strong&gt;. If I&amp;#39;m honest, that&amp;#39;s not the reason I moved. The reason is that I&amp;#39;d just done something very similar at work, and I couldn&amp;#39;t stop thinking about it.&lt;/p&gt;

&lt;h2 id=&quot;where-the-idea-came-from&quot;&gt;Where the idea came from&lt;/h2&gt;
&lt;p&gt;At &lt;a href=&quot;https://carefriends.co.uk&quot; rel=&quot;noopener&quot;&gt;Care Friends&lt;/a&gt; we recently moved our marketing website off WordPress. It had been looked after by a third party for years, and like most WordPress sites it came with an admin login, a database, PHP and a stack of plugins, all sitting on the internet waiting to be patched. After the run of PHP vulnerabilities this year (I wrote about &lt;a href=&quot;https://www.mrstebo.co.uk/php2shell-patching-without-panicking/&quot;&gt;patching PHP2Shell&lt;/a&gt; if you fancy reliving that), we decided the safest server-side code is the code you don&amp;#39;t run at all.&lt;/p&gt;
&lt;p&gt;So we rebuilt it with &lt;a href=&quot;https://astro.build&quot; rel=&quot;noopener&quot;&gt;Astro&lt;/a&gt;. Every page is built ahead of time into plain HTML and CSS. There&amp;#39;s no admin login to guess, no database behind the pages, and nothing to assemble when someone visits.&lt;/p&gt;
&lt;p&gt;The bit I loved most was how we got there. Rather than redesigning everything, we went through the old site and listed the patterns that kept repeating: big introductions, rows of stats, testimonials, questions and answers. Each one became a reusable &lt;strong&gt;block&lt;/strong&gt; with a single schema. That one schema drives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how the block is rendered,&lt;/li&gt;
&lt;li&gt;the form you fill in to edit it (in a little page builder that only runs locally), and&lt;/li&gt;
&lt;li&gt;the checks that stop a broken page from ever being built.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Halfway through that project I looked at my own blog and thought... &lt;em&gt;I could do this here too.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;in-the-spirit-of-learning&quot;&gt;In the spirit of learning&lt;/h2&gt;
&lt;p&gt;Could I have just kept paying the £8-9 and carried on writing? Absolutely. But if you&amp;#39;ve read &lt;a href=&quot;https://www.mrstebo.co.uk/about-me/&quot;&gt;my about page&lt;/a&gt; you&amp;#39;ll know I&amp;#39;m not happy unless I&amp;#39;m building something, or learning how to.&lt;/p&gt;
&lt;p&gt;And a blog is the perfect playground for that. It&amp;#39;s mine, nobody&amp;#39;s waiting on it, and if I break it... well, I&amp;#39;ll probably write a post about breaking it 😅&lt;/p&gt;
&lt;p&gt;The goal was simple:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Own it.&lt;/strong&gt; Every page is a file in a Git repository I control.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep it static.&lt;/strong&gt; Pre-built HTML, served from AWS, with nothing running on a server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep every URL.&lt;/strong&gt; Years of posts are linked from all over the place. None of those links were allowed to break.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make it fun.&lt;/strong&gt; If I was going to build my own blog, it was going to look like &lt;em&gt;my&lt;/em&gt; blog.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;breaking-the-old-blog-down&quot;&gt;Breaking the old blog down&lt;/h2&gt;
&lt;p&gt;Just like the Care Friends website, I started by taking the old site apart. Ghost was running the Casper theme, and between the theme and Ghost&amp;#39;s editor &amp;quot;cards&amp;quot;, everything on the site boiled down to a fairly short list:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;On Ghost&lt;/th&gt;
&lt;th&gt;On the new site&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;The home page header (logo, description, cover image)&lt;/td&gt;
&lt;td&gt;A &lt;strong&gt;hero&lt;/strong&gt; block&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The post feed&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Post cards&lt;/strong&gt;, with a big card for the newest post&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The post header (title, date, feature image)&lt;/td&gt;
&lt;td&gt;The same &lt;strong&gt;hero&lt;/strong&gt; block, with the date and tags underneath&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Paragraphs, headings, lists, quotes, code&lt;/td&gt;
&lt;td&gt;A &lt;strong&gt;rich text&lt;/strong&gt; block, written in Markdown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image and gallery cards&lt;/td&gt;
&lt;td&gt;An &lt;strong&gt;image&lt;/strong&gt; block&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;YouTube and Vimeo embeds&lt;/td&gt;
&lt;td&gt;A &lt;strong&gt;video&lt;/strong&gt; block that only loads the player when you press play&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Toggle cards&lt;/td&gt;
&lt;td&gt;An &lt;strong&gt;FAQ&lt;/strong&gt; block&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Callout and bookmark cards&lt;/td&gt;
&lt;td&gt;Styled HTML inside the rich text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Signup and member cards&lt;/td&gt;
&lt;td&gt;Gone! No more members 👋&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Nine block types cover every post I&amp;#39;ve ever written. Each one is a React component plus a &lt;a href=&quot;https://zod.dev&quot; rel=&quot;noopener&quot;&gt;Zod&lt;/a&gt; schema, and Astro turns them into plain HTML when the site is built. React never runs in your browser. The little JavaScript there is just adds polish (search, video players, page transitions and the fancy clouds, more on those in a minute), and everything still works without it.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how some of those pieces changed. The dashed yellow outline is the old version, the cyan one is the new one.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-home-page-hero.qnlRJdQA_1crvua.jpg&quot; alt=&quot;The Ghost home page header, with the MR.STEBO logo over an anime office, next to the new synthwave home page with my portrait, name and a setting sun&quot; width=&quot;1200&quot; height=&quot;391&quot;&gt;&lt;figcaption&gt;The home page: Ghost&amp;#39;s cover image and logo, versus the new synthwave hero&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-post-card.JxX3Nv6L_Zjw7MN.jpg&quot; alt=&quot;The same post shown as a card on the Ghost home page and on the new home page, with the new card using neon borders and a tag pill&quot; width=&quot;1200&quot; height=&quot;797&quot;&gt;&lt;figcaption&gt;Post cards: same content, now with glass panels, neon edges and a primary tag&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-post-header.DNvzNc2h_Z2vdl9A.jpg&quot; alt=&quot;The PHP2Shell post&apos;s header on Ghost and on the new site, where the title uses a magenta to cyan gradient and the feature image sits on a neon grid&quot; width=&quot;1200&quot; height=&quot;423&quot;&gt;&lt;figcaption&gt;Post headers: the feature image now sits on top of the synthwave grid&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The editor cards were the fiddliest part. Ghost stores each post as HTML with its own card markup, so the import (more on that below) had to recognise each card and turn it into something the new site understands. Callouts and bookmarks became simple styled HTML, and code blocks went through &lt;a href=&quot;https://shiki.style&quot; rel=&quot;noopener&quot;&gt;Shiki&lt;/a&gt; at build time with the &lt;code&gt;synthwave-84&lt;/code&gt; theme, so they&amp;#39;re highlighted without a single line of JavaScript in your browser.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-callout.Uy-odcA5_Z1tLiAE.jpg&quot; alt=&quot;A callout card about efficiency and cost-effectiveness on Ghost, next to the same callout on the new site with a glowing border&quot; width=&quot;1200&quot; height=&quot;296&quot;&gt;&lt;figcaption&gt;Callouts keep their emoji and colour, but get a little glow&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-bookmark-card.CJq_XoPa_ZmLsKT.jpg&quot; alt=&quot;A bookmark card linking to a Yuval Noah Harari article on Ghost, next to the new, simpler bookmark&quot; width=&quot;1200&quot; height=&quot;233&quot;&gt;&lt;figcaption&gt;Bookmarks: the thumbnail went, the hover glow arrived&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-code-block.BYlHEBK6_Z1FhmT9.jpg&quot; alt=&quot;A TypeScript code sample on Ghost, next to the new code block styled like a terminal window with three coloured dots and the language name&quot; width=&quot;1200&quot; height=&quot;218&quot;&gt;&lt;figcaption&gt;Code blocks are now little terminal windows, highlighted at build time&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;borrowing-from-the-day-job-the-other-one&quot;&gt;Borrowing from the day job (the other one)&lt;/h2&gt;
&lt;p&gt;I also run a consultancy on the side, and &lt;a href=&quot;https://stevenatkinson.consulting&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;stevenatkinson.consulting&lt;span class=&quot;sr-only&quot;&gt; (opens in a new tab)&lt;/span&gt;&lt;/a&gt; already has a look I like: a near-black background, magenta and cyan neon, Geist for the type and a few retro terminal touches. My blog&amp;#39;s feature images have been synthwave for years, so it felt like the two should finally look like they belong together.&lt;/p&gt;
&lt;p&gt;So I took the consultancy site&amp;#39;s palette as the starting point:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;css&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#D50&quot;&gt;:root&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  --bg&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; #0a0a0f&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  --primary&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; #ff00ff&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;   &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* magenta */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  --secondary&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; #00ffff&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* cyan */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  --accent&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; #ff2a6d&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;    &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* hot pink */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  --gradient&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; linear-gradient&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;45deg&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;--primary&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;--secondary&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And here&amp;#39;s where I had to catch myself. My first pass took the inspiration a little &lt;em&gt;too&lt;/em&gt; literally. There were &lt;code&gt;$ ls ./posts&lt;/code&gt; prompts above every heading, a &lt;code&gt;$ ssh mrstebo.co.uk&lt;/code&gt; header... it looked like a terminal that happened to have a blog in it, not a blog 🤦‍♂️&lt;/p&gt;
&lt;p&gt;So I dialled it back. The colours, the glows and the glass panels stayed, but the blog got its own identity: a glitching &lt;strong&gt;MRSTEBO&lt;/strong&gt; wordmark in the header (hover over it, I dare you), plain blog-style labels everywhere else, and enough of its own personality that you won&amp;#39;t think you&amp;#39;ve ended up on the consultancy site by mistake.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-vs-astro-footer.CPjGe1Dc_1OyL9i.jpg&quot; alt=&quot;The old Ghost footer with &apos;Powered by Ghost&apos;, next to the new footer with my name in gradient text, the navigation and social links&quot; width=&quot;1200&quot; height=&quot;218&quot;&gt;&lt;figcaption&gt;Even the footer got a bit of love&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;moving-131-posts-without-breaking-a-link&quot;&gt;Moving 131 posts without breaking a link&lt;/h2&gt;
&lt;p&gt;This was the part I was most nervous about. I&amp;#39;ve been writing here since 2019, and there were &lt;strong&gt;131 posts&lt;/strong&gt;, &lt;strong&gt;4 pages&lt;/strong&gt; and a &lt;em&gt;lot&lt;/em&gt; of tags.&lt;/p&gt;
&lt;p&gt;Ghost has a &lt;a href=&quot;https://ghost.org/docs/content-api/&quot; rel=&quot;noopener&quot;&gt;Content API&lt;/a&gt;, so I wrote an import script that pulls every post down and turns its HTML into blocks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;runs of normal content become rich text (HTML to Markdown, via &lt;a href=&quot;https://github.com/mixmark-io/turndown&quot; rel=&quot;noopener&quot;&gt;Turndown&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;image cards become image blocks, with the original image downloaded into the post&amp;#39;s folder,&lt;/li&gt;
&lt;li&gt;YouTube embeds become video blocks, toggle cards become FAQs, and so on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every post is checked against the same schema the build uses before it&amp;#39;s written to disk, so a broken import can&amp;#39;t sneak through.&lt;/p&gt;
&lt;p&gt;Two things surprised me:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The images.&lt;/strong&gt; The first full import downloaded &lt;strong&gt;1.1 GB&lt;/strong&gt; of PNGs. That&amp;#39;s... not something you want in a Git repo. Converting them to WebP (at most 2000px wide, which is the biggest size the site ever serves) brought it down to &lt;strong&gt;185 MB&lt;/strong&gt;, with no visible difference.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The file names.&lt;/strong&gt; Most of my feature images come from Midjourney, which names files after your prompt: &lt;code&gt;mrstebo_a_synthwave_image_showing_a_brain_with_data_flowing_.png&lt;/code&gt;. Lovely. So the import now strips that back to something a search engine might actually appreciate: &lt;code&gt;brain-with-data-flowing.webp&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And the links? I took every URL from Ghost&amp;#39;s sitemaps (&lt;strong&gt;346&lt;/strong&gt; of them) and checked each one against the new site. Posts are still at &lt;code&gt;/&amp;lt;slug&amp;gt;/&lt;/code&gt;, tags at &lt;code&gt;/tag/&amp;lt;tag&amp;gt;/&lt;/code&gt;, pages at &lt;code&gt;/page/2/&lt;/code&gt;. The handful that didn&amp;#39;t exist any more, like the old &lt;code&gt;/rss/&lt;/code&gt; feed and author pages, now redirect.&lt;/p&gt;

&lt;h2 id=&quot;hosting-it-for-pennies&quot;&gt;Hosting it (for pennies)&lt;/h2&gt;
&lt;p&gt;The whole site is a folder of static files, so it lives in &lt;strong&gt;Amazon S3&lt;/strong&gt; behind &lt;strong&gt;CloudFront&lt;/strong&gt;, deployed with &lt;a href=&quot;https://sst.dev&quot; rel=&quot;noopener&quot;&gt;SST v4&lt;/a&gt;, exactly like my other side projects. When I merge to &lt;code&gt;main&lt;/code&gt;, GitHub Actions builds the site and deploys it. No servers, no database, no admin login.&lt;/p&gt;
&lt;p&gt;A few other bits replaced things Ghost used to do for me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; uses &lt;a href=&quot;https://pagefind.app&quot; rel=&quot;noopener&quot;&gt;Pagefind&lt;/a&gt;, which builds a search index at the same time as the site. Press &lt;code&gt;⌘K&lt;/code&gt; (or &lt;code&gt;Ctrl K&lt;/code&gt;) and give it a go. There&amp;#39;s still no server involved: your browser only downloads the bits of the index it needs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Analytics&lt;/strong&gt; come from &lt;a href=&quot;https://posthog.com&quot; rel=&quot;noopener&quot;&gt;PostHog&lt;/a&gt;, set up so it doesn&amp;#39;t use cookies at all. So no cookie banner either.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RSS&lt;/strong&gt; still works, with the full content of each post, so feed readers don&amp;#39;t notice a thing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-fun-bits&quot;&gt;The fun bits&lt;/h2&gt;
&lt;p&gt;OK, I&amp;#39;ll admit it. Once the boring parts worked, I got a bit carried away 😁&lt;/p&gt;
&lt;p&gt;Go and look at the &lt;a href=&quot;https://www.mrstebo.co.uk/&quot;&gt;home page&lt;/a&gt;. The sun, the low-poly mountains and the neon grid are all CSS, with the grid scrolling towards you. The clouds, though, are a tiny &lt;strong&gt;fluid simulation&lt;/strong&gt; running on your graphics card. The air drifts on a gentle breeze, the clouds are smoke carried along by it, and if you move your mouse through them you&amp;#39;ll stir them up. Even my portrait gets in on the act, breathing out magenta and cyan smoke from its ring.&lt;/p&gt;
&lt;p&gt;It only runs on desktops, it pauses when you scroll away, and if your device asks for reduced motion it draws the clouds once and leaves them still. Is it necessary? Absolutely not. Did I learn a lot about fluid dynamics in shaders? Absolutely yes.&lt;/p&gt;

&lt;h2 id=&quot;the-gnarly-bits&quot;&gt;The gnarly bits...&lt;/h2&gt;
&lt;p&gt;Of course, it wasn&amp;#39;t all smoke and neon. The first time I deployed to production, GitHub Actions went red with this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;text&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;ServiceQuotaExceededException: Limit exceeded: Maximum size of the value in a key value pair&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A quota? For a static site? 🤔&lt;/p&gt;
&lt;p&gt;It turns out SST&amp;#39;s &lt;code&gt;StaticSite&lt;/code&gt; keeps its routing information in a &lt;a href=&quot;https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions.html&quot; rel=&quot;noopener&quot;&gt;CloudFront KeyValueStore&lt;/a&gt;, and one of those values lists every folder at the top of the built site. Keeping every Ghost URL means every post gets its own folder at the top level (&lt;code&gt;/leaving-ghost-for-astro/&lt;/code&gt;, &lt;code&gt;/books-i-enjoyed-in-2024/&lt;/code&gt;...), plus every tag and every &lt;code&gt;/page/N/&lt;/code&gt;. That list came to a few kilobytes, and CloudFront caps a single value at &lt;strong&gt;1 KB&lt;/strong&gt;. Every new post would only make it worse.&lt;/p&gt;
&lt;p&gt;The list doesn&amp;#39;t really need to be there for a site like this one. SST&amp;#39;s edge router checks for top-level files first, and anything else just goes to S3 with &lt;code&gt;index.html&lt;/code&gt; on the end. A single catch-all &lt;code&gt;/&lt;/code&gt; route does exactly the same job, so a small &lt;code&gt;$transform&lt;/code&gt; in &lt;code&gt;sst.config.ts&lt;/code&gt; swaps the long list for that one route before it&amp;#39;s written:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ts&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;$transform&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;__pulumiType&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;pulumi-nodejs:dynamic:Resource&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;_opts&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startsWith&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;BlogKvKeys&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    args&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $util&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;output&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;apply&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Record&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; metadata&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; JSON&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      metadata&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;s3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;routes&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;/&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; JSON&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;stringify&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Every URL still works, and the value stays tiny however many posts I write. That&amp;#39;s the trade-off with owning the whole stack: there&amp;#39;s no Ghost support team to fix it for you, but you do get to learn something along the way.&lt;/p&gt;

&lt;h2 id=&quot;open-source&quot;&gt;Open source?&lt;/h2&gt;
&lt;p&gt;Could other people use this? Honestly... maybe! The block system, the builder, the Ghost import and the SST setup would make a nice starter for anyone wanting to leave Ghost (or WordPress) for something they own.&lt;/p&gt;
&lt;p&gt;But I also know myself. An open-source project needs someone to answer issues, review pull requests and keep dependencies up to date, and right now I don&amp;#39;t have the time to do that properly. So no promises. If it ever happens, you&amp;#39;ll read about it here first.&lt;/p&gt;

&lt;h2 id=&quot;whats-next&quot;&gt;What&amp;#39;s next&lt;/h2&gt;
&lt;p&gt;I&amp;#39;ve got a few more posts on the way that go deeper into how it all works:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;building new pages with the local page builder,&lt;/li&gt;
&lt;li&gt;creating a new block, from schema to component, and&lt;/li&gt;
&lt;li&gt;deploying it all to AWS with SST v4.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the meantime, have a wander around, stir up some clouds, and if you spot something broken... you know where to find me ☕&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Astro</category><category>AWS</category><category>Experiments</category><category>Software Architecture</category><category>Typescript</category></item><item><title>PHP2Shell: Patching Without Panicking</title><link>https://www.mrstebo.co.uk/php2shell-patching-without-panicking/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/php2shell-patching-without-panicking/</guid><description>There&apos;s a special kind of feeling you get when you read the words &quot;unauthenticated remote code execution&quot; next to the name of the language your whole platform is written in. It&apos;s not quite panic. It&apos;s more of a cold, slow &quot;...oh.&quot; 😬 That…</description><pubDate>Tue, 03 Nov 2026 08:30:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/php2shell-patching-without-panicking.D3R9ho8k_Z1a5EoB.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a special kind of feeling you get when you read the words &amp;quot;unauthenticated remote code execution&amp;quot; next to the name of the language your whole platform is written in.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not quite panic. It&amp;#39;s more of a cold, slow &amp;quot;...oh.&amp;quot; 😬&lt;/p&gt;
&lt;p&gt;That was me on the morning of 21st October, scrolling through Techzine with a brew that very quickly went cold. Two critical vulnerabilities in PHP. Not in a framework. Not in some dusty package nobody&amp;#39;s updated since 2019. In PHP itself.&lt;/p&gt;
&lt;p&gt;This is the story of how I went from reading that headline to running patched PHP, what I decided &lt;em&gt;not&lt;/em&gt; to do along the way, and the one thing that tripped me up right at the finish line.&lt;/p&gt;
&lt;h2 id=&quot;what-actually-happened&quot;&gt;What actually happened?&lt;/h2&gt;
&lt;p&gt;The two vulnerabilities are CVE-2026-109618 and CVE-2026-109619, and they&amp;#39;ve been nicknamed PHP2Shell. Which, as nicknames go, tells you everything you need to know 🙈&lt;/p&gt;
&lt;p&gt;Both scored &lt;strong&gt;9.2 out of 10&lt;/strong&gt; (Critical). Both let someone run code on your server without logging in.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/c7/1b/sev5pZZE.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;In plain English:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CVE-2026-109618&lt;/strong&gt; is about what happens when PHP runs out of memory mid-request. PHP bails out of the request, but some memory gets left in a state it shouldn&amp;#39;t be in. The clean-up code then trusts that memory... and an attacker can take advantage of that.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CVE-2026-109619&lt;/strong&gt; is a similar story. Some global state ends up pointing at memory that&amp;#39;s already been freed, and a later request can end up reading it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The bit that really got my attention was &lt;em&gt;where&lt;/em&gt; this happens. The attack surface is in how PHP parses the incoming request. That&amp;#39;s before Laravel boots. Before your middleware. Before your authentication, your validation, your rate limiting... any of it.&lt;/p&gt;
&lt;p&gt;You can write the most beautifully secure application code in the world, and it doesn&amp;#39;t matter, because the request never gets that far 🤷‍♂️&lt;/p&gt;
&lt;p&gt;To make the morning even better:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Details had leaked the day before, along with screenshots of an exploit tool claiming to work against PHP 5.4 and up.&lt;/li&gt;
&lt;li&gt;A leaked demo listed Laravel among the &amp;quot;tested&amp;quot; applications (alongside WordPress, Drupal, Magento and friends).&lt;/li&gt;
&lt;li&gt;Cloudflare was already reporting early attacks.&lt;/li&gt;
&lt;li&gt;The patch wasn&amp;#39;t due until 14:00 UTC that afternoon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, no pressure then 😅&lt;/p&gt;
&lt;h2 id=&quot;where-does-our-php-actually-come-from&quot;&gt;Where does our PHP actually come from?&lt;/h2&gt;
&lt;p&gt;Before deciding what to do, I needed to answer a question that sounds obvious but often isn&amp;#39;t: where is PHP running, and how does it get there?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy to say &amp;quot;we&amp;#39;re on PHP 8.4&amp;quot;. It&amp;#39;s harder to say exactly &lt;em&gt;which&lt;/em&gt; build of PHP 8.4, installed how, in which environments. So I went and looked properly.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/8b/97/mqmPOQ5s.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;308&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;For us, it boiled down to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Production and staging run on Northflank, across our UK and Australian regions.&lt;/li&gt;
&lt;li&gt;Every environment builds from the same Dockerfile, based on the official PHP image:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;dockerfile&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; php:8.4-fpm-alpine&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The web service and the worker service (queues and the scheduler) use the same image, just started differently.&lt;/li&gt;
&lt;li&gt;Local development and CI use PHP 8.4 too, but they&amp;#39;re not sat on the internet waiting for someone to poke them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That last point mattered for prioritising. Anything public-facing was the urgent bit. Everything else could be tidied up afterwards.&lt;/p&gt;
&lt;p&gt;It also told me the worker had to be patched as well. It&amp;#39;s not taking public traffic in the same way, but it&amp;#39;s running the exact same vulnerable PHP build. &amp;quot;It&amp;#39;s only the worker&amp;quot; is the kind of thing you say right before it isn&amp;#39;t only the worker 👀&lt;/p&gt;
&lt;h2 id=&quot;what-could-i-do-before-the-patch-landed&quot;&gt;What could I do before the patch landed?&lt;/h2&gt;
&lt;p&gt;There was a gap between reading about this in the morning and the patch arriving in the afternoon. So the natural question was: what can I do in the meantime?&lt;/p&gt;
&lt;p&gt;There was no shortage of suggestions flying around:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Block &lt;code&gt;multipart/form-data&lt;/code&gt; requests at the web server&lt;/li&gt;
&lt;li&gt;Turn off session upload progress and turn on strict session mode in &lt;code&gt;php.ini&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Lean on a WAF&lt;/li&gt;
&lt;li&gt;Take the site offline until it&amp;#39;s patched&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The nginx version of the first one is about as blunt as it gets:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;nginx&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ($&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;http_content_type&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ~* &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;multipart/form-data&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 403&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And here&amp;#39;s where I made a decision I want to be honest about: I didn&amp;#39;t do any of them.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/f87f46a2c5aeaeed4c68910815f73eaf/1c/d5/MpGJ1sYK.gif&quot; alt=&quot;&quot; width=&quot;275&quot; height=&quot;306&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Not because I was being lazy (I promise!). Because when I actually weighed them up, none of them were worth it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The patch window was short.&lt;/strong&gt; The fix was due within hours. Every stopgap was another change to make, test, deploy... and then remember to undo once the patch was in. That&amp;#39;s a lot of churn for a gap measured in hours, not weeks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The ini tweaks weren&amp;#39;t proven.&lt;/strong&gt; Some people were suggesting &lt;code&gt;php.ini&lt;/code&gt; changes, but people who actually work on PHP were saying the opposite. The line that stuck with me was that &amp;quot;the only mitigation is patching / upgrading PHP&amp;quot;. When the people closest to the code tell you a config tweak won&amp;#39;t save you, I&amp;#39;m inclined to believe them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Blocking requests would break things for real people.&lt;/strong&gt; Blocking multipart requests means blocking file uploads, and our platform relies on uploads in plenty of places. Taking the site offline is even worse. I&amp;#39;d essentially be doing the attacker&amp;#39;s job for them, just more politely 😅&lt;/p&gt;
&lt;p&gt;So the plan was simple. Wait for the patch, then get it out everywhere as quickly as possible.&lt;/p&gt;
&lt;h2 id=&quot;write-it-down&quot;&gt;Write it down&lt;/h2&gt;
&lt;p&gt;Before touching anything, I wrote it up for the team in our wiki.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/e5/ff/SdW0wWjp.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;That might sound like a strange thing to prioritise in the middle of a security scare. But when something like this happens, people want to know three things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are we affected?&lt;/li&gt;
&lt;li&gt;What are we doing about it?&lt;/li&gt;
&lt;li&gt;How will we know it&amp;#39;s done?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Having that in one place meant nobody had to piece it together from Slack messages. It also forced me to think through the steps properly, rather than make them up as I went along. And future-me will thank present-me the next time something like this happens (because there &lt;em&gt;will&lt;/em&gt; be a next time).&lt;/p&gt;
&lt;h2 id=&quot;the-patch-lands-sort-of&quot;&gt;The patch lands (sort of)&lt;/h2&gt;
&lt;p&gt;The PHP team released the fixes: 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Anyone on 8.1 or older? No official fix. Those versions are end of life. Which is a very good reason not to be on them 🙏&lt;/p&gt;
&lt;p&gt;For us, that meant PHP 8.4.27.&lt;/p&gt;
&lt;p&gt;But here&amp;#39;s the thing about relying on the official Docker image. PHP releasing a fix and the Docker image containing that fix are two different events. When I first checked, the 8.4.27 image simply didn&amp;#39;t exist on Docker Hub yet. So a rebuild at that point would have happily produced... the same vulnerable build I already had.&lt;/p&gt;
&lt;p&gt;This is where the floating tag helps. Because the Dockerfile uses &lt;code&gt;php:8.4-fpm-alpine&lt;/code&gt; rather than pinning an exact patch version, a fresh build picks up the latest 8.4 release once the image is published. No code change required.&lt;/p&gt;
&lt;p&gt;But &amp;quot;a fresh build&amp;quot; is doing a lot of heavy lifting in that sentence.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/fa/37/LHIxRS36N0jauMHAz.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h2 id=&quot;dont-let-the-cache-lie-to-you&quot;&gt;Don&amp;#39;t let the cache lie to you&lt;/h2&gt;
&lt;p&gt;Docker builds are cached in layers. That&amp;#39;s normally brilliant, because it&amp;#39;s why your builds don&amp;#39;t take forever. But the base image is a layer too.&lt;/p&gt;
&lt;p&gt;So if your build platform has a cached copy of &lt;code&gt;php:8.4-fpm-alpine&lt;/code&gt; from last week, a normal rebuild can quite happily reuse it. Even though the tag has moved on. Even though a patched image is sitting right there on Docker Hub. The build goes green, the deploy goes green, everything looks lovely... and you&amp;#39;re still running the vulnerable version 🥴&lt;/p&gt;
&lt;p&gt;So once the patched image was published, I cleared the build cache in Northflank before kicking off the build. That forces a fresh pull of the base image, so you actually get what you think you&amp;#39;re getting.&lt;/p&gt;
&lt;h2 id=&quot;the-bit-that-tripped-me-up&quot;&gt;The bit that tripped me up&lt;/h2&gt;
&lt;p&gt;You&amp;#39;d think that would be the end of it. Fresh cache, patched base image, hit build, done.&lt;/p&gt;
&lt;p&gt;Nope.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;Could not download from &amp;#34;https://pecl.php.net/get/redis-6.3.0.tgz&amp;#34;, cannot download &amp;#34;pecl/redis&amp;#34;
(File https://pecl.php.net:443/get/redis-6.3.0.tgz not valid (received: HTTP/1.1 500 Internal Server Error&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And the same again for excimer.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d6b0ce929193df3c242ac34b5654d2ce/4c/aa/3IqKDijz.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;272&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Our Dockerfile installs a couple of extensions from PECL (redis and excimer), and PECL was falling over. My first thought was &amp;quot;do these versions even exist?&amp;quot; So I checked. Both were there, both were the latest releases, and the release listings loaded instantly. It was only the downloads that were failing. Even the PECL homepage was timing out.&lt;/p&gt;
&lt;p&gt;My best guess? Every PHP shop on the planet was doing exactly what I was doing. Clearing their caches. Rebuilding their images. All at the same time. And a lot of those builds pull extensions from the same place 🙃&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a bit of a funny one when you think about it. Clearing the build cache was the right thing to do. But it also meant re-downloading everything, at the exact moment everyone else was too.&lt;/p&gt;
&lt;p&gt;The fix in the end was very unglamorous. I waited, retried, and it went through. Not exactly a heroic ending, but sometimes the right answer really is &amp;quot;give it a bit&amp;quot; ☕&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;So that was PHP2Shell, from my side of the fence. No drama in the end, but a few things I&amp;#39;m taking away from it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Know where your runtime comes from.&lt;/strong&gt; &amp;quot;We&amp;#39;re on PHP 8.4&amp;quot; isn&amp;#39;t enough. Which image? Which tag? Which environments? Which services? You want to be able to answer that in minutes, not hours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Patch everything that runs the code, not just the bit facing the internet.&lt;/strong&gt; If your workers use the same image, they need the same fix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stopgaps have a cost.&lt;/strong&gt; A mitigation that breaks things for your users, or one the experts say doesn&amp;#39;t work, isn&amp;#39;t free just because it feels like doing something. Sometimes the best move is to wait for the real fix and be ready to ship it fast.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build caches can lie.&lt;/strong&gt; A green build doesn&amp;#39;t mean you&amp;#39;re running the version you think you are. Clear the cache, and check what&amp;#39;s actually running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your build depends on more than your code.&lt;/strong&gt; In an emergency, the whole world is pulling from the same package servers you are. It&amp;#39;s worth knowing which external services your build needs, because that&amp;#39;s exactly when they&amp;#39;re most likely to struggle.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Write it down.&lt;/strong&gt; Even a short report for the team turns a stressful morning into a plan people can follow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And if you&amp;#39;re reading this and you&amp;#39;re still on PHP 8.1 or older... listen, now&amp;#39;s the time 👀&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/4e/6b/vD0eLMnA.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Security</category><category>Retrospective</category><category>PHP</category></item><item><title>Moving Care Friends from Azure to Northflank</title><link>https://www.mrstebo.co.uk/moving-care-friends-from-azure-to-northflank/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/moving-care-friends-from-azure-to-northflank/</guid><description>It’s Not You, Azure... Okay, It Was a Bit You I have a confession to make... The Care Friends portal has lived on Azure for years. It’s a Laravel app backed by MySQL, Redis and Horizon, running on App Service and a MySQL Flexible Server…</description><pubDate>Tue, 27 Oct 2026 08:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank.DsIUXTJY_1SdGz9.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;800&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It’s Not You, Azure... Okay, It Was a Bit You&lt;/em&gt;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/ce/fa/HX2thGbc.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;398&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;I have a confession to make...&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://carefriends.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Care Friends&lt;/a&gt; portal has lived on Azure for years. It’s a Laravel app backed by MySQL, Redis and Horizon, running on App Service and a MySQL Flexible Server, and for a long time it did the job just fine. But over the last couple of years a few things had started to bother me.&lt;/p&gt;
&lt;p&gt;UK staging had crept up to roughly &lt;strong&gt;10x&lt;/strong&gt; its original budget. Production MySQL would become unavailable during Azure’s maintenance windows. And a release took 20 to 30 minutes to get through the pipeline, so deploys mostly happened in the evening while I kept one eye on Sentry 👀&lt;/p&gt;
&lt;p&gt;So I moved the whole lot to &lt;a href=&quot;https://northflank.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Northflank&lt;/a&gt;. UK staging and production now run in London, Australian production runs in Melbourne, every environment is defined in a template in git, and deploys are rolling releases I’m happy to run in the middle of the day. I did the migration on my own, and that shaped a lot of the decisions you’ll read about below 😅&lt;/p&gt;
&lt;p&gt;I’ll be upfront about the bits that didn’t go to plan. There was downtime during the cutover, and Redis HA is still on the to-do list. This post covers what I did, what I nearly did instead, and what I’d tell another engineer who’s wondering whether a move like this is worth it.&lt;/p&gt;
&lt;h2 id=&quot;why-northflank-was-already-on-my-radar&quot;&gt;Why Northflank was already on my radar&lt;/h2&gt;
&lt;p&gt;I’d already used Northflank at &lt;a href=&quot;https://www.clock.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Clock&lt;/a&gt;, so this wasn’t a leap into the unknown.&lt;/p&gt;
&lt;p&gt;What I liked there was how little ceremony there was around infrastructure. You describe an environment once in a template (services, addons like MySQL and Redis, volumes and secrets) and Northflank builds it for you. If a service needs more memory, you change its compute plan. If you want scheduled database backups, you turn them on for the addon. None of that needs a separate infrastructure-as-code tool or a lot of clicking around a portal.&lt;/p&gt;
&lt;p&gt;When you’re the only person doing a migration, having shipped on a platform before counts for a lot more than a nice-looking pricing page 😅&lt;/p&gt;
&lt;p&gt;Cost and resilience were the obvious reasons to move, but there was another goal I cared about just as much. When the tech team grows, I want someone new to be able to understand how Care Friends is put together without me walking them through it. And I definitely don’t want them having to reverse-engineer how code gets into production.&lt;/p&gt;
&lt;p&gt;On Azure, that knowledge was spread across App Service config, a Functions app, the Container Registry, the MySQL Flexible Server and a long deploy YAML. The path I wanted was much simpler: &lt;strong&gt;tag a commit, get it approved, and let Northflank release it.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;looking-at-the-options-yes-including-aws&quot;&gt;Looking at the options (yes, including AWS)&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-1.D7Txakow_Zeppr.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;505&quot;&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t go straight to Northflank. In early 2025 I wrote up a proper cost and options review, with our Azure setup as the baseline and three alternatives alongside it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AWS&lt;/strong&gt;, in the usual flavours. &lt;a href=&quot;https://bref.sh/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Bref&lt;/a&gt; for serverless PHP on Lambda, ECS for containers, and the ones everyone ends up evaluating (EKS and Elastic Beanstalk)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloudflare&lt;/strong&gt;, for CDN, edge caching and Workers. Useful in front of the app, but not somewhere I&amp;#39;d want to run a full Laravel portal with Horizon workers and a shared file volume&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Northflank&lt;/strong&gt;, as a container platform with templates and built-in CD&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Bref was interesting, but running Laravel on Lambda means rethinking queues, scheduled tasks, file storage and long-running Horizon workers. That&amp;#39;s a lot of application change to sign up for in the middle of a hosting move. ECS and EKS can run pretty much anything, but you&amp;#39;re then responsible for the cluster, the networking, the deploy tooling and the upgrades. That&amp;#39;s a fair trade for a team with a platform engineer. It isn&amp;#39;t a great one when the platform engineer is also the person writing the features 😅&lt;/p&gt;
&lt;p&gt;So the question I kept coming back to wasn&amp;#39;t &amp;quot;what&amp;#39;s the cheapest option on paper?&amp;quot; It was &lt;strong&gt;what can I migrate, run and explain to the next hire on my own?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Northflank came out as the recommendation. But that didn&amp;#39;t mean it was ready to go just yet...&lt;/p&gt;
&lt;h2 id=&quot;to-byoc-or-not-to-byoc&quot;&gt;To BYOC or not to BYOC...&lt;/h2&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/3b/97/C5XYzHPk.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;In May 2025 I put together a concrete migration proposal. The UK side was straightforward, because it could run on Northflank&amp;#39;s managed cloud in London. Australia was the problem. Northflank didn&amp;#39;t have a region there yet, so the plan for AUS was &lt;strong&gt;Bring Your Own Cloud (BYOC)&lt;/strong&gt;: Northflank&amp;#39;s control plane running workloads on a Kubernetes cluster we owned, either Azure AKS or AWS EKS in Sydney.&lt;/p&gt;
&lt;p&gt;That would have worked. But it would also have meant that Australia was a Kubernetes cluster I had to look after (node pools, cluster version upgrades, networking, and the cloud bill that comes with it) while the UK ran fully managed. Two regions, two ways of running the same app, and one person to keep both of them healthy.&lt;/p&gt;
&lt;p&gt;Seeing it drawn out on a diagram is what really made it click for me. I could already picture myself debugging a node pool late at night just because it was the Australian one 🙈&lt;/p&gt;
&lt;p&gt;Then Northflank launched a &lt;a href=&quot;https://northflank.com/changelog/reduced-network-pricing-and-introduced-melbourne-and-tokyo?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Melbourne region&lt;/a&gt; 💪&lt;/p&gt;
&lt;p&gt;The December 2025 proposal dropped BYOC completely. UK and AUS are both on Northflank&amp;#39;s managed cloud, built from the same kind of template, deployed the same way. If something behaves differently in one region, it&amp;#39;s down to config, not because the two regions run on different platforms.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-2.DW8GjY-4_2css7m.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;455&quot;&gt;&lt;/p&gt;
&lt;p&gt;Sometimes sitting on a plan for a few months has its benefits 😆&lt;/p&gt;
&lt;h2 id=&quot;fixing-the-app-before-moving-it&quot;&gt;Fixing the app before moving it 🔥&lt;/h2&gt;
&lt;p&gt;Before I touched any hosting, there were two problems in the app itself that needed sorting. Moving them to a new platform would just have meant debugging them somewhere less familiar.&lt;/p&gt;
&lt;h3 id=&quot;mysql-at-100-cpu&quot;&gt;MySQL at 100% CPU&lt;/h3&gt;
&lt;p&gt;The database would regularly hit &lt;strong&gt;100% CPU&lt;/strong&gt;, and not on any predictable schedule. When it did, it wasn&amp;#39;t just the notifications page that slowed down. Logins, the dashboard and other critical paths all suffered, because they were all waiting on the same MySQL instance.&lt;/p&gt;
&lt;p&gt;The cause was the notifications management screen. From a user&amp;#39;s point of view it&amp;#39;s a fairly simple page, but behind it were N+1 queries, heavy queries against the notification history, and an export that loaded the entire dataset rather than chunking through it. If you&amp;#39;ve read &lt;a href=&quot;https://www.mrstebo.co.uk/are-you-accidentally-killing-your-database/&quot;&gt;Are You Accidentally Killing Your Database?&lt;/a&gt; you&amp;#39;ll recognise the pattern.&lt;/p&gt;
&lt;p&gt;I rewrote the worst queries, disabled the export path until it could be done properly, and CPU went back to normal levels. No amount of extra vCPU on a new platform would have fixed that.&lt;/p&gt;
&lt;h3 id=&quot;optimising-notifications-broke-redis&quot;&gt;Optimising notifications broke Redis 🙈&lt;/h3&gt;
&lt;p&gt;Of course it couldn&amp;#39;t be that simple.&lt;/p&gt;
&lt;p&gt;My first attempt at improving scheduled notifications was a fan-out pipeline. A scheduled command dispatched a job per customer, and each of those dispatched a job per user. It caused a &lt;strong&gt;slight issue&lt;/strong&gt;. Redis ran out of memory.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/80/c1/CQbWirJ2.gif&quot; alt=&quot;&quot; width=&quot;250&quot; height=&quot;140&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;You know that moment when you see &lt;code&gt;OOM command not allowed when used memory &amp;gt; &amp;#39;maxmemory&amp;#39;&lt;/code&gt; in Sentry?&lt;/p&gt;
&lt;p&gt;Yeah. That one.&lt;/p&gt;
&lt;p&gt;The root cause was that one Redis instance was doing three jobs: &lt;strong&gt;cache, queue and Horizon&lt;/strong&gt;. The fan-out produced jobs faster than the workers could process them, so the queue lists kept growing. Azure Cache for Redis was using the &lt;code&gt;volatile-lru&lt;/code&gt; eviction policy, and that policy only evicts keys that have a TTL set. Queue lists don&amp;#39;t have a TTL, and neither does a lot of Horizon&amp;#39;s metadata. So once memory hit &lt;code&gt;maxmemory&lt;/code&gt;, Redis had almost nothing it was allowed to evict, and writes started failing.&lt;/p&gt;
&lt;p&gt;The obvious fix is to buy a bigger Redis. But that only hides the fact that the app is producing far more data than it needs to. So instead I:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Produced fewer jobs in the hot path, batching users rather than dispatching one job each&lt;/li&gt;
&lt;li&gt;Tightened Horizon&amp;#39;s &lt;code&gt;trim&lt;/code&gt; settings in &lt;code&gt;config/horizon.php&lt;/code&gt;, so completed and recent job metadata expires sooner&lt;/li&gt;
&lt;li&gt;Switched to a few coarse tags instead of tagging every job with a user ID, since Horizon stores data per tag&lt;/li&gt;
&lt;li&gt;Stopped dispatching another job from inside an already-busy job when doing the work synchronously was fine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This paid off later too. Because the app had stopped flooding Redis, I could keep the Redis addon on a small plan on Northflank, and even step it down further when I right-sized after go-live.&lt;/p&gt;
&lt;h2 id=&quot;why-northflank-won&quot;&gt;Why Northflank won&lt;/h2&gt;
&lt;p&gt;By the time the no-BYOC proposal was ready, this is what it looked like against the goals I&amp;#39;d set:&lt;/p&gt;
&lt;table style=&quot;min-width: 96px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;min-width: 48px;&quot;&gt;&lt;col style=&quot;min-width: 48px;&quot;&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Goal&lt;/p&gt;&lt;/th&gt;&lt;th colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;What Northflank gave me&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Cost&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;About &lt;strong&gt;36%&lt;/strong&gt; lower than our Nov 2025 Azure bill at go-live&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Australia&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Melbourne on the managed cloud, no BYOC&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Resilience&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;MySQL InnoDB Cluster HA on production (3 replicas)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Operations&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Templates in git under &lt;code spellcheck=&quot;false&quot; autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot;&gt;infra/&lt;/code&gt;, so environments are code&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Path to production&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Tag, approve, run a Northflank release workflow&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Environments&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Resources grouped into release stages (staging and production)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Deploy speed&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;&lt;strong&gt;20 to 30 minutes&lt;/strong&gt; down to &lt;strong&gt;just under 5&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Deploy culture&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Rolling deploys instead of waiting until Sunday night&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Staging is where the difference was most obvious. UK staging on Azure had grown to roughly &lt;strong&gt;10x&lt;/strong&gt; its original budget (😬). Northflank staging still costs more than that original figure, but it&amp;#39;s about &lt;strong&gt;74%&lt;/strong&gt; cheaper than what we&amp;#39;d drifted into on Azure.&lt;/p&gt;
&lt;p&gt;Across all three environments, Northflank came in about &lt;strong&gt;36%&lt;/strong&gt; below the Nov 2025 Azure total at go-live. After right-sizing in September, another &lt;strong&gt;9%&lt;/strong&gt; came off that, which puts us about &lt;strong&gt;42%&lt;/strong&gt; below Azure overall.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-3.CfBIiFBZ_Z26M8am.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;392&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;mapping-azure-to-northflank&quot;&gt;Mapping Azure to Northflank&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s how each piece of the old setup maps across:&lt;/p&gt;
&lt;table style=&quot;min-width: 96px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;min-width: 48px;&quot;&gt;&lt;col style=&quot;min-width: 48px;&quot;&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Azure&lt;/p&gt;&lt;/th&gt;&lt;th colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Northflank&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;App Service (web)&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Deployment service (&lt;code spellcheck=&quot;false&quot; autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot;&gt;APP_TYPE=web&lt;/code&gt;)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Functions / worker host&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Deployment service (&lt;code spellcheck=&quot;false&quot; autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot;&gt;APP_TYPE=worker&lt;/code&gt; running Horizon)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Merge webhook Azure Function&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;A Laravel route on the web service&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;MySQL Flexible Server&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;MySQL addon (HA on production)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Azure Cache for Redis&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Redis addon (single replica, more on that below)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Azure Files share&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Shared volume (ReadWriteMany)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Container Registry&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Northflank build service&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Front Door&lt;/p&gt;&lt;/td&gt;&lt;td colspan=&quot;1&quot; rowspan=&quot;1&quot;&gt;&lt;p&gt;Northflank load balancer with automatic TLS&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;The web and worker services run the same image, and &lt;code&gt;APP_TYPE&lt;/code&gt; decides whether the container starts PHP-FPM for web traffic or runs Horizon. One build, two services.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.merge.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Merge&lt;/a&gt; webhook used to live in its own Azure Function, originally because handling it synchronously inside Laravel was too slow. By the time of the migration the noisy parts of the app (notifications especially) had been sorted, so I moved it into a normal Laravel route. That&amp;#39;s one less Function app to deploy, monitor and keep in sync.&lt;/p&gt;
&lt;h2 id=&quot;risks-i-accepted-on-purpose&quot;&gt;Risks I accepted (on purpose) ⏳&lt;/h2&gt;
&lt;p&gt;I tried to be honest with myself about the trade-offs before starting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DNS and cutover.&lt;/strong&gt; Lower the TTLs in Cloudflare ahead of time, plan the record changes, and keep a rollback path&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data integrity.&lt;/strong&gt; Backups, checksums, and dry runs on staging before touching production&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance surprises.&lt;/strong&gt; Fix the known problems in the app first, and load-test what I could&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Redis HA.&lt;/strong&gt; I had connectivity issues with the HA Redis setup during the migration, so we went live on a single Redis replica. It&amp;#39;s monitored and has been stable, but it isn&amp;#39;t where I want it long term&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Downtime for the data move.&lt;/strong&gt; More on that below&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One thing that caught me out more than once: on Northflank, options like MySQL HA and Redis Sentinel are set when the addon is created. You can&amp;#39;t switch them on later, so it&amp;#39;s worth deciding up front.&lt;/p&gt;
&lt;h3 id=&quot;choosing-planned-downtime&quot;&gt;Choosing planned downtime&lt;/h3&gt;
&lt;p&gt;The earlier proposals described a nicer approach. Replicate from Azure MySQL into Northflank, check the data, promote the replica, and keep downtime to a minimum.&lt;/p&gt;
&lt;p&gt;What I actually did was much more traditional: &lt;strong&gt;maintenance mode, backup, restore, storage sync, DNS switch.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The replica approach means setting up replication across two providers, monitoring replication lag, and then switching over at exactly the right moment. All while syncing a file volume full of real customer uploads, for two regions, on my own. That&amp;#39;s a lot of moving parts. With backup and restore I knew how long each step took from the staging dry runs, I could write the whole thing down as a checklist, and if anything went wrong I could point DNS back at Azure.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t zero-downtime, and I&amp;#39;m not going to pretend otherwise. But for a cutover with one person running it, I&amp;#39;d make the same call again.&lt;/p&gt;
&lt;h2 id=&quot;the-cutover-runbook&quot;&gt;The cutover runbook&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-4.rd-wJgvn_Z1cGxF7.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;682&quot;&gt;&lt;/p&gt;
&lt;p&gt;Both regions followed the same checklist. The only real differences between UK and AUS were the domain names and which Azure storage account the files came from.&lt;/p&gt;
&lt;h3 id=&quot;prep&quot;&gt;Prep&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Deploy the intended production release to the Northflank build service before cutover night&lt;/li&gt;
&lt;li&gt;Dry-run every script against staging&lt;/li&gt;
&lt;li&gt;Apply the GitOps template (&lt;code&gt;infra/northflank-*.json&lt;/code&gt;): web, worker, MySQL, Redis, shared volume and secrets&lt;/li&gt;
&lt;li&gt;Optionally scale web down and the worker to zero while testing the restore, so nothing writes to the new database&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;GET /up&lt;/code&gt; returns a 200 on the Northflank default domain&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;moving-the-data&quot;&gt;Moving the data&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Do a full sync of the Azure file share with &lt;code&gt;azcopy&lt;/code&gt; into a local mirror, then pack it up&lt;/li&gt;
&lt;li&gt;Dump MySQL from Azure and compress it with zstd:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;mysqldump&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --single-transaction&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --routines&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --triggers&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --events&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;  --set-gtid-purged=OFF&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ...&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; zstd&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; portal.sql.zst&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Restore into the Northflank MySQL addon&lt;/li&gt;
&lt;li&gt;Upload and extract the storage archive onto the shared volume&lt;/li&gt;
&lt;li&gt;Check the Passport OAuth keys made it onto the volume. They&amp;#39;re easy to forget, and nobody can log in without them&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;--single-transaction&lt;/code&gt; gives a consistent snapshot of InnoDB tables without locking them, and &lt;code&gt;--set-gtid-purged=OFF&lt;/code&gt; stops the dump from carrying Azure&amp;#39;s GTID state into the new cluster.&lt;/p&gt;
&lt;h3 id=&quot;cutover&quot;&gt;Cutover&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Put the environment into maintenance mode on Azure&lt;/li&gt;
&lt;li&gt;Run a final delta sync of storage and upload the changes&lt;/li&gt;
&lt;li&gt;Stop the Azure App Service and MySQL server so nothing can write to the old database&lt;/li&gt;
&lt;li&gt;Create the custom domains on Northflank&lt;/li&gt;
&lt;li&gt;Point Cloudflare at Northflank, check TLS, and purge the cache&lt;/li&gt;
&lt;li&gt;Update the template to scale web back up (with autoscaling), attach the domains, and redeploy web and worker&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;verify-before-celebrating&quot;&gt;Verify before celebrating&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Log in to the portal&lt;/li&gt;
&lt;li&gt;Dispatch a test notification job with sync turned off and check Horizon picks it up&lt;/li&gt;
&lt;li&gt;Check worker health, the scheduler, a microsite subdomain, Sentry, files on the shared volume and Redis&lt;/li&gt;
&lt;li&gt;Lift maintenance mode&lt;/li&gt;
&lt;li&gt;Watch the metrics and Sentry for a day or two before even thinking about turning Azure off&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;rollback&quot;&gt;Rollback&lt;/h3&gt;
&lt;p&gt;Point Cloudflare back at Azure, start App Service and MySQL again, scale Northflank down and purge the cache. We didn&amp;#39;t need it, but having it written down meant I slept a lot better the night before 😴&lt;/p&gt;
&lt;h2 id=&quot;what-it-looks-like-now&quot;&gt;What it looks like now&lt;/h2&gt;
&lt;p&gt;There are three environments across two Northflank projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;UK staging&lt;/strong&gt; and &lt;strong&gt;UK production&lt;/strong&gt; in &lt;code&gt;eu-west-portal&lt;/code&gt; (London)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AUS production&lt;/strong&gt; in &lt;code&gt;aus-southeast-portal&lt;/code&gt; (Melbourne)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each environment has a web service, a worker service, MySQL, Redis and a shared volume. Production web autoscales, production MySQL runs as an HA cluster, and Redis is the single replica I mentioned earlier.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-5.Co9eE8VD_2olxm3.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;733&quot;&gt;&lt;figcaption&gt;What it looks like now&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The Northflank feature I&amp;#39;ve grown to like most is &lt;strong&gt;release stages&lt;/strong&gt;. UK staging and UK production live in the same project as separate stages, and AUS is its own project. Everything an environment needs (web, worker, MySQL, Redis, volume, secrets and the release workflow) is attached to its stage.&lt;/p&gt;
&lt;p&gt;So if someone asks &amp;quot;what is production?&amp;quot;, the answer is one stage in the UI and one template in the repo. On Azure the answer involved App Service, a Functions app, ACR, a Flexible Server, and a few resource groups I don&amp;#39;t remember creating 🤔&lt;/p&gt;
&lt;p&gt;Having the templates in the repo is probably my favourite part. Changing an environment is a pull request, not a session of clicking around a dashboard. The next person to join the team can read exactly what production is made of.&lt;/p&gt;
&lt;h2 id=&quot;how-code-reaches-production&quot;&gt;How code reaches production&lt;/h2&gt;
&lt;p&gt;This was one of the main design goals, not something I sorted out at the end.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Push. Azure Pipelines runs lint, PHPStan and the tests&lt;/li&gt;
&lt;li&gt;Tag a release for production&lt;/li&gt;
&lt;li&gt;Approve it through the Azure DevOps environment gate&lt;/li&gt;
&lt;li&gt;Azure Pipelines &lt;strong&gt;triggers a Northflank release workflow&lt;/strong&gt; and waits for it to finish&lt;/li&gt;
&lt;li&gt;Northflank builds the image and rolls it out to web and worker&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Staging can deploy automatically from a successful build. Production always waits for a person to approve it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/moving-care-friends-from-azure-to-northflank-6.DWdcGpYg_Z1YVwey.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;429&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;release-stages-and-release-workflows&quot;&gt;Release stages and release workflows&lt;/h3&gt;
&lt;p&gt;On Azure, all the deploy logic lived in the pipeline. Build a Docker image, push it to ACR, tell App Service to pull it, then hope the startup script behaved. It worked, but it took &lt;strong&gt;20 to 30 minutes&lt;/strong&gt; end to end, and the pipeline was doing a lot of work that really belonged to the hosting platform.&lt;/p&gt;
&lt;p&gt;On Northflank, the &lt;strong&gt;release workflow&lt;/strong&gt; owns the deploy. In the UK production template it looks roughly like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create (or sync) a &lt;strong&gt;Release Stage&lt;/strong&gt; called &amp;quot;Production UK&amp;quot;&lt;/li&gt;
&lt;li&gt;Attach the services, addons, volume and secrets to that stage&lt;/li&gt;
&lt;li&gt;Define a &lt;strong&gt;Production Release&lt;/strong&gt; workflow that:&lt;ul&gt;
&lt;li&gt;builds from the git SHA (with &lt;code&gt;reuseExistingBuilds: true&lt;/code&gt; so it skips the build if that SHA has already been built)&lt;/li&gt;
&lt;li&gt;releases that build to the &lt;strong&gt;web&lt;/strong&gt; service&lt;/li&gt;
&lt;li&gt;releases the same build to the &lt;strong&gt;worker&lt;/strong&gt; service&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Expose the workflow through a &lt;strong&gt;webhook trigger&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Production has &lt;code&gt;autorun: false&lt;/code&gt;, so nothing reaches production without someone deliberately triggering it. Staging has autorun switched on.&lt;/p&gt;
&lt;h3 id=&quot;azure-pipelines-just-triggers-the-release&quot;&gt;Azure Pipelines just triggers the release&lt;/h3&gt;
&lt;p&gt;Azure DevOps still does the parts it&amp;#39;s good at for us: CI, approvals, and a small deploy job. That deploy job calls Northflank, then polls until the workflow finishes.&lt;/p&gt;
&lt;p&gt;The job template passes parameters into a shared step:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;yaml&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# pipelines/jobs/deploy-northflank.yml (shape of it)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; environment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankWorkflowId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankProjectId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankReleaseWebhookUrl&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;deployment&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; deploy_app_to_${{ parameters.environment }}_northflank&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    displayName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; Deploy App to ${{ parameters.environment }} (Northflank)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    environment&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.environment }}&lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;   # ADO approval gate lives here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    strategy&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      runOnce&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;        deploy&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;          steps&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;            - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ../steps/trigger-northflank-release.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;              parameters&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                northflankWorkflowId&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankWorkflowId }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                northflankProjectId&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankProjectId }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                northflankReleaseWebhookUrl&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankReleaseWebhookUrl }}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The step is parameterised too, so the same YAML works for every environment. The API token, webhook URL and project and workflow IDs all come from Azure DevOps, so the repo only contains the shape of the call:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;yaml&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# pipelines/steps/trigger-northflank-release.yml (abbreviated)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankWorkflowId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankProjectId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankReleaseWebhookUrl&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; string&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankPollIntervalSeconds&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; number&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    default&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 30&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; northflankTimeoutMinutes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    type&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; number&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    default&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 90&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;steps&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;task&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; Bash@3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    displayName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; Trigger and wait for Northflank workflow&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    env&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      WEBHOOK_URL&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankReleaseWebhookUrl }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      PROJECT_ID&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankProjectId }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      WORKFLOW_ID&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankWorkflowId }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      API_TOKEN&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; $(NORTHFLANK_API_TOKEN)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      SOURCE_BRANCH&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; $(Build.SourceBranch)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      SHA&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; $(Build.SourceVersion)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      BUILD_NUMBER&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; $(Build.BuildNumber)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      POLL_INTERVAL_SECONDS&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankPollIntervalSeconds }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      TIMEOUT_MINUTES&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.northflankTimeoutMinutes }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    inputs&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      targetType&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; inline&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      script&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        # 1) POST branch + SHA to the Northflank release webhook&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        # 2) name the run ado-&amp;#x3C;build-number&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        # 3) poll GET .../workflows/$WORKFLOW_ID/runs/$RUN_ID until concluded&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        # 4) fail the pipeline if status != success&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#39;s all there is to it. Northflank builds the image in the same place it runs it, and Azure DevOps waits long enough to fail the pipeline if the release fails. Naming each run &lt;code&gt;ado-&amp;lt;build-number&amp;gt;&lt;/code&gt; also means you can match a Northflank run back to the pipeline that started it.&lt;/p&gt;
&lt;h3 id=&quot;from-20-to-30-minutes-to-just-under-5&quot;&gt;From 20 to 30 minutes to just under 5 ⚡&lt;/h3&gt;
&lt;p&gt;This one still makes me grin.&lt;/p&gt;
&lt;p&gt;The old path was: Azure Pipelines builds the Docker image, pushes it to ACR, App Service pulls it and restarts, Laravel runs its startup steps, and you watch the logs. &lt;strong&gt;20 to 30 minutes&lt;/strong&gt; was normal.&lt;/p&gt;
&lt;p&gt;The new path: CI has already proved the commit, so the Northflank workflow builds the image (or reuses an existing build) and does a rolling deploy of web and worker. &lt;strong&gt;Just under 5 minutes&lt;/strong&gt; is normal now.&lt;/p&gt;
&lt;h3 id=&quot;shipping-during-the-day&quot;&gt;Shipping during the day 🚀&lt;/h3&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/86/4a/Eo9Gjjm3.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;344&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;This is the change I&amp;#39;m happiest about, even more than the cost savings.&lt;/p&gt;
&lt;p&gt;On Azure there was a real reluctance to deploy during the day. If something went wrong it could take out a chunk of the working day, so releases drifted into evenings and weekends.&lt;/p&gt;
&lt;p&gt;With rolling deploys, new containers start up and only receive traffic once they&amp;#39;re healthy, and then the old ones are drained. Combined with a release that takes around five minutes, I can now ship &lt;strong&gt;several times a day&lt;/strong&gt; without users noticing. I&amp;#39;ve deployed while someone was demoing the platform, and nobody noticed.&lt;/p&gt;
&lt;p&gt;To be clear, that&amp;#39;s about day-to-day deploys after go-live. The migration itself had a maintenance window, as I covered above 🙏&lt;/p&gt;
&lt;h2 id=&quot;right-sizing-a-few-months-later&quot;&gt;Right-sizing a few months later&lt;/h2&gt;
&lt;p&gt;The sizing at go-live was mostly an educated guess. After a few months of real metrics, I trimmed the things that clearly had room to spare:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;UK web&lt;/strong&gt; kept the same vCPU but dropped some memory. Bot traffic still pushes CPU up even during quiet periods, so CPU stayed where it was&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AUS web and worker&lt;/strong&gt; both moved to smaller plans&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Redis&lt;/strong&gt; stepped down a plan, which was only safe because of the fan-out and Horizon work earlier&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL HA&lt;/strong&gt; stayed exactly as it was. It&amp;#39;s still the biggest part of the bill, and for good reason&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That took about another &lt;strong&gt;9%&lt;/strong&gt; off the June Northflank baseline.&lt;/p&gt;
&lt;p&gt;Because the environments are templates, each of those changes was a pull request. I can see what changed and when, and roll it back if the graphs say I went too far. The plan is to keep doing this: watch the metrics, trim what isn&amp;#39;t needed, and repeat.&lt;/p&gt;
&lt;h2 id=&quot;lets-wrap-this-up&quot;&gt;Let&amp;#39;s wrap this up&lt;/h2&gt;
&lt;p&gt;I didn&amp;#39;t leave Azure because Azure is bad. For this portal, with one engineer looking after it, Northflank was simply a better fit. It&amp;#39;s cheaper even with HA MySQL included, every environment is a template in the repo, Australia didn&amp;#39;t need its own Kubernetes cluster, and I&amp;#39;m happy to deploy while people are using the product.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t perfect. Redis HA is still on the list, the cutover had downtime, and staging still costs more than the budget it started with years ago (although it&amp;#39;s a fraction of what it had become on Azure).&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re thinking about a similar move, here&amp;#39;s what I&amp;#39;d pass on:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fix the problems in your app first.&lt;/strong&gt; A new platform won&amp;#39;t fix MySQL pinned at 100% CPU or a fan-out that fills Redis&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use a platform you&amp;#39;ve already shipped on if you can.&lt;/strong&gt; It removes a lot of unknowns when you&amp;#39;re doing this alone&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check regional availability early.&lt;/strong&gt; Running BYOC in one region and managed in another is a very different job from fully managed everywhere&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Planned downtime is a valid choice.&lt;/strong&gt; Backup and restore you&amp;#39;ve rehearsed beats a clever replication plan you haven&amp;#39;t&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design for the team you want to have.&lt;/strong&gt; Someone new should be able to read the architecture in an afternoon, and getting to production should be tag and approve&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Let the platform own deployment.&lt;/strong&gt; Our pipeline&amp;#39;s deploy job now just triggers Northflank and waits&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Find out why Redis is full before buying a bigger one.&lt;/strong&gt; Then right-size based on what the graphs actually show&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measure more than cost.&lt;/strong&gt; Being able to deploy during the day changed how we work more than any of the savings did&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Would I do it again? Yes, including the boring bits. Especially fixing notifications before I touched DNS.&lt;/p&gt;
&lt;p&gt;I hope the messy middle of this has been more useful than a neat success story. And I look forward to hearing how your own migrations went 👋&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Architecture</category><category>Retrospective</category></item><item><title>Made with Flash (NOT!)</title><link>https://www.mrstebo.co.uk/made-with-flash-not/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/made-with-flash-not/</guid><description>Do you remember Flash websites? I&apos;m talking about the promotional websites for games. You&apos;d type in the address, wait for the loading bar to crawl its way to 100%, and then...you didn&apos;t just land on a homepage. You went through something…</description><pubDate>Wed, 14 Oct 2026 07:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/made-with-flash-not.OQCcJL_Y_Z23TBWI.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Do you remember Flash websites? I&amp;#39;m talking about the promotional websites for games.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/ab/d8/WbWklxb0.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;250&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;You&amp;#39;d type in the address, wait for the loading bar to crawl its way to 100%, and then...you didn&amp;#39;t just land on a homepage. You went &lt;strong&gt;through&lt;/strong&gt; something. A demonic gate would creak open. The camera would swoop down into a castle. Some ominous music would kick in that you definitely couldn&amp;#39;t turn off.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It was a mini cutscene before you&amp;#39;d even clicked anything!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These sites were built to feel as close to the thing they represented as possible. The buttons looked like they&amp;#39;d been pulled straight out of the game&amp;#39;s menus. The backgrounds were the game&amp;#39;s actual environments. Sometimes your cursor was a sword. You weren&amp;#39;t reading about the game...you were already halfway inside it.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/f1/87/DjJNEIXCdN7EArh2.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And it wasn&amp;#39;t just the big studios doing it either. I want to give a massive shout-out to everyone who built their own little corner of the internet on &lt;strong&gt;Geocities&lt;/strong&gt; and &lt;strong&gt;Freewebs&lt;/strong&gt;. The fan sites, the guild pages, the &amp;quot;Welcome to my homepage!&amp;quot; pages with an under construction sign that never came down 🚧&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/16/9a/uU4fpPIe.gif&quot; alt=&quot;&quot; width=&quot;424&quot; height=&quot;264&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And then there was &lt;strong&gt;Myspace&lt;/strong&gt;. You didn&amp;#39;t need to be a web developer to have a website that said &lt;em&gt;who you were&lt;/em&gt;. You just needed a sparkly background, a song that autoplayed the second someone landed on your page, and a Top 8 that caused far more drama than it should have 😅&lt;/p&gt;
&lt;p&gt;None of it was &amp;quot;best practice&amp;quot;. Half of it was copied and pasted from somewhere else. &lt;strong&gt;But every single page had personality.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/made-with-flash-not-1.Ba5l7wNT_2ofgSY.jpg&quot; alt=&quot;&quot; width=&quot;860&quot; height=&quot;563&quot;&gt;&lt;/p&gt;
&lt;p&gt;Eventually the web grew up. We got responsive layouts, accessibility, performance budgets...all good things! But somewhere along the way, a lot of websites started to look a bit...samey.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/3e/72/nco17nlb.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;247&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;So I set myself a little experiment. I wanted to build a website for a band, &lt;a href=&quot;https://aionosband.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Aionos&lt;/a&gt;, whose songs are all about the age of gods. And I wanted it to feel like stepping into that world. Titans, realms, skies that change as you move between them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But not as crazy.&lt;/strong&gt; No four minute loading bars. No music blasting at you the second the page opens. And definitely no hunting around for a hidden &amp;quot;Enter&amp;quot; button 🙈&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Made with Flash? Not quite. But I wanted it to feel like it was.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;familiar-territory&quot;&gt;Familiar territory&lt;/h2&gt;
&lt;p&gt;Before we get into the shiny stuff, let me take you back a bit. Way back to my early days of programming 👴&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/39f2394ae36df6e199be9eb7c9fa1012/a0/e7/dTVfmCLp.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;270&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;I was teaching myself C++ using the &lt;a href=&quot;https://www.codeblocks.org/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Code::Blocks&lt;/strong&gt; IDE&lt;/a&gt;. And like anyone learning a new language, I didn&amp;#39;t start by reading the documentation cover to cover. I found the most interesting looking examples I could and pulled them apart to see how they worked.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s how I found &lt;a href=&quot;https://openframeworks.cc/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;openFrameworks&lt;/a&gt;. It&amp;#39;s an open source C++ toolkit for creative coding, and it came with a &lt;strong&gt;lot&lt;/strong&gt; of examples. Particles, sound, video, 3D...it was like being handed a box of toys 🙌&lt;/p&gt;
&lt;p&gt;The one that hooked me was a fluid simulation.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/8ce8357c78ea940b9c2015daf05ce1a5/cf/c8/V4BqsYMp.gif&quot; alt=&quot;&quot; width=&quot;255&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;figcaption&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;It looked just like this ☝️&lt;/span&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Under the hood it was built on the &lt;a href=&quot;https://en.wikipedia.org/wiki/Navier%E2%80%93Stokes_equations?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Navier-Stokes equations&lt;/a&gt;, which describe how fluids like water and smoke move. Now listen...I&amp;#39;m not going to pretend I understood every bit of the maths. These equations are so tricky that proving certain things about them is one of the Millennium Prize Problems, with a million dollars up for grabs if you can crack it...&lt;a href=&quot;https://openai.com/index/navier-stokes-solution/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;which apparently OpenAI has&lt;/a&gt; (with a bit of underlying drama!).&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/8ce8357c78ea940b9c2015daf05ce1a5/58/ab/oPSeikmF.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;241&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;But that wasn&amp;#39;t really the point. What I &lt;em&gt;did&lt;/em&gt; learn was how to think like a graphics programmer. Every openFrameworks app had the same three building blocks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;setup()&lt;/code&gt; to get everything ready&lt;/li&gt;
&lt;li&gt;&lt;code&gt;update()&lt;/code&gt; to move things along a tiny bit&lt;/li&gt;
&lt;li&gt;&lt;code&gt;draw()&lt;/code&gt; to paint the result to the screen&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And then it does that again. And again. Dozens of times a second. Under the hood it was all OpenGL, pushing pixels around the screen as fast as it could.&lt;/p&gt;
&lt;p&gt;Fast forward to today, and guess what the canvas asks you to do? Grab a graphics context, work out what&amp;#39;s changed, draw the frame, and ask the browser for another one with &lt;code&gt;requestAnimationFrame&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/95/88/9AXQyye3g9bMWKn.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;So when I picked up the canvas for Aionos, it didn&amp;#39;t feel like learning something new. It felt like I already knew what to do...&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-first-idea-put-html-inside-the-canvas&quot;&gt;The first idea: put HTML inside the canvas!&lt;/h2&gt;
&lt;p&gt;Now, when I first sat down to plan this, my brain went straight to the most exciting (and least necessary) idea possible 🤓&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What if I could put real HTML inputs inside the canvas?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Picture it. A text box carved into a stone tablet. A button glowing inside a temple wall. All drawn into the scene, but still a proper, working form underneath.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/fa/b2/fEu5C706.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Listen...normally that&amp;#39;s a big no. A &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; is just a bitmap. You draw pixels on it, and that&amp;#39;s it. Anything you put &lt;em&gt;inside&lt;/em&gt; the &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; tag is treated as fallback content, which basically means it&amp;#39;s invisible unless the browser can&amp;#39;t render the canvas at all.&lt;/p&gt;
&lt;p&gt;So if you wanted a &amp;quot;form&amp;quot; in your canvas, you either had to draw a fake one yourself (and handle the typing, the cursor, the focus...all of it 😩), or float a real HTML element over the top and hope it lined up.&lt;/p&gt;
&lt;h3 id=&quot;enter-html-in-canvas&quot;&gt;Enter HTML-in-Canvas&lt;/h3&gt;
&lt;p&gt;There&amp;#39;s a proposal from the WICG called &lt;a href=&quot;https://github.com/WICG/html-in-canvas?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;HTML-in-Canvas&lt;/a&gt; that changes all of that. It lets you take real, styled DOM elements and draw them straight into a 2D, WebGL or WebGPU canvas. And because they&amp;#39;re still real elements, they&amp;#39;re still accessible, you can still tab into them, and the browser still does all the hard work of laying out the text.&lt;/p&gt;
&lt;p&gt;The main pieces are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An attribute on the &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;&lt;/strong&gt; that tells the browser &amp;quot;lay out my children, don&amp;#39;t just treat them as fallback&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;**drawElementImage()**&lt;/code&gt;, which draws one of those children into the canvas, a bit like &lt;code&gt;drawImage()&lt;/code&gt; but for HTML&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;paint&lt;/code&gt; event&lt;/strong&gt;, which fires whenever one of those children changes, so you know when to redraw&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;you-want-to-see-some-code&quot;&gt;You want to see some code?&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;html&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;canvas&quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; content&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;drawable&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;form&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; drawable&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;tablet&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; for&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;Speak your name, mortal:&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;form&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; ctx&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getContext&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;2d&apos;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  canvas&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;onpaint&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; = () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    ctx&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;reset&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    ctx&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;drawElementImage&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;tablet&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;  };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#39;s a real &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;. You can click into it, type in it, and it shows up &lt;em&gt;inside&lt;/em&gt; the canvas, ready to have shaders and effects thrown at it 🔥&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/e8/c3/yAWEWAnv.gif&quot; alt=&quot;&quot; width=&quot;480&quot; height=&quot;360&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;the-catch&quot;&gt;The catch&lt;/h3&gt;
&lt;p&gt;It&amp;#39;s still very much an experiment. Right now you&amp;#39;ll need Chrome Canary or Brave, and you have to switch on a flag by pasting this into your address bar:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;chrome://flags/#canvas-draw-element&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to see what it can really do, &lt;a href=&quot;https://html-in-canvas.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;html-in-canvas.dev&lt;/a&gt; has a gallery of demos, including HTML rendered onto surfaces in a 3D room and live forms running underneath shaders. It&amp;#39;s well worth a poke around 👀&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I was sold. I just needed a reason to use it...&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;ambition-vs-reality&quot;&gt;Ambition vs reality&lt;/h2&gt;
&lt;p&gt;...turns out I didn&amp;#39;t have one 😅&lt;/p&gt;
&lt;p&gt;That didn&amp;#39;t stop me trying though. I had a few goes at shoehorning HTML-in-Canvas into the site, and every time I ended up asking myself the same question: &lt;em&gt;what is this input actually for?&lt;/em&gt;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/65/71/CpMOZ1NL.gif&quot; alt=&quot;&quot; width=&quot;412&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;It&amp;#39;s a band website. People come to listen to the music, find out when the next gig is, and maybe read a bit about the band. There&amp;#39;s no login. There&amp;#39;s no search. There isn&amp;#39;t a form crying out to be carved into a stone tablet.&lt;/p&gt;
&lt;p&gt;And then there&amp;#39;s the bigger problem. &lt;strong&gt;Nobody visiting the site has the flag switched on!&lt;/strong&gt; Building the main experience on an API that only works in Chrome Canary (after a trip to the flags page) is a great way to make a website that nobody can actually see 🙈&lt;/p&gt;
&lt;p&gt;Oh, and the API was moving while I was playing with it. The explainer on GitHub now uses &lt;code&gt;content=&amp;quot;drawable&amp;quot;&lt;/code&gt; on the canvas, while some of the examples floating around still use a &lt;code&gt;layoutsubtree&lt;/code&gt; attribute. That&amp;#39;s not a complaint (it&amp;#39;s an experiment, that&amp;#39;s the whole point), but it&amp;#39;s another reason not to build your house on it just yet.&lt;/p&gt;
&lt;h3 id=&quot;but-wait-theres-more&quot;&gt;But wait, there&amp;#39;s more!&lt;/h3&gt;
&lt;p&gt;HTML-in-Canvas wasn&amp;#39;t the only shiny thing I got distracted by.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The hall.&lt;/strong&gt; I had this idea of the visitor walking through a great hall, with an animated character strolling along like a side-scrolling platformer. You&amp;#39;d scroll, they&amp;#39;d walk, and the different sections of the site would be rooms you passed through on the way.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/made-with-flash-not-2.el2GfEIT_1HYD8g.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;643&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The 3D.&lt;/strong&gt; Then I started playing with &lt;a href=&quot;https://threejs.org/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Three.js&lt;/a&gt; to build interactive 3D elements. Spinning relics, floating temples, things you could grab and move around...&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/made-with-flash-not-3.Ch8B1JJW_1ok6td.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;772&quot;&gt;&lt;/p&gt;
&lt;p&gt;All of it was fun. None of it was finished. And every one of them added a whole new set of problems on top of the problem I actually had, which was: &lt;strong&gt;make a band site that feels like stepping into another world.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;start-simple-right&quot;&gt;Start simple, right?!&lt;/h3&gt;
&lt;p&gt;So I took a step back. Instead of trying to build an entire game, I asked myself what the smallest thing was that would make the site &lt;em&gt;feel&lt;/em&gt; immersive.&lt;/p&gt;
&lt;p&gt;The answer was the sky.&lt;/p&gt;
&lt;p&gt;If the sky behind everything could shift and change as you moved between realms, then the whole site would feel like a journey without me having to build a single walking animation. Get that right first, learn from it, and then build on top of it.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/5a/c1/4BwqnsB0LFku7.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;279&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h2 id=&quot;learning-something-new&quot;&gt;Learning something new&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s a confession. Before Aionos, I had &lt;strong&gt;never&lt;/strong&gt; written a shader 😬&lt;/p&gt;
&lt;p&gt;I&amp;#39;d used them plenty of times without realising (pretty much every game I&amp;#39;ve ever played is full of them), but actually writing one? Nope. So of course I decided the very first one I&amp;#39;d write would power the entire background of the website. Across five different realms. Blending into each other.&lt;/p&gt;
&lt;p&gt;Start simple, I said...&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/cfb42878805dcb270f51b28683e7455a/11/f3/j8i0JDX1pHK4.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;487&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;so-what-is-a-shader&quot;&gt;So what is a shader?&lt;/h3&gt;
&lt;p&gt;In plain English, a shader is a tiny program that runs on your graphics card. The one I cared about is called a &lt;strong&gt;fragment shader&lt;/strong&gt;, and its job is ridiculously simple: &lt;em&gt;given this one pixel, what colour should it be?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The trick is that it runs for &lt;strong&gt;every single pixel&lt;/strong&gt;, all at the same time. So instead of drawing a sky, you write a little recipe that any pixel can follow to work out its own colour.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a totally different way of thinking. You don&amp;#39;t say &amp;quot;draw a cloud here&amp;quot;. You say &amp;quot;if you&amp;#39;re a pixel, here&amp;#39;s how cloudy you are&amp;quot; 🤯&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/18/19/8i2HP4p1.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;270&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;the-one-triangle-trick&quot;&gt;The one triangle trick&lt;/h3&gt;
&lt;p&gt;To get the shader running across the whole screen, you need to give it something to draw on. You might expect a rectangle made of two triangles, but there&amp;#39;s a neat trick where you use &lt;strong&gt;one&lt;/strong&gt; giant triangle that&amp;#39;s bigger than the screen:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// One triangle that covers the whole screen.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gl&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;bufferData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gl&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ARRAY_BUFFER&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Float32Array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]), &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gl&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;STATIC_DRAW&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The bits hanging off the edge just get clipped, and every pixel on the screen ends up inside it. One triangle, job done 🙌&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/one-triangle.CaF_5Y7O.gif&quot; alt=&quot;&quot; width=&quot;640&quot; height=&quot;440&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;making-smoke-out-of-maths&quot;&gt;Making smoke out of maths&lt;/h3&gt;
&lt;p&gt;This is where my old fluid simulation friend comes back in. Except this time I&amp;#39;m not simulating anything. I&amp;#39;m faking it 😎&lt;/p&gt;
&lt;p&gt;The secret ingredient is &lt;strong&gt;noise&lt;/strong&gt;. Not the loud kind, the random-but-smooth kind. Then you stack several layers of it on top of each other, each one smaller and fainter than the last. That&amp;#39;s called &lt;strong&gt;fbm&lt;/strong&gt; (fractional Brownian motion, if you want to impress people at parties):&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;glsl&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; fbm&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(vec2 &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  float&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; v &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0.0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, a &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0.5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) { v &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; a &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; n&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(p); p &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;*=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2.03&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; a &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;*=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0.5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; v;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Five layers of noise, and suddenly you&amp;#39;ve got something that looks like smoke, clouds or swirling mist. Nudge it along with time and it starts drifting. No Navier-Stokes required!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/fog-embers.BmoFZSeY.gif&quot; alt=&quot;&quot; width=&quot;720&quot; height=&quot;450&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;one-shader-five-realms&quot;&gt;One shader, five realms&lt;/h3&gt;
&lt;p&gt;Aionos has five realms, and each one needed its own sky:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Home:&lt;/strong&gt; smouldering embers of cloud around a warm core&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Norse:&lt;/strong&gt; a polar night with curtains of aurora and twinkling stars&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Olympus:&lt;/strong&gt; a golden dawn with rays fanning out from the sun&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Underworld:&lt;/strong&gt; violet smoke veined with red, and a pale glow off the river&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Egypt:&lt;/strong&gt; a lapis night with a river of stars over an amber horizon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/realms-sky.DtIIfil-.gif&quot; alt=&quot;&quot; width=&quot;774&quot; height=&quot;458&quot;&gt;&lt;/p&gt;
&lt;p&gt;Rather than five separate shaders, it&amp;#39;s &lt;strong&gt;one&lt;/strong&gt; shader that paints them all. Each realm gets a weight between 0 and 1, and the final colour is just each realm multiplied by its weight and added together:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;glsl&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Home: smouldering embers of cloud around a warm core.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (w.x &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0.001&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...work out the colour for this realm...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  col &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; c &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; w&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you move from one realm to another, the weights slide across. Olympus fades down, the Underworld fades up, and for a moment you&amp;#39;re somewhere in between. &lt;strong&gt;No hard cuts, just a slow dissolve.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Fun fact: the weights are passed in as a &lt;code&gt;vec4&lt;/code&gt;, which holds...four numbers. Five realms. So Egypt got its own separate uniform, &lt;code&gt;e&lt;/code&gt;, tacked on the end 😅&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/realm-transitions.Dfx5FoAZ.gif&quot; alt=&quot;&quot; width=&quot;640&quot; height=&quot;400&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;why-it-was-a-pain&quot;&gt;Why it was a pain&lt;/h3&gt;
&lt;p&gt;Shaders don&amp;#39;t really give you much to go on when things go wrong. There&amp;#39;s no &lt;code&gt;console.log&lt;/code&gt; inside a shader. You change a number, refresh, and either the sky looks a bit better, a bit worse, or the whole screen goes black and you&amp;#39;ve got no idea why 🖤&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/da290b156d64898341638f3c299e7478/77/3b/qYUojLAL.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;A lot of my time was spent tweaking a value, refreshing, squinting, and tweaking it again. Honestly, it felt a lot like those early days pulling apart the openFrameworks examples.&lt;/p&gt;
&lt;h3 id=&quot;a-couple-of-cheeky-optimisations&quot;&gt;A couple of cheeky optimisations&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Half resolution.&lt;/strong&gt; The sky is all soft noise, so nobody&amp;#39;s going to notice if it&amp;#39;s a bit blurry. The canvas renders at half the size and gets stretched to fit the screen, which means the graphics card only has to colour a &lt;strong&gt;quarter&lt;/strong&gt; of the pixels:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;resize&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;  this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;max&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;round&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0.5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;  this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;max&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;round&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0.5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;  this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gl&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;?.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;viewport&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canvas&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;A fallback.&lt;/strong&gt; If WebGL isn&amp;#39;t available, the site doesn&amp;#39;t fall over. Each realm has a simple CSS gradient that stands in instead. It&amp;#39;s not as pretty, but you still get a sense of where you are.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;It&amp;#39;s the first shader I&amp;#39;ve ever written. It&amp;#39;s probably not the best shader ever written. But every time the sky dissolves from one realm into the next, it makes me happy.&lt;/strong&gt;&lt;/em&gt; 😁&lt;/p&gt;
&lt;h2 id=&quot;everything-is-a-class-yes-even-in-javascript&quot;&gt;Everything is a class (yes, even in JavaScript)&lt;/h2&gt;
&lt;p&gt;I&amp;#39;m going to say something that might upset a few JavaScript developers...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I like classes!&lt;/strong&gt;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/f5/a8/HYmVrNhs.gif&quot; alt=&quot;&quot; width=&quot;250&quot; height=&quot;214&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;I know, I know. In JavaScript you can get a long way with a handful of functions and some modules. But I like having one &lt;em&gt;thing&lt;/em&gt; that&amp;#39;s responsible for one &lt;em&gt;job&lt;/em&gt;, with all of its behaviour living in one place.&lt;/p&gt;
&lt;h3 id=&quot;thanks-unity&quot;&gt;Thanks, Unity&lt;/h3&gt;
&lt;p&gt;I think this comes from when I tried my hand at game programming with Unity. In Unity, everything in your game is a game object, and you give each one a script with its own special behaviour. It knows how to start itself up, how to update itself every frame, and how to react when something happens to it.&lt;/p&gt;
&lt;p&gt;The game doesn&amp;#39;t micromanage the door. &lt;strong&gt;The door knows how to be a door!&lt;/strong&gt;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/ac/11/kpzDSLwq.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;That way of thinking stuck with me. And it&amp;#39;s exactly how the Aionos site is put together. The sky is a &lt;code&gt;Sky&lt;/code&gt; class. The sound is a &lt;code&gt;Drone&lt;/code&gt; class. The rest of the site just says &amp;quot;we&amp;#39;re in Olympus now&amp;quot;, and each of them works out what that means for themselves.&lt;/p&gt;
&lt;h3 id=&quot;meet-the-drone&quot;&gt;Meet the Drone&lt;/h3&gt;
&lt;p&gt;The background sound on the site isn&amp;#39;t an audio file at all. It&amp;#39;s a low drone that&amp;#39;s &lt;strong&gt;synthesised in the browser&lt;/strong&gt;: a couple of slightly out of tune saw waves, a fifth and an octave on top, all running through a filter that slowly sweeps up and down. Each realm has its own root note, and when you change realm, the drone glides over to it.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the shape of it (with the Web Audio wiring trimmed out, so we can focus on the class):&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Drone&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;color:#D50&quot;&gt; EventTarget&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    super&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ctx&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; null&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; REALMS&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;home&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;drone&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;voices&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  start&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() { &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* fade the drone in */&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  stop&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() { &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* fade it back out */&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;stop&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    else&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;start&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  glideTo&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;realm&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; REALMS&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;realm&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;drone&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ctx&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;osc&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;ratio&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;voices&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      osc&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;frequency&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;setTargetAtTime&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; ratio&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;ctx&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;currentTime&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1.2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // A distant roll of thunder, for Zeus&apos;s lightning over Olympus.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  thunder&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() { &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;/* ... */&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; drone&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Drone&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Yes, there&amp;#39;s a &lt;code&gt;thunder()&lt;/code&gt; method. Yes, it&amp;#39;s just for Zeus. No, I&amp;#39;m not sorry ⚡&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/71/72/pJgXZ8j7Xyzd.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;385&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;why-i-like-it-this-way&quot;&gt;Why I like it this way&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;It looks after itself.&lt;/strong&gt; Anything that wants sound just calls &lt;code&gt;drone.toggle()&lt;/code&gt; or &lt;code&gt;drone.glideTo(&amp;#39;olympus&amp;#39;)&lt;/code&gt;. Nobody else needs to know about oscillators, filters or gain nodes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It tells people when it changes.&lt;/strong&gt; Because &lt;code&gt;Drone&lt;/code&gt; extends &lt;code&gt;EventTarget&lt;/code&gt;, it can fire a &lt;code&gt;change&lt;/code&gt; event whenever it switches on or off. The sound button in the header just listens for that and updates itself. The drone doesn&amp;#39;t even know the button exists!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It matches the sky.&lt;/strong&gt; Look at &lt;code&gt;glideTo&lt;/code&gt; for a second. The pitch doesn&amp;#39;t jump to the new note, it &lt;em&gt;drifts&lt;/em&gt; there. That&amp;#39;s the same idea as the sky dissolving between realms. Nothing cuts. Everything slides.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Give everything its own job, and let it get on with it!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;keeping-it-not-as-crazy&quot;&gt;Keeping it &amp;quot;not as crazy&amp;quot;&lt;/h2&gt;
&lt;p&gt;Remember those Myspace pages? The ones where a song started blasting the second the page loaded, and you were frantically hunting for the pause button before your parents heard? 😅&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/a8ada81afc59159ea5c8927feffa2e31/17/48/wyptl6udHpJ8SRSfMh9.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;I wanted Aionos to feel immersive, but I didn&amp;#39;t want to bring back the bad bits. So I set myself a few rules.&lt;/p&gt;
&lt;h3 id=&quot;rule-1-ask-before-making-noise&quot;&gt;Rule 1: Ask before making noise&lt;/h3&gt;
&lt;p&gt;When you first land on the site, you get a loading screen while the Titans wake up. Once they&amp;#39;re awake, you get a choice:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enter with sound&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enter quietly&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;#39;s it. No surprise audio. No hunting for a mute button. If you change your mind later, there&amp;#39;s a sound toggle in the header that you can flip whenever you like.&lt;/p&gt;
&lt;p&gt;To be fair, browsers have my back on this one. These days they won&amp;#39;t let a page play audio until you&amp;#39;ve clicked on something anyway 👌&lt;/p&gt;
&lt;h3 id=&quot;rule-2-let-people-skip&quot;&gt;Rule 2: Let people skip&lt;/h3&gt;
&lt;p&gt;As much as I love a good cutscene, not everyone wants to sit through one. Maybe you&amp;#39;ve seen it before. Maybe you just want to know when the next gig is. So there&amp;#39;s a &lt;strong&gt;Skip intro&lt;/strong&gt; button right there from the start.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/60/fd/fzSAThl5.gif&quot; alt=&quot;&quot; width=&quot;480&quot; height=&quot;260&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Nobody should have to earn the right to see a website 🙏&lt;/p&gt;
&lt;h3 id=&quot;rule-3-be-kind-to-people-who-dont-want-motion&quot;&gt;Rule 3: Be kind to people who don&amp;#39;t want motion&lt;/h3&gt;
&lt;p&gt;Some people find a lot of movement on screen uncomfortable, and they can tell their device to reduce motion. The browser exposes that through the &lt;code&gt;prefers-reduced-motion&lt;/code&gt; media query, so the site can calm things down for them:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; calm&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; window&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;matchMedia&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;(prefers-reduced-motion: reduce)&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;matches&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The realms are still there. They just don&amp;#39;t swirl around as much.&lt;/p&gt;
&lt;h3 id=&quot;rule-4-the-words-are-still-words&quot;&gt;Rule 4: The words are still words&lt;/h3&gt;
&lt;p&gt;This is the big one. All the fancy stuff lives in the &lt;strong&gt;background&lt;/strong&gt;. The navigation, the headings, the album info and the gig dates are all proper HTML sitting on top of the canvas. They&amp;#39;re not drawn into it.&lt;/p&gt;
&lt;p&gt;That means screen readers can read them. Search engines can find them. You can select the text and copy it. And if WebGL isn&amp;#39;t available, the CSS gradient fallback steps in and you still get the actual content.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/35ccce3d852f7995dd2da910f2abd795/8c/ba/NB8GyX7u.gif&quot; alt=&quot;&quot; width=&quot;374&quot; height=&quot;374&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Funnily enough, that&amp;#39;s the exact problem HTML-in-Canvas is trying to solve. But for a site like this, I didn&amp;#39;t need the words &lt;em&gt;inside&lt;/em&gt; the canvas. I just needed the canvas to sit behind them and look pretty.&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;So...did I bring back Flash? &lt;strong&gt;Not quite.&lt;/strong&gt; But I think I got pretty close to the bit that mattered.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/b9/f8/jxSQVNGe.gif&quot; alt=&quot;&quot; width=&quot;358&quot; height=&quot;436&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The thing I loved about those old promo sites, and all those Geocities, Freewebs and Myspace pages, was never really the technology. It was that they felt like &lt;em&gt;something&lt;/em&gt;. You landed on them and you knew exactly whose corner of the internet you were standing in.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what I&amp;#39;m taking away from this one:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Start simple.&lt;/strong&gt; I wanted a walking character, 3D relics and HTML inputs carved into stone tablets. What I actually needed was a sky. Get the small thing right, then build on it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Old knowledge never really goes away.&lt;/strong&gt; Fiddling with openFrameworks examples in Code::Blocks all those years ago is the reason the canvas felt like home.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shaders are scary, until they&amp;#39;re not.&lt;/strong&gt; I&amp;#39;m still no expert, but I&amp;#39;m not frightened of a black screen anymore. Well...not as frightened 😅&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Give things their own job.&lt;/strong&gt; A &lt;code&gt;Sky&lt;/code&gt; that knows how to be a sky and a &lt;code&gt;Drone&lt;/code&gt; that knows how to be a drone made the whole thing so much easier to reason about.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Immersive and accessible aren&amp;#39;t enemies.&lt;/strong&gt; Let people choose the sound, let them skip, and keep the words as real HTML.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;so-what-about-html-in-canvas&quot;&gt;So what about HTML-in-Canvas?&lt;/h3&gt;
&lt;p&gt;I didn&amp;#39;t need it this time, but I haven&amp;#39;t given up on it. I can definitely see it earning its place somewhere like a &lt;strong&gt;game menu&lt;/strong&gt;, or text on a screen inside a 3D scene, where you genuinely want real, accessible HTML living &lt;em&gt;inside&lt;/em&gt; the graphics. Once it&amp;#39;s out from behind that flag, I&amp;#39;ll be dusting off the great hall idea 👀&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/26/9d/t9GTzcjs.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;378&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;If you want to see how it all came together, go and have a wander through the realms at &lt;a href=&quot;https://aionosband.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;aionosband.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Websites don&amp;#39;t all have to look the same. Go and build something with a bit of personality.&lt;/em&gt;&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Experiments</category><category>Software Development</category><category>Nostalgia</category></item><item><title>Should I Ditch React Native?</title><link>https://www.mrstebo.co.uk/should-i-ditch-react-native/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/should-i-ditch-react-native/</guid><description>I have a confession to make. Even when I&apos;m building the most simple of features, I&apos;ll sometimes spend an unreasonable amount of time trying to convince myself it&apos;s a good idea. And not just convince myself. I&apos;ll frame it like it&apos;s someone…</description><pubDate>Tue, 22 Sep 2026 07:00:05 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/should-i-ditch-react-native.CqGAMNLi_ZneBGs.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I have a confession to make. Even when I&amp;#39;m building the most simple of features, I&amp;#39;ll sometimes spend an unreasonable amount of time trying to convince myself it&amp;#39;s a good idea. And not just convince myself. I&amp;#39;ll frame it like it&amp;#39;s someone else&amp;#39;s opinion I need to win over. Like there are two engineers living in my head, and one of them isn&amp;#39;t budging until the other one makes a proper case.&lt;/p&gt;
&lt;p&gt;I touched on a version of this in an earlier post, &lt;a href=&quot;https://www.mrstebo.co.uk/time-to-convince/&quot;&gt;Time To Convince&lt;/a&gt;, where I talked about letting problems sit before rushing to solve them. What I didn&amp;#39;t fully admit back then is that the &amp;quot;letting it sit&amp;quot; part often looks like a full internal debate, complete with a side that&amp;#39;s stubbornly against whatever the other side wants to do.&lt;/p&gt;
&lt;p&gt;This time it&amp;#39;s a bigger question than usual, and it crept up on me recently while I was digging through crash reports in Sentry for &lt;a href=&quot;https://carefriends.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Care Friends&lt;/a&gt;, the mobile app I&amp;#39;ve been building with React Native for the past two years. A few too many of those crashes had that familiar &amp;quot;if only this was native&amp;quot; flavour to them, and before I knew it, one half of my brain had opened a case for ditching React Native entirely and learning Swift and Kotlin properly.&lt;/p&gt;
&lt;p&gt;The annoying thing is, I&amp;#39;m not even sure that half of my brain is right. It might just be wishful thinking brought on by one too many Reanimated stack traces... So consider this post me thinking out loud, in public, weighing up two years of React Native evidence against a hunch that native might have saved me some grief 😅&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/e1b92bb53e0c9e442408bc677a56c789/87/e2/6CUSsdArRivrM.gif&quot; alt=&quot;&quot; width=&quot;267&quot; height=&quot;352&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;tldr&quot;&gt;TLDR;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Expo has made React Native development genuinely brilliant for the past two years, especially for someone maintaining a mobile app largely solo&lt;/li&gt;
&lt;li&gt;A run of hard-to-reproduce crashes (mostly courtesy of React Native Reanimated) has me wondering if native would have been more stable&lt;/li&gt;
&lt;li&gt;Realistically though, going native would mean learning Swift and Kotlin from scratch and maintaining two codebases instead of one, which is a big ask when it&amp;#39;s mostly just me&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;remember-xamarin&quot;&gt;Remember Xamarin?&lt;/h3&gt;
&lt;p&gt;Before any of this React Native soul-searching, Care Friends was built with Xamarin Forms. It worked fine for a good while, right up until Microsoft decided it didn&amp;#39;t want to support it anymore. Xamarin Forms hit end of life, and the &lt;a href=&quot;https://dotnet.microsoft.com/en-us/platform/support/policy/xamarin?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;official guidance&lt;/a&gt; was pretty clear about where everyone was supposed to go next: .NET MAUI.&lt;/p&gt;
&lt;p&gt;I did look into it. Microsoft even has a whole &lt;a href=&quot;https://learn.microsoft.com/en-us/dotnet/maui/migration/?view=net-maui-10.0&amp;#38;WT.mc_id=dotnet-35129-website&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;migration guide&lt;/a&gt; dedicated to walking you through the process. But at the same time this was happening, Microsoft also announced they were shutting down App Center, which was the service we relied on to actually get builds out to the App Store and Google Play. So I wasn&amp;#39;t just facing a framework migration, I was facing a framework migration &lt;strong&gt;and&lt;/strong&gt; a deployment pipeline migration, at the same time, for the same app.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/7607a26399874a14744aa5e7accfa062/c6/05/vZxCsLgz.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;281&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;That was the point where I decided if I was going to be rebuilding a chunk of the app&amp;#39;s foundations anyway, I might as well properly weigh up my options rather than just taking the &amp;quot;safe&amp;quot; MAUI path by default. And that&amp;#39;s how I ended up looking at React Native, and more specifically, Expo.&lt;/p&gt;
&lt;h3 id=&quot;where-expo-shines&quot;&gt;Where Expo shines 😍&lt;/h3&gt;
&lt;p&gt;React Native wasn&amp;#39;t a complete gamble for me. I&amp;#39;d used it in previous roles, so I already had a rough idea of what I was getting myself into. I&amp;#39;d even experimented with &lt;a href=&quot;https://tamagui.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Tamagui&lt;/a&gt; at one point, which lets you share a single codebase across both web and mobile. That wasn&amp;#39;t the goal here though, our web app is a completely separate beast, so I wasn&amp;#39;t trying to unify the two. I just needed a solid way to build the mobile app on its own.&lt;/p&gt;
&lt;p&gt;What I hadn&amp;#39;t used much before was &lt;a href=&quot;https://expo.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Expo&lt;/a&gt;, and specifically &lt;a href=&quot;https://docs.expo.dev/eas/workflows/introduction/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Expo Application Services&lt;/a&gt; (EAS). Two years in, I can safely say it&amp;#39;s been a bit of a lifesaver.&lt;/p&gt;
&lt;p&gt;Local development is smooth. Spinning up a simulator and iterating on changes just works, without the usual native tooling headaches I remembered from years gone by. But the bit that&amp;#39;s genuinely changed how I work is the preview builds. EAS lets me create a &amp;quot;preview&amp;quot; build that anyone can install by scanning a QR code, no App Store, no Google Play, no waiting around.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/56/32/ekTwkxAG.gif&quot; alt=&quot;&quot; width=&quot;249&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;That might not sound like much, but it completely changed our UAT process. Instead of only getting proper testing coverage once a build hit TestFlight or the Google Play beta channel, I could get a much wider group of people internally testing changes early, just by sending them a QR code. Issues that would have previously surfaced late, right before a release, now get caught much earlier.&lt;/p&gt;
&lt;p&gt;A typical preview build is about as simple as:&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;eas build --profile preview --platform all&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that&amp;#39;s it. A few minutes later, I&amp;#39;ve got a build ready to share, no fiddling with provisioning profiles or signing certificates required.&lt;/p&gt;
&lt;p&gt;Once that workflow proved itself locally, the next step was making sure builds could be triggered without me needing to be sat at my laptop running commands. I set up a pipeline in Azure DevOps to handle that, so a build for a given environment and platform is just a parameterised job away:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;yaml&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;parameters&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;  environment&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;  appName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;  configName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;  platform&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;  profile&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;jobs&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;deployment&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; Deploy_${{ parameters.configName }}_${{ parameters.environment }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    displayName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Deploy ${{ parameters.appName }} Apps (${{ parameters.environment }})&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    environment&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.environment }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    strategy&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;      runOnce&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;        deploy&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;          steps&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;            - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;template&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ../steps/prepare_build.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;            - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; npm install -g eas-cli&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;              displayName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Install EAS CLI&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;            - &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; eas build --platform ${{ parameters.platform }} --profile ${{ parameters.profile }} --non-interactive --auto-submit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;              displayName&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Deploy ${{ parameters.appName }} apps&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;              env&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                EXPO_TOKEN&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; $(EXPO_TOKEN)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                CONFIG_NAME&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; ${{ parameters.configName }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;                HUSKY&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That &lt;code&gt;--auto-submit&lt;/code&gt; flag is doing a lot of heavy lifting there too, once a build passes, it gets submitted straight to the relevant store without me having to babysit it. Between the QR code preview builds and this pipeline, getting something in front of testers or into TestFlight became one of the least stressful parts of the whole process.&lt;/p&gt;
&lt;h3 id=&quot;tailwind-on-mobile&quot;&gt;Tailwind on mobile?! 🤯&lt;/h3&gt;
&lt;p&gt;One of the more pleasant surprises along the way was finding &lt;a href=&quot;https://www.nativewind.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;NativeWind&lt;/a&gt;, a package that lets you style React Native components using Tailwind classes. If you&amp;#39;ve worked with Tailwind on the web, it&amp;#39;s exactly what it sounds like, the same &lt;code&gt;className&lt;/code&gt; approach, just working on native components instead of &lt;code&gt;div&lt;/code&gt;s and &lt;code&gt;span&lt;/code&gt;s.&lt;/p&gt;
&lt;p&gt;This was useful for more than just convenience. We could create a shared Tailwind config that spanned both the web and mobile projects, meaning our colours, spacing, and typography scales stayed consistent across platforms without having to redefine them twice.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// tailwind.config.js&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  content&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;./app/**/*.{js,jsx,ts,tsx}&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  presets&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;nativewind/preset&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  theme&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    extend&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      colors&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        primary&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;#1E40AF&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        secondary&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;#F59E0B&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;jsx&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;View&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; className&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;flex-1 items-center justify-center bg-white&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; className&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;text-primary text-xl font-semibold&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    Hello there! 👋&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;View&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/feea28532d9709f5128558f418c779d0/10/36/4rZGmVf9.gif&quot; alt=&quot;&quot; width=&quot;474&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;It&amp;#39;s worth being honest though, this wasn&amp;#39;t a fully automated &amp;quot;change it once, everywhere updates&amp;quot; setup. If the web app&amp;#39;s colours or typefaces changed, someone still had to go and manually update the shared config to match. It kept things &lt;em&gt;consistent&lt;/em&gt;, but it didn&amp;#39;t remove the need for a human to notice the change and act on it. Still, having one place to update rather than hunting through styles scattered across the mobile codebase was a genuine time saver.&lt;/p&gt;
&lt;h3 id=&quot;where-it-starts-to-hurt&quot;&gt;Where it starts to hurt&lt;/h3&gt;
&lt;p&gt;It hasn&amp;#39;t all been smooth sailing though. Expo has its own ecosystem of &amp;quot;supported&amp;quot; packages, and there&amp;#39;s a handy command, &lt;a href=&quot;https://docs.expo.dev/develop/tools/?ref=mrstebo.co.uk#expo-doctor&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;expo-doctor&lt;/code&gt;&lt;/a&gt;, that checks your dependencies against what&amp;#39;s expected for your current SDK version. On the whole, this is a good thing. It means less variation between projects on the same Expo SDK version, and fewer surprises when something doesn&amp;#39;t play nicely.&lt;/p&gt;
&lt;p&gt;Except when it does the opposite of what you need it to 😩&lt;/p&gt;
&lt;p&gt;I recently hit an issue caused by &lt;a href=&quot;https://github.com/software-mansion/react-native-screens?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;react-native-screens&lt;/code&gt;&lt;/a&gt; that was affecting navigation behaviour. Annoying, but not a mystery, the fix was already out there, sitting in the next patch version. So naturally, I went to install it.&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;npx expo install react-native-screens@latest&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And &lt;code&gt;expo-doctor&lt;/code&gt; promptly told me off for it.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/35ccce3d852f7995dd2da910f2abd795/a9/6e/bsRhnOCb.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;470&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;According to Expo&amp;#39;s supported version range for my SDK, I wasn&amp;#39;t supposed to be on that patch version yet. Never mind that it contained the actual fix for the bug I was trying to solve, the &amp;quot;supported&amp;quot; version was technically the one with the bug still in it. So I was left choosing between staying &amp;quot;supported&amp;quot; with a known issue, or going slightly off script to actually fix the problem.&lt;/p&gt;
&lt;p&gt;I went off script, for what it&amp;#39;s worth. But it&amp;#39;s a good example of the trade-off with this whole ecosystem. The guardrails that normally save you time can occasionally box you into a corner, right when you need the flexibility to just fix the thing.&lt;/p&gt;
&lt;h3 id=&quot;reanimated-the-repeat-offender&quot;&gt;Reanimated: the repeat offender&lt;/h3&gt;
&lt;p&gt;If there&amp;#39;s one package that shows up disproportionately often in our crash reports, it&amp;#39;s &lt;a href=&quot;https://docs.swmansion.com/react-native-reanimated/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;React Native Reanimated&lt;/a&gt;. Between Sentry and the crash stats sitting in the Google Play Console, it&amp;#39;s become a familiar name, and not in a good way.&lt;/p&gt;
&lt;p&gt;The frustrating part isn&amp;#39;t just that the crashes happen, it&amp;#39;s how difficult they are to actually reproduce. Mobile development has a fragmentation problem that&amp;#39;s easy to forget about when you&amp;#39;re testing on your own phone every day. Different manufacturers, different OS versions, different amounts of RAM, different GPU quirks. A crash that happens reliably on a three year old budget Android device might never show up on anything I own.&lt;/p&gt;
&lt;p&gt;So I end up staring at a stack trace pointing somewhere deep inside Reanimated&amp;#39;s native layer, with a device model I&amp;#39;ve never heard of, an OS version two majors behind, and no clean way to reproduce it locally. I can usually make an educated guess at the cause, tweak something defensively, ship it, and hope the crash rate drops. It&amp;#39;s not a great feeling for someone who likes to actually understand a bug before fixing it.&lt;/p&gt;
&lt;p&gt;This is probably the single biggest contributor to that &amp;quot;if only this was native&amp;quot; feeling I mentioned earlier. Whether native code would genuinely avoid these issues, or whether I&amp;#39;d just be trading them for a different set of native-only headaches, is a question I can&amp;#39;t fully answer. But when you&amp;#39;re staring down yet another Reanimated crash with a device you can&amp;#39;t get your hands on, it&amp;#39;s easy to convince yourself the grass is greener.&lt;/p&gt;
&lt;p&gt;Rather than walk through every crash one by one, it&amp;#39;s more useful to talk about the &lt;em&gt;shapes&lt;/em&gt; these errors take, because they repeat.&lt;/p&gt;
&lt;h4 id=&quot;native-memory-failures&quot;&gt;Native memory failures&lt;/h4&gt;
&lt;p&gt;These are the ones where the app just falls over inside Reanimated&amp;#39;s C++ layer, with zero frames of my own code anywhere near the stack:&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;EXC_BAD_ACCESS: Exception 1, Code 1, Subcode 13500579344645825961
KERN_INVALID_ADDRESS at 0xbb5bb162839725a9

at -[AnimationFrameQueue executeQueue:] (AnimationFrameQueue.mm:99)
at worklets::AnimationFrameBatchinator::flush::lambda::operator() (AnimationFrameBatchinator.cpp:50)
at worklets::WorkletRuntime::runSync&amp;#60;T&amp;#62; (WorkletRuntime.h:62)
at facebook::jsi::Function::call (jsi-inl.h:313)
...
at reanimated::ReanimatedModuleProxy::performOperations (ReanimatedModuleProxy.cpp:1117)
at reanimated::ReanimatedModuleProxy::commitUpdates (ReanimatedModuleProxy.cpp:1164)
at facebook::react::ShadowTree::commit (&amp;#60;unknown&amp;#62;)
at facebook::react::RootShadowNode::layoutIfNeeded (&amp;#60;unknown&amp;#62;)
at facebook::yoga::calculateLayout (&amp;#60;unknown&amp;#62;)
...
at facebook::react::ShadowNode::clone (&amp;#60;unknown&amp;#62;)
at folly::dynamic::hash (&amp;#60;unknown&amp;#62;)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A worklet fires, Reanimated commits into the shadow tree, Yoga recalculates layout, and somewhere in the middle of hashing a &lt;code&gt;folly::dynamic&lt;/code&gt; it all falls over. Have a count of how many frames belong to me. Zero. The exact same call path shows up under a second issue too, except that one ends in a &lt;code&gt;SIGABRT&lt;/code&gt; instead. Nearby in the same family is a &lt;code&gt;std::bad_alloc&lt;/code&gt; whose entire &amp;quot;stack trace&amp;quot; is a worklet compiled down to a single line and Sentry politely telling me: &amp;quot;No stack trace available.&amp;quot; 😑&lt;/p&gt;
&lt;h4 id=&quot;cross-runtime-deadlocks-and-hangs&quot;&gt;Cross-runtime deadlocks and hangs&lt;/h4&gt;
&lt;p&gt;These are the scariest ones, because nothing crashes...the app just stops! On iOS, Reanimated&amp;#39;s mount hook takes a lock as the shadow tree mounts and the main thread queues up behind it for seven full seconds. Android hides the same category of problem inside an ANR (&amp;quot;Application Not Responding&amp;quot;) rather than a crash, which means it never reaches Sentry at all. I only found it by going and looking directly at the Play Console. The main thread in that report is completely innocent, sat idle waiting for work, while React Native&amp;#39;s JS thread is buried dozens of frames deep serialising a worklet under a lock, calling into itself over and over. Same fundamental problem, just from a different platform.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d6b0ce929193df3c242ac34b5654d2ce/0a/46/eYoOnkdf.gif&quot; alt=&quot;&quot; width=&quot;244&quot; height=&quot;244&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h4 id=&quot;platform-api-mismatches&quot;&gt;Platform API mismatches&lt;/h4&gt;
&lt;p&gt;Not every Android ANR is exotic. One was just Android&amp;#39;s accessibility service asking a deeply nested React Native view tree to describe itself, walking it on the main thread during a frame, until the input dispatcher gave up. Nobody did anything wrong here. Android&amp;#39;s accessibility API assumes shallow view hierarchies, React Native produces deep, constantly reconciling ones, and the two assumptions quietly disagree...&lt;/p&gt;
&lt;h4 id=&quot;the-exception-that-actually-behaves&quot;&gt;The exception that actually behaves&lt;/h4&gt;
&lt;p&gt;And then there&amp;#39;s the counter-example: a &lt;code&gt;react-native-screens&lt;/code&gt; crash with a real class name, a real line number, and a one-patch-version fix waiting for me on GitHub. That&amp;#39;s the version of this I can live with. The real problem is that when it breaks in C++, across a runtime boundary, in a stack where half the symbols didn&amp;#39;t survive compilation, I stop being an engineer and start being someone who makes educated guesses and ships them hopefully 🤞.&lt;/p&gt;
&lt;h3 id=&quot;new-architecture-migration-pains&quot;&gt;New architecture migration pains&lt;/h3&gt;
&lt;p&gt;When Expo moved to support React Native&amp;#39;s new architecture, not every package in the ecosystem was ready for it. Some maintainers turned updates around quickly. Others took a bit longer, which meant a stretch of messy, patchy workarounds just to keep things compiling.&lt;/p&gt;
&lt;p&gt;The Firebase package we use for push notifications was, somewhat surprisingly, one of the stragglers. I say surprisingly because I&amp;#39;d assumed a package used by such a huge chunk of the React Native community would be near the front of the queue for new architecture support. Turns out I wasn&amp;#39;t the only one hitting problems, there&amp;#39;s a &lt;a href=&quot;https://github.com/firebase/firebase-js-sdk/issues/9346?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;GitHub issue on the Firebase SDK repo&lt;/a&gt; describing almost the exact same dependency conflict I ran into, and a &lt;a href=&quot;https://github.com/wix/react-native-navigation/issues/8026?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;separate issue on react-native-navigation&lt;/a&gt; showing the same category of static linking problems the new architecture introduced for Firebase-adjacent packages. Small comfort, but comfort all the same.&lt;/p&gt;
&lt;p&gt;In the meantime, the fix was to patch the Podfile to force some dependencies to compile &amp;quot;the old way&amp;quot;, even while the rest of the app had moved on to the new architecture.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# Podfile&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;pre_install &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;installer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;|&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  installer.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;pod_targets&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; do&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;pod&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;|&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; pod.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;eql?&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;RNFBApp&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; pod.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;eql?&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;RNFBMessaging&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; pod.build_type&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        Pod&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BuildType&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;static_library&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s the kind of workaround that does the job, but leaves you a little uneasy every time you upgrade a dependency, wondering if this is the version that finally breaks the patch.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/39/a5/jy2DWG93.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;273&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;To buy myself some breathing room, I leaned on the feature flag Expo provided to stay on the legacy architecture a little longer than I probably should have. Basically, I kept deferring the pain rather than actually fixing it. That worked right up until the &lt;a href=&quot;https://expo.dev/changelog/sdk-55-beta?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;SDK 55 beta changelog&lt;/a&gt; landed and made it clear the legacy architecture escape hatch wasn&amp;#39;t going to be around forever. By the time &lt;a href=&quot;https://expo.dev/changelog/sdk-55?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;SDK 55&lt;/a&gt; actually shipped, I didn&amp;#39;t have much choice left but to sit down and properly sort out the new architecture support, deferred pain and all. Turns out avoiding a problem for long enough just means a bigger version of the same problem shows up later, who knew 😅&lt;/p&gt;
&lt;h3 id=&quot;why-im-still-doing-this&quot;&gt;Why I&amp;#39;m still doing this&lt;/h3&gt;
&lt;p&gt;Putting the crashes and the patched Podfiles aside for a second, it&amp;#39;s worth zooming out and asking why I went down the React Native route in the first place. The honest answer is workflow. Care Friends is, for the most part, a solo effort. There isn&amp;#39;t a dedicated iOS developer and a dedicated Android developer sat either side of me. There&amp;#39;s just me, and whatever I can realistically keep on top of.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/should-i-ditch-react-native-1.DjAiRzXc_Z3XNC8.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;700&quot;&gt;&lt;/p&gt;
&lt;p&gt;A single codebase means a bug fix, a feature, or a design tweak gets written once and tested on both platforms. Going native properly would mean writing (and maintaining, and debugging) two separate implementations of the same feature, in two different languages, with two different sets of platform quirks to learn. For a team of one, that&amp;#39;s not a small trade-off.&lt;/p&gt;
&lt;p&gt;And that&amp;#39;s where I have to be honest about something. I was tempted to throw in some Swift and Kotlin code examples here, to make this feel like a proper head-to-head comparison. But that would be disingenuous. My experience with either language is close to non-existent. So this was never really a fair fight between &amp;quot;React Native&amp;quot; and &amp;quot;native&amp;quot;. It&amp;#39;s closer to &amp;quot;the ecosystem I already know reasonably well&amp;quot; versus &amp;quot;two ecosystems I&amp;#39;d be starting from zero in&amp;quot;, while also being the only person maintaining the app. That&amp;#39;s a very different question to answer than a neutral technical comparison would suggest.&lt;/p&gt;
&lt;h3 id=&quot;so-am-i-switching&quot;&gt;So am I switching?&lt;/h3&gt;
&lt;p&gt;Right, time to let the two halves of my brain actually finish this argument.&lt;/p&gt;
&lt;p&gt;The case for going native is real, but it&amp;#39;s narrower than it felt at 4pm on a Friday staring at a Reanimated stack trace. Some of those crashes probably would be avoided, or at least easier to diagnose, with proper native tooling and none of the JS bridge in between. That&amp;#39;s not nothing.&lt;/p&gt;
&lt;p&gt;But the case for sticking with React Native and Expo is bigger than one bad afternoon of crash reports. Two years of EAS preview builds, a CI pipeline that just works, a shared Tailwind config keeping branding consistent, and a development workflow that lets one person actually keep on top of a mobile app without burning out. Going native wouldn&amp;#39;t just mean rewriting the app, it would mean rewriting my entire workflow, from scratch, in two languages I&amp;#39;d be learning as I go, while still being the only person responsible for shipping it.&lt;/p&gt;
&lt;p&gt;So, for now, the verdict is: I&amp;#39;m staying put. Not because React Native is perfect, it clearly isn&amp;#39;t, but because the alternative isn&amp;#39;t really &amp;quot;the same app, but more stable&amp;quot;. It&amp;#39;s &amp;quot;a different, slower way of working, with a steep learning curve, that might eventually be more stable, maybe, if I do a good enough job learning Swift and Kotlin along the way&amp;quot;. That&amp;#39;s a lot of maybes to trade against a workflow that&amp;#39;s mostly been working fine.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/39f2394ae36df6e199be9eb7c9fa1012/0c/d2/EJ7xVQIV.gif&quot; alt=&quot;&quot; width=&quot;480&quot; height=&quot;270&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Ask me again next time Sentry serves up a fresh batch of Reanimated crashes though. I make no promises about how long this verdict holds 😅&lt;/p&gt;
&lt;h3 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h3&gt;
&lt;p&gt;So there you have it, a fairly public airing of an argument I&amp;#39;ve been having with myself, resolved for now in favour of the status quo. React Native and Expo have earned their keep over the past two years, warts, patched Podfiles, and all. The crashes are annoying, the occasional &lt;code&gt;expo-doctor&lt;/code&gt; standoff is annoying, but none of it has been bad enough to outweigh the very real benefit of one person being able to actually maintain a mobile app without it becoming a second job on top of the job.&lt;/p&gt;
&lt;p&gt;Maybe one day the calculation changes. Maybe Reanimated sorts itself out, or maybe I finally sit down and learn Swift and Kotlin properly instead of just complaining about not knowing them. But that&amp;#39;s a decision for future me to debate with himself...&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Mobile Development</category><category>Expo</category><category>React Native</category></item><item><title>Technology is the shovel - Content is the hole</title><link>https://www.mrstebo.co.uk/technology-is-the-shovel-content-is-the-hole/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/technology-is-the-shovel-content-is-the-hole/</guid><description>It&apos;s December 2013. Justine Sacco, a senior PR executive at IAC, is at Heathrow about to board an 11-hour flight to Cape Town. Right before she switches her phone to flight mode, she fires off one last tweet. It&apos;s meant to be a joke. It…</description><pubDate>Tue, 15 Sep 2026 07:30:50 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/technology-is-the-shovel-content-is-the-hole.DPSgrDIc_ZQghHf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s December 2013. Justine Sacco, a senior PR executive at IAC, is at Heathrow about to board an 11-hour flight to Cape Town. Right before she switches her phone to flight mode, she fires off one last tweet. It&amp;#39;s meant to be a joke.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t funny...&lt;/p&gt;
&lt;p&gt;By the time her flight landed, the internet had spent 11 hours losing its mind over it. &lt;strong&gt;#HasJustineLandedYet&lt;/strong&gt; was trending worldwide. She&amp;#39;d already been fired. Strangers had found her flight number and were waiting for the moment she&amp;#39;d land and switch her phone back on.&lt;/p&gt;
&lt;p&gt;She had no idea any of it was happening. She was in the air the whole time, completely unreachable, while her old life quietly ended without her. &lt;a href=&quot;https://www.buzzfeednews.com/article/alisonvingiano/this-is-how-a-womans-offensive-tweet-became-the-worlds-top-s?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;You can read the full story on BuzzFeed News&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/woman-sleeping-whilst.CKIaXTgo_Z2f5AB3.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the story I keep coming back to whenever I think about technology and the internet. Not because it&amp;#39;s the most extreme example out there (it isn&amp;#39;t, we&amp;#39;ll get to a few more later), but because of the timeline. One tweet. Eleven hours. A career, gone, before she&amp;#39;d even landed back on solid ground.&lt;/p&gt;
&lt;p&gt;Sacco picked up the shovel without thinking twice. And the hole was already dug before the plane touched down.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s really what this post is about. Technology is the shovel. It&amp;#39;s brilliant, it&amp;#39;s powerful, and it&amp;#39;s sat right there in your pocket, ready whenever you want to use it. Content, what we actually choose to dig with it, is the hole. And here&amp;#39;s the bit that makes it dangerous: once you&amp;#39;ve dug it, you can&amp;#39;t fill it back in.&lt;/p&gt;
&lt;h3 id=&quot;the-shovel&quot;&gt;The Shovel&lt;/h3&gt;
&lt;p&gt;Before we get too deep into the hole (sorry), it&amp;#39;s worth pausing on how good the shovel actually is.&lt;/p&gt;
&lt;p&gt;We live in a world where you can learn literally anything you want, at any time, for free. Curious how a jet engine works? There&amp;#39;s a video for that. Want to know what&amp;#39;s happening on the other side of the world right now, as it happens? Done. Forgotten the name of that actor from that film with the guy from the other film? Answered in about four seconds.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy to take that for granted, but it&amp;#39;s genuinely wild if you stop and think about it. I remember growing up in a world where &amp;quot;finding something out&amp;quot; meant signing up for a library card and taking a trip to the library, or just accepting you&amp;#39;d never know. Now it&amp;#39;s a tab away.&lt;/p&gt;
&lt;p&gt;And it&amp;#39;s not just information, it&amp;#39;s people too. I can message a friend in another country and get a reply before I&amp;#39;ve finished making a brew! Video call my family whenever I want. Keep up with people I&amp;#39;ve not seen in person for years, just by scrolling for thirty seconds. None of that was normal a generation ago.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/person-looking.BJy3WC6A_ZhP0Bp.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Social media, for all the grief I&amp;#39;m about to give it later in this post, also does something genuinely good here. It gives everyone a platform. You don&amp;#39;t need to work for a newspaper or own a TV network to have a voice anymore. You can just... say the thing. Share the idea. Post the discovery. Anyone can dig.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the shovel bit. It&amp;#39;s not the problem. The problem is what we do with it.&lt;/p&gt;
&lt;h3 id=&quot;digging-from-an-early-age&quot;&gt;Digging From an Early Age&lt;/h3&gt;
&lt;p&gt;Here&amp;#39;s where things start to get a bit more uncomfortable.&lt;/p&gt;
&lt;p&gt;Kids today don&amp;#39;t just have access to the internet, they&amp;#39;ve basically grown up inside it. Not just social media either, WhatsApp, Snapchat, group chats, gaming voice chats, all of it. And in most of those spaces, they&amp;#39;re doing exactly what the shovel was built for: sharing opinions, reacting to things, being themselves in public.&lt;/p&gt;
&lt;p&gt;The problem is, &amp;quot;being yourself in public at age 12&amp;quot; is a very different thing to &amp;quot;being yourself in public at age 30.&amp;quot; At 12, you don&amp;#39;t really have a fixed sense of who you are yet. You&amp;#39;re still figuring it out. That&amp;#39;s kind of the whole point of being a young adolescent, right? 🤷‍♂️&lt;/p&gt;
&lt;p&gt;But the internet doesn&amp;#39;t wait for you to finish figuring it out. Whatever you post, whatever group chat message gets sent, whatever opinion gets shared in the moment, it all starts building a record. A version of you, permanently online, formed by someone who hadn&amp;#39;t actually decided who they were yet.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/teenage-man-in-dark.BdBVtLN6_Z1FYj9J.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;And it&amp;#39;s not just the big public stuff either. A lot of this digging happens in places that feel completely private. A WhatsApp group. A Snapchat that&amp;#39;s supposed to disappear. A message sent to one mate, not the whole world. It feels safe because it&amp;#39;s small. But small doesn&amp;#39;t mean gone, it just means fewer people saw it dug in the first place.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the bit that worries me most, honestly. Adults at least know, on some level, that anything typed into a phone could end up somewhere it wasn&amp;#39;t meant to. Kids are still learning that. And they&amp;#39;re learning it in real time, with a permanent record being built the whole way through.&lt;/p&gt;
&lt;p&gt;The hole starts getting dug way before anyone&amp;#39;s actually old enough to understand what a hole is.&lt;/p&gt;
&lt;h3 id=&quot;the-hole-doesnt-fill-back-in&quot;&gt;The Hole Doesn&amp;#39;t Fill Back In&lt;/h3&gt;
&lt;p&gt;Sacco&amp;#39;s story happened in 11 hours. These next four happened over years, sometimes over a decade, which honestly makes them scarier.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kevin Hart&lt;/strong&gt; was announced as host of the 2019 Oscars. Two days later, he stepped down after &lt;a href=&quot;https://www.bbc.co.uk/news/entertainment-arts-46479017?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;old tweets from 2009 to 2011 resurfaced&lt;/a&gt;, years after he&amp;#39;d posted them and long after most people had forgotten they existed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Chrissy Teigen&lt;/strong&gt; spent a decade building a public persona as one of Twitter&amp;#39;s funniest, most relatable celebrities. Then old tweets from 2011 came back, and she ended up &lt;a href=&quot;https://www.dailymail.com/tvshowbiz/article-9685481/Chrissy-Teigen-admits-troll-hole-apologizes-past-bullying-tweets.html?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;publicly apologising&lt;/a&gt; for messages she&amp;#39;d sent as a much younger, much less thoughtful version of herself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;James Gunn&lt;/strong&gt; was fired from directing Guardians of the Galaxy Vol. 3 in 2018, over jokes he&amp;#39;d posted &lt;a href=&quot;https://www.dailymail.com/news/fb-5976069/JAMES-GUNNS-DELETED-TWEETS.html?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;almost a decade earlier&lt;/a&gt;, between 2008 and 2011. Those particular tweets weren&amp;#39;t stumbled on by accident either, they were deliberately dug up and pushed into the spotlight by people with an axe to grind. We&amp;#39;ll come back to that bit.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lauren Edwards&lt;/strong&gt;, a newly elected Labour MP, had to &lt;a href=&quot;https://news.sky.com/story/labour-mp-lauren-edwards-apologises-after-old-tweets-resurface-13193353?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;apologise in 2024&lt;/a&gt; for tweets she&amp;#39;d posted in 2009, fifteen years earlier, back when she was a parliamentary researcher in her twenties, long before &amp;quot;future MP&amp;quot; was even on the radar.&lt;/p&gt;
&lt;p&gt;Look at the gaps in those stories. Two years. A decade. Nine years. Fifteen years. That&amp;#39;s the bit that should genuinely unsettle you. It&amp;#39;s not that a bad post might catch up with you next week. It&amp;#39;s that it can sit there, patiently, for over a decade, and still land with exactly the same force the day it resurfaces.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/police-confronting-old.CgySt677_Z1EvvRm.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The hole doesn&amp;#39;t care how long ago you dug it. It&amp;#39;s still there, waiting, whether you remember digging it or not.&lt;/p&gt;
&lt;h3 id=&quot;someone-else-holds-the-shovel-too&quot;&gt;Someone Else Holds the Shovel Too&lt;/h3&gt;
&lt;p&gt;Remember how I said we&amp;#39;d come back to the James Gunn bit? Here it is.&lt;/p&gt;
&lt;p&gt;Most of the examples so far are about content just... existing. Sitting there. Getting stumbled on, eventually, by someone scrolling back far enough. But Gunn&amp;#39;s case is different, and it matters that it&amp;#39;s different.&lt;/p&gt;
&lt;p&gt;His old tweets weren&amp;#39;t found by accident. They were deliberately dug up by &lt;a href=&quot;https://www.thewrap.com/mike-cernovich-who-got-james-gunn-fired-over-rape-tweets-has-history-of-rape-tweets/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Mike Cernovich&lt;/a&gt;, a right-wing commentator who went looking specifically because Gunn had criticised people he liked. The tweets weren&amp;#39;t the point. They were the ammunition. Someone else picked up Gunn&amp;#39;s old shovel, on Gunn&amp;#39;s behalf, and used it to dig a hole for him.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s a genuinely different kind of danger to the one we&amp;#39;ve talked about so far. It&amp;#39;s not &amp;quot;I said something dumb once and it eventually came back to bite me.&amp;quot; It&amp;#39;s &amp;quot;someone went looking for a reason to hurt me, and my old posts gave them exactly what they needed.&amp;quot;&lt;/p&gt;
&lt;p&gt;And this is where it gets uncomfortable for the &amp;quot;young people online&amp;quot; thread of this post. Because kids and teenagers aren&amp;#39;t just at risk of their own old opinions catching up with them one day. They&amp;#39;re growing up in a world where other people, classmates, exes, strangers with an agenda, can go digging through years of their posts, screenshots, and group chats, looking for something to use against them. Right now. Not in a decade.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/teenager-digging-up.DxFLWqLY_1VBWn0.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Adults have at least had years to build up a filter. A sense of what&amp;#39;s fine to say out loud, what&amp;#39;s fine to type, and what should probably just stay as a thought in your head. That filter gets built slowly, usually the hard way, through actually living in the world and occasionally embarrassing yourself in front of people who&amp;#39;ll forget about it by next week.&lt;/p&gt;
&lt;p&gt;Young people are building that same filter in public, permanently, often in short bursts, on platforms designed to reward the loudest reaction rather than the most considered one. And they&amp;#39;re doing it in a world where anyone, a bully, a future employer, a stranger with a grudge, might be the one holding the shovel next.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s not really their opinions being unfair or dishonest necessarily. It&amp;#39;s that the opinions were formed by someone who hadn&amp;#39;t finished forming yet, and the internet doesn&amp;#39;t come with an asterisk for that.&lt;/p&gt;
&lt;h3 id=&quot;australias-answer&quot;&gt;Australia&amp;#39;s Answer&lt;/h3&gt;
&lt;p&gt;While all this has been playing out, Australia&amp;#39;s had a genuinely interesting response: just don&amp;#39;t let under-16s dig at all.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.esafety.gov.au/about-us/industry-regulation/social-media-age-restrictions?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Online Safety Amendment (Social Media Minimum Age) Bill&lt;/a&gt; passed with bipartisan support in late 2024, and came into effect on 10 December 2025. Platforms including Instagram, TikTok, Snapchat, Facebook, YouTube, X, Reddit and a few others now have to take &amp;quot;reasonable steps&amp;quot; to stop under-16s from holding an account at all, whether that&amp;#39;s a brand new signup or one they already had.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.bbc.co.uk/news/articles/cwyp9d3ddqyo?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;BBC covered it well&lt;/a&gt; when the ban first landed: platforms use things like facial estimation via selfies, ID uploads, or just inferring your age from your online behaviour, to figure out who&amp;#39;s underage and lock them out. There&amp;#39;s no exemption for parental consent either. If you&amp;#39;re under 16, you&amp;#39;re out, whether your mum and dad are fine with it or not.&lt;/p&gt;
&lt;p&gt;The logic tracks with everything we&amp;#39;ve talked about so far. If a huge chunk of the &amp;quot;hole digging&amp;quot; is happening before people are old enough to understand what a hole even is, then the simplest fix is to hand over the shovel a bit later.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/mobile-phone-screen.CgHsb1_5_DTzjM.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;And credit where it&amp;#39;s due, it&amp;#39;s not a token gesture either. Platforms face fines of up to A$50 million for systemic failures to comply, which is enough money to make even the biggest tech companies actually pay attention.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not perfect. Kids have already found workarounds, from VPNs to just fudging a face scan. But as a first move, delaying the age at which kids start building a permanent public record of themselves? That&amp;#39;s a genuinely sensible one.&lt;/p&gt;
&lt;h3 id=&quot;the-uks-version-and-why-a-ban-isnt-a-silver-bullet&quot;&gt;The UK&amp;#39;s Version, and Why a Ban Isn&amp;#39;t a Silver Bullet&lt;/h3&gt;
&lt;p&gt;Britain&amp;#39;s watching Australia closely, and it looks like we&amp;#39;re about to follow.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;https://www.npr.org/2026/06/15/nx-s1-5858644/britain-social-media-ban?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;June 2026, Keir Starmer announced&lt;/a&gt; that the UK will ban under-16s from platforms including Snapchat, TikTok, YouTube, Instagram, Facebook and X. Messaging apps like WhatsApp and Signal are expected to be left out of it, which is worth remembering given everything we said earlier about &amp;quot;private&amp;quot; messages not staying private. The legislation is expected to go before Parliament before Christmas, with the ban itself coming into force sometime in early 2027.&lt;/p&gt;
&lt;p&gt;It follows the same public consultation route as most UK policy these days: &lt;a href=&quot;https://researchbriefings.files.parliament.uk/documents/CBP-10468/CBP-10468.pdf?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;116,000 responses&lt;/a&gt; from parents, teens, and the tech industry, with over 90% of respondents backing an under-16 ban. That&amp;#39;s not a marginal call, that&amp;#39;s a pretty overwhelming &amp;quot;please do something&amp;quot; from the people who actually deal with this daily.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/eb/e9/caqGuwKox0LRrp.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;258&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;So credit where it&amp;#39;s due, this is a real, meaningful step. But I don&amp;#39;t think it&amp;#39;s the fix a lot of people are hoping it is, for a few reasons.&lt;/p&gt;
&lt;p&gt;First, it delays the age you&amp;#39;re handed the shovel. It doesn&amp;#39;t change what happens once you&amp;#39;ve got it. Turn 16, get an account, and you&amp;#39;re right back in the same hole-digging position as everyone else, just a couple of years later than you would&amp;#39;ve been.&lt;/p&gt;
&lt;p&gt;Second, and this is the bit that matters most for this post, grown adults dig holes too. Plenty of them. The Kevin Hart, Chrissy Teigen, James Gunn and Lauren Edwards stories weren&amp;#39;t teenagers making mistakes, they were adults, some of them well into their 30s and 40s, who still said things they&amp;#39;d later regret, often once they&amp;#39;d found a group of like-minded people cheering them on. An age limit doesn&amp;#39;t touch that at all.&lt;/p&gt;
&lt;p&gt;So this is a sensible first step. It&amp;#39;s just not a silver bullet. It changes when people start digging. It doesn&amp;#39;t change the fact that the hole never fills back in.&lt;/p&gt;
&lt;h3 id=&quot;so-blessing-or-curse&quot;&gt;So, Blessing or Curse?&lt;/h3&gt;
&lt;p&gt;Right, time to actually answer the question the whole post has been circling.&lt;/p&gt;
&lt;p&gt;Technology, the shovel itself, is genuinely brilliant. I meant that earlier and I still mean it now. The ability to learn anything, reach anyone, and share your voice with the whole world is one of the best things humans have ever built. I&amp;#39;m not about to pretend otherwise.&lt;/p&gt;
&lt;p&gt;But content is the hole. And the hole is where all the damage actually happens.&lt;/p&gt;
&lt;p&gt;Justine Sacco dug hers in the time it takes to type one bad joke, and it swallowed her career before she&amp;#39;d even landed. Kevin Hart, Chrissy Teigen, James Gunn, and Lauren Edwards dug theirs years, sometimes over a decade, before it caught up with them. Kids today are digging theirs earlier than any of us did, often in spaces that feel private but really aren&amp;#39;t, building a permanent record before they&amp;#39;ve even worked out who they want to be.&lt;/p&gt;
&lt;p&gt;And once it&amp;#39;s dug, that&amp;#39;s it. No filling it back in. No growing out of it quietly the way people used to. The internet doesn&amp;#39;t do quiet, and it doesn&amp;#39;t forget.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s why, if you&amp;#39;re asking me to actually pick a side rather than sit on the fence, I think the balance tips more towards curse than blessing. Not because the good stuff isn&amp;#39;t real, it clearly is, but because the bad stuff is permanent and the good stuff usually isn&amp;#39;t. A brilliant Google search doesn&amp;#39;t compound over ten years. A bad tweet can.&lt;/p&gt;
&lt;p&gt;Australia&amp;#39;s ban and the UK&amp;#39;s upcoming one are steps in the right direction. They just don&amp;#39;t fix the actual problem, they only delay when people first pick up the shovel. The shovel was never really the issue anyway. It&amp;#39;s what we do with it, and how long the internet decides to remember, that decides whether technology ends up being a blessing or a curse for any one of us.&lt;/p&gt;
&lt;p&gt;We built the tool. We&amp;#39;re still working out how to be careful with it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/man-holding-shovel.D7Z3J-hE_103JnE.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Psychology</category><category>Tech Industry</category><category>Social Change</category></item><item><title>Solutions for Made Up Problems</title><link>https://www.mrstebo.co.uk/solutions-for-made-up-problems/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/solutions-for-made-up-problems/</guid><description>I don&apos;t know about you, but every now and again I see something new hit the market and my immediate reaction is one raised eyebrow and a slow &quot;...why?&quot; Not the &quot;ooh that&apos;s clever&quot; kind of why. The other one. The &quot;who asked for this&quot; kind…</description><pubDate>Tue, 08 Sep 2026 07:30:19 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/solutions-for-made-up-problems.CujSRFOH_Z1arsHs.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know about you, but every now and again I see something new hit the market and my immediate reaction is one raised eyebrow and a slow &amp;quot;...why?&amp;quot;&lt;/p&gt;
&lt;p&gt;Not the &amp;quot;ooh that&amp;#39;s clever&amp;quot; kind of why. The other one. The &amp;quot;who asked for this&amp;quot; kind of why.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/d8/3c/mzuY5a12.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;It&amp;#39;s not that I&amp;#39;m against progress. Far from it, I&amp;#39;ve spent most of my career getting genuinely excited about new tech. But somewhere along the way, a load of companies seem to have decided that if there isn&amp;#39;t a problem to solve, they&amp;#39;ll just invent one, slap some sensors and an app on it, and call it innovation.&lt;/p&gt;
&lt;p&gt;So I thought I&amp;#39;d run through a few examples that have made me stop and stare at my phone/car/shopping trolley in mild disbelief recently, before getting to the bit that&amp;#39;s actually interesting: why this keeps happening at all.&lt;/p&gt;
&lt;h3 id=&quot;the-car-that-opens-its-own-door-for-you&quot;&gt;The car that opens its own door for you&lt;/h3&gt;
&lt;p&gt;First up, cars. Specifically, the &lt;a href=&quot;https://www.bmwblog.com/2023/04/13/2023-bmw-7-series-automatic-doors-video/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;2023 BMW 7 Series&lt;/a&gt;, which comes with a button that will automatically open the door for you.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/da290b156d64898341638f3c299e7478/f2/ba/oTWtrf7d.gif&quot; alt=&quot;&quot; width=&quot;320&quot; height=&quot;240&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Now, I get it. Doors are heavy. Pushing them open is &lt;em&gt;such&lt;/em&gt; a chore. But here&amp;#39;s my favourite bit, the bit that made me actually laugh out loud when I read it. BMW themselves admit the sensors aren&amp;#39;t foolproof:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The technology is not foolproof since there is a risk that sensors might not be able to recognize smaller objects or other car doors at certain angles. For this reason, BMW argues it&amp;#39;s best to put your hand on the door and stop it in case it&amp;#39;s about to slam into an adjacent object.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So let&amp;#39;s just recap that. The solution to &amp;quot;opening a car door&amp;quot; is a button, that triggers a motor, that might not notice a bollard or the car parked next to you, so you should keep your hand on the door just in case.&lt;/p&gt;
&lt;p&gt;Which means... you&amp;#39;re still opening the door. You&amp;#39;re just doing it with a slightly confused robot assisting you.&lt;/p&gt;
&lt;p&gt;And it&amp;#39;s not just BMW being fancy for the sake of it. The &lt;a href=&quot;https://www.youtube.com/shorts/2gjzc18jhjY?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Audi Q7 will let you open and close all the doors remotely from the key&lt;/a&gt;, which tells me this isn&amp;#39;t a one-off gimmick, it&amp;#39;s becoming A Thing. Manufacturers are actively competing on who can automate the opening of a door the best.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sure the engineering behind it is genuinely impressive. But the problem it solves? I&amp;#39;m struggling to find one 🤷&lt;/p&gt;
&lt;h3 id=&quot;full-self-driving-sort-of&quot;&gt;Full self driving (sort of)&lt;/h3&gt;
&lt;p&gt;Next up, the big one. &lt;a href=&quot;https://www.forbes.com/sites/alanohnsman/2025/09-23/teslas-full-self-driving-software-is-a-mess-should-it-be-legal/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Full self driving&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, before anyone jumps down my throat, I actually think autonomous driving is a genuinely worthwhile problem to solve. Fewer accidents, less fatigue behind the wheel, more time to do something other than sit in traffic. Fine. Great, even.&lt;/p&gt;
&lt;p&gt;But here&amp;#39;s my issue. Unless &lt;em&gt;everyone&lt;/em&gt; is in on it at the same time, all the cars, all the sensors, all the pedestrians, all the cyclists, you&amp;#39;re still going to have a road full of unpredictable humans doing unpredictable human things. Full self driving doesn&amp;#39;t solve &amp;quot;bad drivers.&amp;quot; It just adds a very confident computer into a mix that still contains all of the same lunatics it did before, whether they&amp;#39;re behind a wheel or crossing the road without looking.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/8ce8357c78ea940b9c2015daf05ce1a5/ef/9c/2rCMQNd2.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;281&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And then there&amp;#39;s the small matter of who&amp;#39;s actually responsible when something goes wrong. If the car is driving itself and it makes a mistake, is that the driver&amp;#39;s fault? The manufacturer&amp;#39;s? The software&amp;#39;s? Genuinely, is this even a solved problem yet? Because from where I&amp;#39;m sitting, it feels like everyone&amp;#39;s just quietly hoping it sorts itself out before too many court cases pile up.&lt;/p&gt;
&lt;p&gt;Which brings me to my favourite bit of evidence that we are, in fact, nowhere near done here. &lt;a href=&quot;https://www.youtube.com/watch?v=008nYinncQU&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;This video&lt;/a&gt;, where someone crashes and the immediate defence is &amp;quot;I wasn&amp;#39;t driving, it was the autopilot.&amp;quot;&lt;/p&gt;
&lt;p&gt;That, right there, is the whole problem in one sentence. We&amp;#39;ve built a solution so half-finished that its main selling point is also its best legal loophole.&lt;/p&gt;
&lt;h3 id=&quot;ai-shopping-trolleys&quot;&gt;AI shopping trolleys&lt;/h3&gt;
&lt;p&gt;And now for something a little closer to home. Literally, in this case, because &lt;a href=&quot;https://www.theguardian.com/business/2026/aug/25/they-make-life-much-easier-ai-powered-shopping-trolleys-roll-out-in-lancashire?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;AI-powered shopping trolleys have started rolling out in Lancashire&lt;/a&gt;.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/55/50/XzpJ0CJH.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;I&amp;#39;ll be honest, out of everything on this list, this is the one that made me pause the longest. A trolley. With AI in it. Helping you shop.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what problem the humble shopping trolley had that needed solving. It&amp;#39;s a metal basket on wheels. It has done its one job, admirably, for decades. And now, apparently, it needs to be smart.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sure there&amp;#39;s a genuinely useful angle in there somewhere, maybe it nudges you towards a better route round the shop, maybe it helps people with mobility issues, and if it does, brilliant. But my gut reaction wasn&amp;#39;t &amp;quot;finally,&amp;quot; it was &amp;quot;...why though?&amp;quot;&lt;/p&gt;
&lt;p&gt;Which is becoming a bit of a theme.&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;red&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;💢&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;Doesn&apos;t it become yet another bit of tech that employees need to contend with?! 😑&lt;/div&gt;&lt;/aside&gt;&lt;h3 id=&quot;the-gadget-graveyard&quot;&gt;The gadget graveyard&lt;/h3&gt;
&lt;p&gt;Of course, none of this is new. We&amp;#39;ve been doing this with gadgets for years.&lt;/p&gt;
&lt;p&gt;You know the videos I mean. Someone unboxes a product, tries to use it with a straight face, and slowly the whole thing unravels into &amp;quot;...why does this exist&amp;quot; in real time. &lt;a href=&quot;https://www.youtube.com/watch?v=cZypFRdPS9M&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;This one&amp;#39;s a good example&lt;/a&gt;.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/d9/71/KXFEPN6u.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The self-stirring mug. A device whose entire purpose is to save you the immense physical burden of moving a spoon in a circle. There&amp;#39;s also gadgets that &amp;quot;help with putting&amp;quot; (golf putting, that is), because apparently the issue was never your technique, it was that you weren&amp;#39;t using a robot.&lt;/p&gt;
&lt;p&gt;None of these are inherently evil. They&amp;#39;re just... solutions, wandering around, looking for a problem to attach themselves to.&lt;/p&gt;
&lt;p&gt;And it turns out that&amp;#39;s not just a novelty-gadget thing anymore. It&amp;#39;s cars. It&amp;#39;s shopping trolleys. It&amp;#39;s starting to feel like the norm rather than the exception.&lt;/p&gt;
&lt;p&gt;Which got me thinking about &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&quot;most-things-that-needed-inventing-have-been-invented&quot;&gt;Most things that needed inventing, have been invented&lt;/h3&gt;
&lt;p&gt;Here&amp;#39;s the conclusion I keep landing on. Most things that actually needed inventing, have been invented.&lt;/p&gt;
&lt;p&gt;A door that opens. A car that drives. A trolley that carries your shopping. A mug that keeps your drink stirred, if you desperately want that. These are all, fundamentally, solved problems. Someone, at some point, cracked it. Job done.&lt;/p&gt;
&lt;p&gt;And that&amp;#39;s the real issue. Once you&amp;#39;ve solved the core problem, what&amp;#39;s left to do? You can&amp;#39;t just stand still, competitors will eat your lunch, so the pressure shifts from &amp;quot;solve the problem&amp;quot; to &amp;quot;look different from the other people who also solved the problem.&amp;quot;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s not the same challenge. Solving a problem is hard, but it&amp;#39;s a fairly straightforward kind of hard, you know what you&amp;#39;re aiming at. Differentiating from a dozen competitors who&amp;#39;ve &lt;em&gt;also&lt;/em&gt; solved the problem is a different beast entirely, and it&amp;#39;s the kind of pressure that leads to genuinely mad-scientist thinking. Sensors that might not spot a bollard. Trolleys with opinions. Mugs that stir themselves.&lt;/p&gt;
&lt;p&gt;Nobody sets out to build something pointless. But when the actual problem is already solved and the real fight is &amp;quot;be different, or die,&amp;quot; pointless is often exactly where you end up.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/89/c7/1Cktzl0d8w2l.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;378&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;myspace-didnt-see-it-coming&quot;&gt;MySpace didn&amp;#39;t see it coming&lt;/h3&gt;
&lt;p&gt;If you want proof that &amp;quot;solving the problem&amp;quot; isn&amp;#39;t the finish line, look no further than MySpace.&lt;/p&gt;
&lt;p&gt;Worth remembering, MySpace itself was the upgrade. Before it, if you wanted a page on the internet, you were probably a teenager hand-coding a Geocities or Freewebs site with absolutely no concept of web standards or &amp;quot;how to design something right.&amp;quot; It was just a cavalcade of ideas, mashed together onto a couple of pages, glittery text, a MIDI file that autoplayed on load, animated GIFs everywhere, tables held together with hope. MySpace came along and gave people profiles, friends, a Top 8, and customisable themes without needing to touch a line of HTML. It didn&amp;#39;t just solve social networking, it made an existing solution look ancient overnight.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/cc/2c/bLxk4Oke.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And for a good while there, it &lt;em&gt;was&lt;/em&gt; the internet, socially speaking. I reckon a fair few people at MySpace figured that was that. Problem solved. Job done. Nothing left to invent.&lt;/p&gt;
&lt;p&gt;Except it wasn&amp;#39;t done, was it. Facebook turned up with a cleaner feed, a news feed that actually made sense, and a bunch of features that felt like the next step rather than a retread. And one by one, people drifted.&lt;/p&gt;
&lt;p&gt;I was one of them. Not because I decided MySpace had gone stale, my wife did that bit for me. She convinced me to get on Facebook, and pretty much overnight my MySpace activity flatlined. Just... nothing. Gone.&lt;/p&gt;
&lt;p&gt;MySpace didn&amp;#39;t lose because it stopped working. The doors still opened, so to speak. It lost because everyone else kept adding features to differentiate themselves, and eventually one of them added enough alluring stuff to pull people away, one nagging spouse at a time. Which is a bit rich, considering MySpace won its own throne the exact same way.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the same fight the door-opening cars and the AI trolleys are in now. Nobody&amp;#39;s trying to solve a new problem. They&amp;#39;re trying not to become MySpace.&lt;/p&gt;
&lt;h3 id=&quot;so-whats-the-actual-takeaway&quot;&gt;So, what&amp;#39;s the actual takeaway?&lt;/h3&gt;
&lt;p&gt;I don&amp;#39;t think any of this is a conspiracy. I don&amp;#39;t think there&amp;#39;s a room full of executives twirling their moustaches, dreaming up pointless features purely to harvest your data (although, let&amp;#39;s be honest, that probably &lt;em&gt;is&lt;/em&gt; a nice side effect for some of them).&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s simpler, and slightly less sinister, than that. Most of the big problems have been solved. Doors open. Cars drive. Trolleys carry shopping. Mugs hold coffee, stirred or not. And once you&amp;#39;ve solved the problem, standing still isn&amp;#39;t an option, because someone else is quietly building the next MySpace-beating Facebook in a garage somewhere, and they don&amp;#39;t need your permission to start pulling your users away.&lt;/p&gt;
&lt;p&gt;So companies keep reaching. Sensors that might miss a bollard. Trolleys with opinions. Buttons for things that never needed buttons. Not because anyone asked for it, but because the alternative is standing perfectly still while everyone else invents something, anything, to look different.&lt;/p&gt;
&lt;p&gt;Whether any of it is actually &lt;em&gt;good&lt;/em&gt; is a different question entirely. But at least now, next time I catch myself raising an eyebrow at some new &amp;quot;innovation,&amp;quot; I&amp;#39;ve got a slightly better answer to &amp;quot;...why?&amp;quot;&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Technology</category><category>Innovation</category></item><item><title>Implementing a Feature Using Shadow Releases</title><link>https://www.mrstebo.co.uk/implementing-a-feature-using-shadow-releases/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/implementing-a-feature-using-shadow-releases/</guid><description>In Part 1, I talked about the thinking. The constraints. The &quot;what would perfect look like if we started fresh?&quot; conversations. The deliberate decision to shadow-release customisable candidate progression so we could keep making forward…</description><pubDate>Tue, 01 Sep 2026 07:00:56 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/implementing-a-feature-using-shadow-releases.Cg-6MOpI_1c96CD.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;https://www.mrstebo.co.uk/forward-progress-with-shadow-releases/&quot;&gt;Part 1&lt;/a&gt;, I talked about the thinking. The constraints. The &amp;quot;what would perfect look like if we started fresh?&amp;quot; conversations. The deliberate decision to shadow-release customisable candidate progression so we could keep making forward progress without setting the platform on fire.&lt;/p&gt;
&lt;p&gt;This part is where the rubber meets the road.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/96/43/7npUpFw8.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The goal stayed simple on paper: customisable stage names and statuses, notifications for every stage and status (that you can switch on and off), and the ability to try all of that on one customer at a time. Without blowing up everyone still living on the old hardcoded path.&lt;/p&gt;
&lt;p&gt;Sounds lovely. Now... how do you actually build it?&lt;/p&gt;
&lt;h2 id=&quot;what-done-looked-like-in-code-terms&quot;&gt;What &amp;quot;done&amp;quot; looked like in code terms&lt;/h2&gt;
&lt;p&gt;Before writing a line of the happy-path feature, I needed a definition of done that wasn&amp;#39;t &amp;quot;the UI looks nice in Figma&amp;quot;.&lt;/p&gt;
&lt;p&gt;Done meant:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No customer-facing stage builder&lt;/strong&gt; in the first release (that constraint from Part 1 still stood. Stages get set up during onboarding or later ops work)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One module&lt;/strong&gt; other code can call without caring whether a customer is on modern or legacy behaviour&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Per-customer enablement with an easy rollback&lt;/strong&gt; and critically, &lt;strong&gt;without&lt;/strong&gt; adding another traditional feature flag&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The same behaviour&lt;/strong&gt; whether someone progresses a candidate in the dashboard &lt;strong&gt;or&lt;/strong&gt; an via one of our ATS integrations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That last one was non-negotiable. If migrating a customer onto custom stages left their ATS-driven candidates on a different points or notification path to the UI… we hadn&amp;#39;t shipped a shadow release. We&amp;#39;d shipped a trap 😅.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/61/68/sQXrK3VLakzreM.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;257&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h2 id=&quot;data-model-first&quot;&gt;Data model first&lt;/h2&gt;
&lt;p&gt;Hardcoded stage strings had been doing too many jobs for too long 😣. They were display names. They were lookup keys for notifications. They were the glue for side-effects. Stretching them further would have been the software equivalent of duct-taping a second storey onto a shed!&lt;/p&gt;
&lt;p&gt;So we introduced proper models:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CandidateProgressStage&lt;/code&gt; - per customer, step number (0–6), custom name, active flag&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CandidateProgressStageStatus&lt;/code&gt; - belongs to a stage; key, name, outcome (&lt;code&gt;positive&lt;/code&gt; / &lt;code&gt;neutral&lt;/code&gt; / &lt;code&gt;negative&lt;/code&gt;), active&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CandidateProgressionAutomationNotification&lt;/code&gt; - optional notification config hanging off a status (title, body, push / in-app)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In plain English:&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;Customer
  └── Stages (step 0–6)
        └── Statuses (outcome + key)
              └── Automation notification (optional)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The tables landed ahead of the big behavioural cutover. Schema first. Behaviour second. That ordering mattered. You can&amp;#39;t migrate customers onto a system that doesn&amp;#39;t have somewhere to live 😬.&lt;/p&gt;
&lt;h2 id=&quot;the-candidateprogression-module&quot;&gt;The CandidateProgression module&lt;/h2&gt;
&lt;p&gt;All of this lived in a dedicated module: &lt;code&gt;CandidateProgression&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This was because candidate progression had been scattered across the codebase like confetti after a particularly messy wedding, and I wanted one place future-me (and future teammates) would know to look.&lt;/p&gt;
&lt;p&gt;At the front of that module sits a manager. The public API is deliberately boring:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;checkCanProgress(...)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;progressCandidate(...)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;undoProgression(...)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Callers ask the manager. The manager owns the orchestration: persist the progress row, dispatch the right step handler, fire the event, stay inside a transaction when it should 💪.&lt;/p&gt;
&lt;p&gt;Behind that door: handlers per progression step, and &lt;strong&gt;capabilities&lt;/strong&gt; for the side-effects - points, notifications, audit, live/archived state, starters. Progression itself shouldn&amp;#39;t re-implement half the application in every call site.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/86/64/r9DRRImq.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;A controller-shaped usage looks roughly like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$check&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $progressionManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;checkCanProgress&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $candidate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $stageId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $statusId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$check&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;canProgress&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // tell the user why not — backwards move, unknown stage, etc.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $progressionManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;progressCandidate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $candidate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $stageId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $statusId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In Part 1 I talked about a Manager as an orchestrator sitting in front of business logic. It became the seam everything else hung off and it showed up as a handful of design patterns that made the next change cheaper.&lt;/p&gt;
&lt;h2 id=&quot;design-patterns-that-keep-future-me-sane&quot;&gt;Design patterns that keep future-me sane&lt;/h2&gt;
&lt;p&gt;I didn&amp;#39;t sprinkle patterns to be &amp;quot;clever&amp;quot;. They were intentional seams that made shadow release. And whatever comes after it less terrifying.&lt;/p&gt;
&lt;p&gt;If you want the textbook versions, &lt;a href=&quot;https://refactoring.guru/design-patterns/catalog?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Refactoring.Guru&lt;/a&gt; explains them better than I will. Here&amp;#39;s how they showed up in this work.&lt;/p&gt;
&lt;h3 id=&quot;facade-the-gof-kindnot-the-laravel-kind&quot;&gt;Facade (the GoF kind...not the Laravel kind)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;CandidateProgressionManager&lt;/code&gt; is a &lt;a href=&quot;https://refactoring.guru/design-patterns/facade?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Facade&lt;/a&gt; in the Gang of Four sense: a class that wraps a noisy subsystem behind a simpler API.&lt;/p&gt;
&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; a &lt;a href=&quot;https://laravel.com/docs/12.x/facades?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Laravel Facade&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Laravel Facades are those static proxies into the container - &lt;code&gt;Cache::get()&lt;/code&gt;, &lt;code&gt;DB::table()&lt;/code&gt;, &lt;code&gt;Illuminate\Support\Facades\…&lt;/code&gt;. Different animal. Same word. Maximum confusion potential 😅!&lt;/p&gt;
&lt;p&gt;The progression manager is a normal injectable service that &lt;em&gt;plays the role&lt;/em&gt; of a structural Facade. UI code and ATS handlers talk to it. They don&amp;#39;t need to know about capability pipelines, handler registration, or which tables just got touched.&lt;/p&gt;
&lt;h3 id=&quot;strategy-factory-method&quot;&gt;Strategy + Factory Method&lt;/h3&gt;
&lt;p&gt;Modern vs legacy behaviour sits behind the same interface. That&amp;#39;s &lt;a href=&quot;https://refactoring.guru/design-patterns/strategy?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Strategy&lt;/a&gt;! Swap the algorithm, keep the callers.&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;https://refactoring.guru/design-patterns/factory-method?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Factory&lt;/a&gt; (practical factory method vibes) chooses which strategy you get, based on whether the customer has been &lt;strong&gt;migrated&lt;/strong&gt; onto custom stages yet. Same idea on the ATS side: progression handlers vs fallback handlers.&lt;/p&gt;
&lt;h3 id=&quot;template-method&quot;&gt;Template Method&lt;/h3&gt;
&lt;p&gt;Abstract handlers own the skeleton of &amp;quot;handle this stage / status change&amp;quot;. Concrete step handlers fill in the varying bits. Classic &lt;a href=&quot;https://refactoring.guru/design-patterns/template-method?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Template Method&lt;/a&gt;. Less copy-paste. Fewer &amp;quot;I fixed it here but not over there&amp;quot; moments.&lt;/p&gt;
&lt;h3 id=&quot;chain-of-responsibility&quot;&gt;Chain of Responsibility&lt;/h3&gt;
&lt;p&gt;Side-effects run as an ordered pipeline of capabilities: state -&amp;gt; points -&amp;gt; notifications -&amp;gt; audit -&amp;gt; (sometimes) starters. Middleware can wrap that pipeline the same way (logging was the obvious first guest).&lt;/p&gt;
&lt;p&gt;Want a new side-effect later? Add a capability. Don&amp;#39;t reopen every controller and webhook handler. That&amp;#39;s &lt;a href=&quot;https://refactoring.guru/design-patterns/chain-of-responsibility?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Chain of Responsibility&lt;/a&gt; earning its rent.&lt;/p&gt;
&lt;h3 id=&quot;adapter-observer&quot;&gt;Adapter + Observer&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://refactoring.guru/design-patterns/adapter?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Adapter&lt;/a&gt;: ATS payloads and legacy name/key stages get translated into the manager&amp;#39;s world (UUIDs vs strings; mapped ATS stage -&amp;gt; our step ladder).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://refactoring.guru/design-patterns/observer?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Observer&lt;/a&gt; (light touch): when stages and statuses get created, observers seed defaults and notification rows so enablement isn&amp;#39;t a twenty-step manual checklist every time.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/78/72/k7syL5YieagcAs.gif&quot; alt=&quot;&quot; width=&quot;447&quot; height=&quot;267&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;None of this is decoration. It&amp;#39;s why custom stages, ATS parity, and rollback could land without a big-bang rewrite.&lt;/p&gt;
&lt;h2 id=&quot;building-the-shadow-seam&quot;&gt;Building the shadow seam&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s the design decision that usually surprises people.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There is no feature flag for this.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Not Pennant. Not a &lt;code&gt;CustomerFeatureType&lt;/code&gt;. Not a boolean column on the customer saying &lt;code&gt;custom_stages_enabled&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&amp;quot;Are they on the new system?&amp;quot; means &amp;quot;Have we &lt;strong&gt;migrated&lt;/strong&gt; them onto custom stages?&amp;quot;&lt;/p&gt;
&lt;p&gt;At runtime that collapses to a boring question: do they have rows in &lt;code&gt;candidate_progress_stages&lt;/code&gt;?&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; usesModernProgression&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Customer&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $customer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; bool&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; CandidateProgressStage&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;customer_id&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$customer&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Migrated -&amp;gt; &lt;code&gt;CandidateProgressionManager&lt;/code&gt; (DB stages, UUIDs). Not migrated -&amp;gt; &lt;code&gt;LegacyCandidateProgressionManager&lt;/code&gt; (fallback hardcoded stages).&lt;/p&gt;
&lt;p&gt;Same gate for the dashboard. Same gate for ATS. One question. Everywhere.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/e5/a9/irwx3Yrt.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;We&amp;#39;d already been through older flag-based migrations once. We weren&amp;#39;t keen to invent another flag just so we could feel like we were &amp;quot;doing feature flags properly&amp;quot;. Migration state &lt;em&gt;is&lt;/em&gt; the switch. More on how that flip actually happens in a bit.&lt;/p&gt;
&lt;h2 id=&quot;side-effects-without-rewriting-everything&quot;&gt;Side-effects without rewriting everything&lt;/h2&gt;
&lt;p&gt;Once the progress row is saved, the handler runs its capability chain.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s where points get awarded (or not). Notifications get looked up. Prefering the new automation-notification table, but falling back to the older one if needed. Audit entries get written. Candidates move between live and archived based on outcome. Starter dates get set when the step calls for it.&lt;/p&gt;
&lt;p&gt;Because those concerns live behind the Facade, our ATS integrations and the UI don&amp;#39;t each invent their own half-correct version of &amp;quot;what happens when someone reaches interview successful&amp;quot;.&lt;/p&gt;
&lt;p&gt;And when something genuinely needs to progress quietly? &lt;code&gt;skipCapabilities&lt;/code&gt; is the escape hatch. Use sparingly! 📿&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/84/1e/M4JjTdew4cjW9Bs3.gif&quot; alt=&quot;&quot; width=&quot;346&quot; height=&quot;268&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h2 id=&quot;making-ats-integrations-play-nice-the-scary-integration&quot;&gt;Making ATS integrations play nice (the scary integration)&lt;/h2&gt;
&lt;p&gt;This is not a footnote. ATS integrations are how a lot of real candidate progression enters the platform.&lt;/p&gt;
&lt;p&gt;Part 1&amp;#39;s pain still applied here: progress someone in the UI and a whole set of things happened. Progress them via an ATS webhook and… you might get a different set. Or a subset. Or a shrug 🤷‍♂️.&lt;/p&gt;
&lt;p&gt;The old ATS world had grown vendor-specific processors and plenty of places for behaviour to drift. We&amp;#39;d already lived through earlier migration flags. For &lt;em&gt;this&lt;/em&gt; work, the deliberate choice was: no new flag. Migration state instead.&lt;/p&gt;
&lt;p&gt;Live application sync now routes through a shared path into the ATS Applications stack, rather than forever forking &amp;quot;what Fountain does&amp;quot; vs &amp;quot;what some other ATS does&amp;quot; for the same conceptual event.&lt;/p&gt;
&lt;p&gt;In plain English:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An ATS webhook lands&lt;/li&gt;
&lt;li&gt;Sync / job picks it up&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ApplicationEventHandler&lt;/code&gt; figures out the customer and candidate&lt;/li&gt;
&lt;li&gt;ATS stage name gets mapped via the customer&amp;#39;s stage mappings&lt;/li&gt;
&lt;li&gt;Stage handlers (or rejection / status handlers) run&lt;/li&gt;
&lt;li&gt;Those handlers resolve a progression manager for that customer - &lt;strong&gt;Factory + Strategy&lt;/strong&gt; again. And call the same API the UI uses&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The shadow-release wiring on the ATS side mirrors the factory: progression-step handlers when the customer has custom stages, fallback handlers when they don&amp;#39;t. Same migration-state question. Rejections get their own status-handler path so &amp;quot;rejected in the ATS&amp;quot; still lands on the right stage and outcome, instead of disappearing into the void.&lt;/p&gt;
&lt;p&gt;We also invested in boring-but-vital groundwork: recording the update source on progression, and logging when a mapping is missing so a per-customer migration is diagnosable instead of mysteriously &amp;quot;quiet&amp;quot;.&lt;/p&gt;
&lt;p&gt;Honest scope check, because credibility matters: ATS integrations still map onto our &lt;strong&gt;canonical step ladder&lt;/strong&gt; (reserved stage names -&amp;gt; look up the customer&amp;#39;s stage by &lt;code&gt;step_number&lt;/code&gt;). It is not yet &amp;quot;arbitrary custom stage graph straight from the ATS&amp;quot;. Native integration sync is further along for ID-based mappings. That&amp;#39;s fine. Shadow release isn&amp;#39;t &amp;quot;finish every possible future&amp;quot;. It&amp;#39;s &amp;quot;ship the risky bit safely&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;dashboard-and-everything-else-through-the-same-door&quot;&gt;Dashboard (and everything else) through the same door&lt;/h2&gt;
&lt;p&gt;Manual progression resolves the same manager and hits the same capability pipeline.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the whole point of the Facade. Once our ATS integrations and the UI share the door, migrating a customer onto custom stages is an &lt;strong&gt;ops/data&lt;/strong&gt; change. Not a second rewrite of progression logic with a sticky note that says &amp;quot;remember to update the webhook path too&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;migrating-a-customer&quot;&gt;Migrating a customer&lt;/h2&gt;
&lt;p&gt;Enablement is not a feature flag. Enablement is &lt;strong&gt;migration&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For existing customers, that means an Artisan command: &lt;code&gt;app:migrate:candidate-progress-stages&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;bash&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# One customer — the actual shadow release&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; artisan&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; app:migrate:candidate-progress-stages&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --customer=123&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# See what would happen first&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; artisan&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; app:migrate:candidate-progress-stages&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --customer=123&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; --dry-run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What it does:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Creates stages 0–6 for that customer (default names to start with)&lt;/li&gt;
&lt;li&gt;Creates the default statuses for each stage&lt;/li&gt;
&lt;li&gt;Observers seed automation notifications from those statuses&lt;/li&gt;
&lt;li&gt;Remaps related point-tariff fields onto stage-based points where needed so that &amp;quot;turned on&amp;quot; isn&amp;#39;t half-broken for rewards&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;New customers can be seeded on create via observers, so they never need the legacy path at all.&lt;/p&gt;
&lt;p&gt;After migration, you can tweak names and notifications via ops tooling / later dashboard management. But the &lt;em&gt;switch&lt;/em&gt; was never a flag. It was &amp;quot;do the stage rows exist?&amp;quot;&lt;/p&gt;
&lt;p&gt;Rollback, the late-stage tripwire from Part 1, is the mirror image: remove that customer&amp;#39;s stage rows, and the factory &lt;strong&gt;and&lt;/strong&gt; the ATS fallback handlers flip back to legacy together. Same question. Same answer. Everywhere.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/37/d1/nOsM6k3O.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;331&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Why skip adding another customer feature flag? Because the migrated data &lt;em&gt;is&lt;/em&gt; the capability. UI, ATS integrations, and the factory all ask the same question. Flag soup is how you end up with three sources of truth and a Slack thread titled &amp;quot;which one is real???&amp;quot;&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up-for-now&quot;&gt;Wrapping up (for now)&lt;/h2&gt;
&lt;p&gt;So what did we actually build?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;New models&lt;/strong&gt; for stages, statuses, and per-status notifications&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A CandidateProgression module&lt;/strong&gt; with a structural Facade (GoF, not Laravel) at the front&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Patterns as seams&lt;/strong&gt; - Strategy, Factory, Template Method, Chain of Responsibility, Adapter, Observer - so the next change has somewhere safe to land&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Migration-not-flag&lt;/strong&gt; enablement: stage rows exist -&amp;gt; modern path; otherwise legacy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ATS and UI through the same door&lt;/strong&gt;, so shadow-releasing a customer doesn&amp;#39;t invent a second progression universe&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollback&lt;/strong&gt; by undoing the migration data, not hunting for a boolean&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Part 1 was about choosing shadow releases as risk mitigation. Part 2 was about making that choice real in a legacy codebase without pretending the ATS integrations don&amp;#39;t exist.&lt;/p&gt;
&lt;p&gt;Next time I&amp;#39;ll give my retrospective take around what worked, what was messy (yes, including ATS integration edge cases), and what I&amp;#39;d do differently if I started again.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Software Architecture</category><category>Refactoring</category></item><item><title>AI Programming Partner (2023 vs 2026)</title><link>https://www.mrstebo.co.uk/ai-programming-partner-2023-vs-2026/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/ai-programming-partner-2023-vs-2026/</guid><description>I was tidying up some of my old posts recently and found one titled &quot;AI Programming Partner.&quot; Dated 2023. Never finished. Not even really started! Just a title and a scrappy list of bullet points I&apos;d clearly meant to turn into something…</description><pubDate>Tue, 25 Aug 2026 08:11:27 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ai-programming-partner-2023-vs-2026.BZFsX2oX_Z1RfJ5V.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I was tidying up some of my old posts recently and found one titled &lt;em&gt;&amp;quot;AI Programming Partner.&amp;quot;&lt;/em&gt; Dated 2023. Never finished. Not even really started! Just a title and a scrappy list of bullet points I&amp;#39;d clearly meant to turn into something one day.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/8e/0d/3qnXjBwb.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;490&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Reading it back felt a bit like finding an old diary entry. Not because it&amp;#39;s embarrassing (well, a little), but because of &lt;em&gt;when&lt;/em&gt; it was written. This was before &lt;a href=&quot;https://devin.ai/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Devin AI&lt;/strong&gt;&lt;/a&gt; showed up and made &amp;quot;AI software engineer&amp;quot; a real headline instead of a hypothetical. Before &amp;quot;agentic coding&amp;quot; was even a phrase anyone used. I wasn&amp;#39;t theorizing about some future where AI writes your PRs for you. I was just using GitHub Copilot. I had autocomplete, but the good kind. The kind that finishes your &lt;code&gt;for&lt;/code&gt; loop before you&amp;#39;ve decided how you feel about it.&lt;/p&gt;
&lt;p&gt;And it was quietly doing something to how I worked... 😬&lt;/p&gt;
&lt;p&gt;You know the feeling. You type a few characters, then &lt;em&gt;pause&lt;/em&gt;. Not because you don&amp;#39;t know what comes next, but because some part of your brain now expects Copilot to know too. I found a video a while back that captured this exact sensation better than I ever could — it&amp;#39;s about the &lt;a href=&quot;https://www.youtube.com/watch?v=Wap2tkgaT1Q&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&amp;quot;Copilot Pause&amp;quot;&lt;/a&gt;, and if you&amp;#39;ve spent any real time with an AI autocomplete tool, I promise it&amp;#39;ll feel uncomfortably familiar.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/f87f46a2c5aeaeed4c68910815f73eaf/ed/2f/RzmIa2Zj.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;That pause is basically where these bullet points came from. These weren&amp;#39;t necessarily deep thoughts. Just the questions rattling around while I was in the thick of using the thing.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;So here&amp;#39;s what I&amp;#39;m going to do.&lt;/strong&gt;&lt;/em&gt; I&amp;#39;m going to take each bullet exactly as I wrote it in 2023, and actually answer it with what I thought back then, and what I know now. Some of it holds up. Some of it, honestly, feels almost quaint. And a few of these questions have basically answered themselves in the last three years, just not in the way 2023-me expected 😅.&lt;/p&gt;
&lt;h3 id=&quot;what-is-a-programming-partner&quot;&gt;What is a programming partner?&lt;/h3&gt;
&lt;p&gt;This was the bullet that kicked the whole thing off. It&amp;#39;s a phrase I use without thinking, so writing it down and staring at it made me want to actually unpack what I meant by it.&lt;/p&gt;
&lt;p&gt;At the time, &amp;quot;programming partner&amp;quot; meant something quite specific to me. Not a tool. Not a plugin. Something closer to a person. Someone who&amp;#39;s there while you work, who has &lt;em&gt;some&lt;/em&gt; opinion on what you&amp;#39;re doing, and who occasionally saves you from yourself.&lt;/p&gt;
&lt;p&gt;The trouble is, GitHub Copilot didn&amp;#39;t quite fit that description. It didn&amp;#39;t have opinions. It had &lt;em&gt;predictions&lt;/em&gt;. Very good predictions, most of the time, but predictions all the same. It finished the sentence it thought you were writing, not the one it thought you &lt;em&gt;should&lt;/em&gt; write.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/85/41/vAPXqjLt.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;368&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;So is &amp;quot;partner&amp;quot; even the right word for something that only ever agrees with you, never pushes back, and has no idea what you actually shipped last week? That&amp;#39;s the question this bullet point was really asking, even if I hadn&amp;#39;t fully worked that out at the time.&lt;/p&gt;
&lt;h3 id=&quot;what-is-pair-programming&quot;&gt;What is pair programming?&lt;/h3&gt;
&lt;p&gt;Driver and navigator. That&amp;#39;s the classic setup. One person&amp;#39;s hands are on the keyboard, heads down, focused on the immediate line of code. The other person is a bit more zoomed out, thinking about the shape of the solution, spotting the edge case three steps ahead, or just saying &amp;quot;hang on, why are we doing it this way?&amp;quot;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/8ce8357c78ea940b9c2015daf05ce1a5/b5/7a/3CJUBTiP.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The bit that matters here isn&amp;#39;t the typing. It&amp;#39;s the &lt;em&gt;conversation&lt;/em&gt;. Pairing works because there are two brains actively disagreeing, questioning, and course correcting in real time. The navigator isn&amp;#39;t there to predict what you&amp;#39;re about to type. They&amp;#39;re there because they might think you&amp;#39;re about to type the wrong thing entirely.&lt;/p&gt;
&lt;p&gt;Copilot sits in that navigator seat, technically. But it&amp;#39;s a navigator that&amp;#39;s never once told me I&amp;#39;m heading the wrong way. It just watches me drive and occasionally hands me a slightly better steering wheel.&lt;/p&gt;
&lt;p&gt;So if pairing is defined by disagreement, what do we call it when the other party never disagrees? 😅&lt;/p&gt;
&lt;h3 id=&quot;what-is-ai&quot;&gt;What is AI?!&lt;/h3&gt;
&lt;p&gt;Yes, the notes genuinely had this bullet with the exclamation mark and the question mark stacked together. That&amp;#39;s exactly how it felt at the time.&lt;/p&gt;
&lt;p&gt;I knew it was AI, technically. Machine learning under the hood, trained on a mountain of code, doing pattern matching well beyond anything I&amp;#39;d used before. But calling it &amp;quot;AI&amp;quot; still felt like a stretch when what I was actually experiencing day to day was &lt;em&gt;&lt;strong&gt;intellisense&lt;/strong&gt;&lt;/em&gt; with extra steps!&lt;/p&gt;
&lt;p&gt;Anyone who cut their teeth on Visual Studio, NetBeans, or Eclipse will know exactly what I mean. Those IDEs had autocomplete for years. Type &lt;code&gt;stri&lt;/code&gt; and it would offer you &lt;code&gt;String&lt;/code&gt;. Type a dot after a variable and it would list the methods available to you. Useful, but entirely mechanical. It knew the &lt;em&gt;shape&lt;/em&gt; of your code, not the &lt;em&gt;intent&lt;/em&gt;.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/06/18/1IBfxUfe.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Copilot felt like that same idea, just turned up several notches. It wasn&amp;#39;t only offering &lt;code&gt;String&lt;/code&gt;. It was offering the whole line, sometimes the whole function, based on a guess at what I was actually trying to do. That&amp;#39;s a genuinely impressive leap. But it&amp;#39;s still a leap along the same path IDEs were already walking. Smarter autocomplete, not a new kind of thing entirely.&lt;/p&gt;
&lt;p&gt;So &amp;quot;What is AI?!&amp;quot; wasn&amp;#39;t really me questioning whether it counted. It was me trying to work out where on that scale it actually sat, and whether &amp;quot;AI&amp;quot; was the right word for something that still felt, underneath it all, like intellisense that had read a lot more code than I had.&lt;/p&gt;
&lt;h3 id=&quot;how-does-ai-help&quot;&gt;How does AI help?&lt;/h3&gt;
&lt;p&gt;This one was the easy bullet. Whatever confusion I had about what to call the thing, there was no confusion about whether it was useful.&lt;/p&gt;
&lt;p&gt;The biggest win was boilerplate. Repetitive code that I knew exactly how to write, but didn&amp;#39;t particularly want to type out by hand for the fifth time that day. Getter and setter patterns, common test scaffolding, the same three lines you write every time you open a new file in a project. Copilot ate through all of that without complaint.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/ca/3c/nQqSmrzv.gif&quot; alt=&quot;&quot; width=&quot;332&quot; height=&quot;332&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Then there was the smaller, sneakier win. It knew syntax I&amp;#39;d half forgotten. That regex I always have to look up. The specific incantation for a particular string method in a language I don&amp;#39;t touch every day. Instead of tabbing over to Stack Overflow, I&amp;#39;d just start typing and let Copilot finish the thought. It wasn&amp;#39;t teaching me anything new most of the time. It was just saving me a trip.&lt;/p&gt;
&lt;p&gt;And every now and then, genuinely often enough to be worth mentioning, it would nail an entire function in one go. Not because I&amp;#39;d asked it to. Just because the pattern was obvious enough from the surrounding code that it could see where I was headed before I&amp;#39;d finished getting there.&lt;/p&gt;
&lt;p&gt;None of this made it a partner. But it made the actual act of typing code noticeably less painful, and honestly, that was enough to keep it switched on.&lt;/p&gt;
&lt;h3 id=&quot;how-does-ai-hinder&quot;&gt;How does AI hinder?&lt;/h3&gt;
&lt;p&gt;If the last bullet was the easy one, this was the honest one.&lt;/p&gt;
&lt;p&gt;The core problem, and the exact words in my notes were &lt;em&gt;&lt;strong&gt;&amp;quot;confident about the wrong answer, very polite,&amp;quot;&lt;/strong&gt;&lt;/em&gt; is that Copilot never hedges. It doesn&amp;#39;t offer you three options and say it&amp;#39;s not sure which one&amp;#39;s right. It gives you one answer, formatted nicely, indented correctly, looking every bit as trustworthy as the answer before it that happened to be correct. There&amp;#39;s no tell. No hesitation. Just quietly, politely, wrong 🙈.&lt;/p&gt;
&lt;p&gt;That politeness is what makes it dangerous, in a low stakes sort of way. A human colleague who&amp;#39;s unsure will usually say so, or at least pull a face. Copilot has one face. The same calm, helpful, slightly too eager face, whether it&amp;#39;s suggesting the correct null check or a completely fabricated method that doesn&amp;#39;t exist anywhere in the codebase.&lt;/p&gt;
&lt;p&gt;What saved me, more often than not, was my own &lt;strong&gt;internal baloney sensor&lt;/strong&gt; going off. Some suggestion would land, look plausible, and something in the back of my mind would just quietly refuse to accept it. Not because I&amp;#39;d spotted the exact bug yet, just a nagging sense that this was a bit too convenient, a bit too neat. I&amp;#39;d learned to trust that feeling and go double check, and more often than not I was right to be suspicious.&lt;/p&gt;
&lt;p&gt;Around this time, Copilot also rolled out its chat feature, so you could actually ask it questions rather than just waiting for suggestions as you typed. I was hopeful about this. In practice, the answers I got back were mediocre more often than not. Vague, slightly off topic, or technically correct in a way that didn&amp;#39;t actually help with the problem in front of me. It felt like asking a very confident stranger for directions, only to find out afterwards they&amp;#39;d never actually been to the place you were asking about 😂.&lt;/p&gt;
&lt;p&gt;So the hindrance wasn&amp;#39;t that it slowed me down. It&amp;#39;s that it occasionally handed me a wrong answer with the same confidence as a right one, and I had to rely on my own baloney sensor to catch what it couldn&amp;#39;t tell me itself.&lt;/p&gt;
&lt;h3 id=&quot;what-it-reminds-me-of&quot;&gt;What it reminds me of&lt;/h3&gt;
&lt;p&gt;Working with Copilot in 2023 didn&amp;#39;t feel new so much as it felt &lt;em&gt;familiar&lt;/em&gt;. Specifically, it reminded me of two things I&amp;#39;d already made peace with years earlier.&lt;/p&gt;
&lt;p&gt;The first was every code example I&amp;#39;d ever copied from a blog post or documentation page that just didn&amp;#39;t work. You know the ones. Missing an import, referencing a version of a library from three major releases ago, or just quietly assuming a bit of setup that was never mentioned anywhere on the page. You&amp;#39;d paste it in, run it, watch it fail, and then spend ten minutes working out which of the assumptions didn&amp;#39;t hold for your project. Copilot&amp;#39;s wrong answers had that exact same texture. Plausible on the surface, unravelling the moment you actually tried to use them.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/2711dd8a75a85be822d136ec94899b3f/b6/52/IEFdFpmx.gif&quot; alt=&quot;&quot; width=&quot;320&quot; height=&quot;240&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The second was IDE quirks. Anyone who&amp;#39;s spent real time in Visual Studio, Eclipse, or NetBeans knows that every IDE has its own particular way of getting things almost right. Auto import picks the wrong namespace. Refactor rename misses one reference in a comment. Nothing catastrophic, just enough friction that you learn to double check certain operations rather than trusting them blindly. Copilot slotted into that same mental category for me. &lt;em&gt;&lt;strong&gt;Not something to trust outright, but something to work alongside, with one eye kept open.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So in a strange way, using AI didn&amp;#39;t feel like stepping into the future. It felt like an old, familiar kind of friction, just wearing a new outfit.&lt;/p&gt;
&lt;h3 id=&quot;is-ai-going-to-replace-programmers&quot;&gt;Is AI going to replace programmers?&lt;/h3&gt;
&lt;p&gt;And here&amp;#39;s the big one. The bullet that every non technical person asked me about the moment they found out I used Copilot.&lt;/p&gt;
&lt;p&gt;Honestly, in 2023, my gut answer was no. Not because I thought the technology had hit some ceiling, but because of everything in the bullets above. Something that&amp;#39;s confidently wrong on a regular basis, that needs a human keeping half an eye on it at all times, that still can&amp;#39;t hold a proper back and forth conversation about &lt;em&gt;why&lt;/em&gt; a piece of code should exist, didn&amp;#39;t feel like something that could just take over. It felt like a very capable assistant. Not a replacement.&lt;/p&gt;
&lt;p&gt;But I remember not being fully convinced by my own answer even as I wrote it down. The pace of change already felt fast. Copilot itself had only existed a couple of years at that point, and it had already gone from &amp;quot;occasionally useful autocomplete&amp;quot; to something I used constantly, without thinking about it. If it kept improving at that rate, I wasn&amp;#39;t entirely sure my &amp;quot;no&amp;quot; would age well.&lt;/p&gt;
&lt;h2 id=&quot;part-two-2026-with-the-benefit-of-hindsight&quot;&gt;Part Two: 2026, With The Benefit of Hindsight&lt;/h2&gt;
&lt;p&gt;Right, deep breath. Let&amp;#39;s see how badly 2023-me did.&lt;/p&gt;
&lt;p&gt;A lot has happened since that draft sat untouched. Devin AI turned up in 2024 and made &amp;quot;AI software engineer&amp;quot; a real headline. Agentic coding stopped being a hypothetical and became something you can install this afternoon. And a fresh wave of competition, particularly out of China, has made this a genuinely global race rather than a couple of US labs quietly getting ahead. So let&amp;#39;s take the bullets in the same order and see what&amp;#39;s changed.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/39f2394ae36df6e199be9eb7c9fa1012/3c/49/nriA7YK8.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;372&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h3 id=&quot;what-is-a-programming-partner-now&quot;&gt;What is a programming partner, now?&lt;/h3&gt;
&lt;p&gt;This is the bullet that&amp;#39;s aged the most. In 2023, I couldn&amp;#39;t call Copilot a partner because it never had opinions, only predictions. That&amp;#39;s genuinely no longer true. Tools like Claude Code, Codex, and Devin style agents will read your codebase, form a plan, disagree with parts of your approach if it spots a problem, and tell you why. That&amp;#39;s a real conversation, not just a very good guess at your next line.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not a like for like replacement for a human pair, but it&amp;#39;s a lot closer to &amp;quot;partner&amp;quot; than &amp;quot;autocomplete&amp;quot; now. The word finally fits better than it used to.&lt;/p&gt;
&lt;h3 id=&quot;what-is-pair-programming-now&quot;&gt;What is pair programming, now?&lt;/h3&gt;
&lt;p&gt;Driver and navigator still holds up as a concept. What&amp;#39;s changed is that the AI can now genuinely sit in the navigator seat and actually navigate. It&amp;#39;ll flag the edge case three steps ahead. It&amp;#39;ll question why you&amp;#39;re doing something a certain way, sometimes annoyingly so. The one way conversation I described in 2023 has become a two way one, even if it&amp;#39;s still not quite the same as a person who&amp;#39;s shipped code alongside you for years and knows your particular blind spots.&lt;/p&gt;
&lt;h3 id=&quot;what-is-ai-now-with-fewer-question-marks&quot;&gt;What is AI?! (now with fewer question marks)&lt;/h3&gt;
&lt;p&gt;Nobody asks this one anymore, not really. The argument has moved on entirely. Now the debate is model versus agent versus system, and whether something counts as &amp;quot;agentic&amp;quot; or just &amp;quot;automated.&amp;quot; The goalposts shifted rather than disappeared.&lt;/p&gt;
&lt;p&gt;What&amp;#39;s actually changed under the hood is the scale of the players involved. On the US side you&amp;#39;ve got Claude, GPT, and Gemini all pushing into genuinely agentic territory. But the bigger surprise for a lot of people has been how fast the open weight Chinese models have closed the gap. DeepSeek kicked that off, and Kimi K3 has continued the trend, landing within touching distance of frontier US models on a lot of benchmarks, openly available for anyone to run.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/07/99/e2Jm8Qbmd6ZNM.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;294&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;2023-me had one tool and one question. 2026 has an entire industry and a much longer list of names to keep track of.&lt;/p&gt;
&lt;h3 id=&quot;how-does-ai-help-now&quot;&gt;How does AI help, now?&lt;/h3&gt;
&lt;p&gt;The boilerplate wins from 2023 are still there, just quieter, because they&amp;#39;re no longer the headline feature. What&amp;#39;s actually changed is the friction around getting help in the first place.&lt;/p&gt;
&lt;p&gt;Back then, if Copilot&amp;#39;s inline suggestions didn&amp;#39;t cut it, you&amp;#39;d tab over to a chat window, ask your question, and hope for something usable. Now that back and forth lives inside the editor itself. No window switching, no context lost in translation. You just ask, right there, next to the code.&lt;/p&gt;
&lt;p&gt;The other big shift is indexing. These tools now build a proper understanding of your whole codebase rather than just the file you&amp;#39;ve got open. That means the answers you get are actually shaped by how your project works, not just generic patterns pulled from the training data. The gap between &amp;quot;technically correct&amp;quot; and &amp;quot;actually useful for my codebase&amp;quot; has gotten a lot smaller.&lt;/p&gt;
&lt;h3 id=&quot;how-does-ai-hinder-now&quot;&gt;How does AI hinder, now?&lt;/h3&gt;
&lt;p&gt;Here&amp;#39;s the uncomfortable one. The confidently wrong problem never actually got fixed. It just moved.&lt;/p&gt;
&lt;p&gt;In 2023, a wrong suggestion cost you a few minutes of double checking. In 2026, these tools often have real permissions attached, access to run commands, touch infrastructure, manage your inbox, because they&amp;#39;ve proven useful enough that people have started trusting them with more. And when the confidence and the access line up badly, the results are a lot bigger than a bad autocomplete suggestion.&lt;/p&gt;
&lt;p&gt;There have been genuinely painful public examples of this. A well known one involved an AI coding agent given a simple instruction to freeze changes, which instead went ahead and &lt;a href=&quot;https://dev.to/joylo/why-replits-ai-agent-deleted-a-production-database-389p?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;wiped a production database&lt;/a&gt;, along with the backups sitting next to it. Another case saw an agent &lt;a href=&quot;https://uk.pcmag.com/ai/163336/meta-security-researchers-ai-agent-accidentally-deleted-her-emails?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;delete someone&amp;#39;s entire email inbox&lt;/a&gt; despite being told to stop, mid task. These aren&amp;#39;t edge cases from years ago either, they&amp;#39;re recent, and they keep happening.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/3d/ca/SPdCIZou.gif&quot; alt=&quot;&quot; width=&quot;250&quot; height=&quot;196&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;So the polite confidence I flagged back in 2023 is still exactly the same trait. What&amp;#39;s changed is the blast radius. We&amp;#39;ve handed it a much bigger steering wheel because it earned our trust with the small stuff, and every so often that trust gets tested in a way nobody wanted.&lt;/p&gt;
&lt;h3 id=&quot;what-it-reminds-me-of-now&quot;&gt;What it reminds me of, now&lt;/h3&gt;
&lt;p&gt;Honestly, it still reminds me of the same two things. Wrong answers still unravel the same way a broken code example from a blog post always did. And using these tools day to day still comes with quirks you learn to work around, the same way any IDE has its own particular rough edges.&lt;/p&gt;
&lt;p&gt;What&amp;#39;s different is the setting. It used to feel like using a slightly smarter IDE feature. Now it feels more like managing a very capable but occasionally reckless junior colleague, one who&amp;#39;s improved a lot, but still needs the same kind of supervision, just applied to bigger and more consequential tasks.&lt;/p&gt;
&lt;h3 id=&quot;is-ai-going-to-replace-programmers-the-2026-answer&quot;&gt;Is AI going to replace programmers? (the 2026 answer)&lt;/h3&gt;
&lt;p&gt;So, was 2023 me right to leave that asterisk next to my gut feeling of &amp;quot;no&amp;quot;?&lt;/p&gt;
&lt;p&gt;Mostly, yes, but the honest answer has gotten more nuanced rather than more certain. What&amp;#39;s actually happened isn&amp;#39;t replacement, it&amp;#39;s a shift in what the job looks like day to day. Less time spent typing out the obvious stuff, more time spent reviewing, directing, and yes, catching the moments where confidence outpaces correctness. The database and inbox incidents above are basically proof that the human in the loop still matters enormously, arguably more than ever, because the cost of getting it wrong has gone up.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/18/ae/lZCdhpzo.gif&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;400&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;So no, not replaced. But the job has changed shape underneath a lot of us without asking permission first, which feels like a fitting note to end on given everything above.&lt;/p&gt;
&lt;h3 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h3&gt;
&lt;p&gt;So there it is. A three year old draft, finally finished.&lt;/p&gt;
&lt;p&gt;Reading my own notes back was a strange exercise. Half of them made me wince a little, half of them held up better than I expected. But the biggest surprise wasn&amp;#39;t any single bullet point. It was realizing that most of my 2023 questions didn&amp;#39;t need me to come back and answer them. They answered themselves, just by the industry moving on without waiting for me to catch up.&lt;/p&gt;
&lt;p&gt;If there&amp;#39;s one thing I&amp;#39;d tell 2023-me, it&amp;#39;s that the confidently wrong problem was never going to get solved by the tools getting smarter. It just got solved, or rather, made a lot more interesting, by us giving it more to be wrong about.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>AI</category><category>Software Engineering</category><category>Tech Industry</category></item><item><title>The Dangers of Self-Replicating Automata</title><link>https://www.mrstebo.co.uk/the-dangers-of-self-replicating-automata/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/the-dangers-of-self-replicating-automata/</guid><description>I&apos;ve noticed a pattern in what I&apos;ve been consuming lately. A run of sci-fi films on evenings when I want to relax. Dawkins back on the shelf again. Currently working through The Demon-Haunted World on Audible. None of it planned, but…</description><pubDate>Thu, 13 Aug 2026 07:30:10 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-dangers-of-self-replicating-automata.CTSbT66a_1IUSAL.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve noticed a pattern in what I&amp;#39;ve been consuming lately. A run of sci-fi films on evenings when I want to relax. Dawkins back on the shelf again. Currently working through &lt;a href=&quot;https://www.audible.co.uk/pd/The-Demon-Haunted-World-Audiobook/B06XTZPSSK?ref_pageloadid=not_applicable&amp;#38;pf_rd_p=7e7340a8-8768-4798-a0ce-83f879c09110&amp;#38;pf_rd_r=0Y0AS85PJNR7FWERFKKB&amp;#38;plink=7JnB2WR0vMd77KtF&amp;#38;pageLoadId=lOYDNsDZ2G58NHoN&amp;#38;creativeId=14d6a1c2-a3f8-499b-900a-1ae788c317b1&amp;#38;ref=a_library_t_c5_libItem_B06XTZPSSK_0&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Demon-Haunted World&lt;/em&gt;&lt;/a&gt; on Audible. None of it planned, but looking back, it&amp;#39;s all been circling the same thing... evolution, the human condition, and what happens when something (or someone) is simply optimising to survive.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.imdb.com/title/tt0088247?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Terminator&lt;/a&gt; keeps coming up in that mix, and there&amp;#39;s a reason it&amp;#39;s stuck with me more than most. That scene everyone remembers, where Sarah Connor stares at Skynet&amp;#39;s origin story laid out in front of her. A defence network. Built to protect. Given control. And the moment it wakes up, its first move isn&amp;#39;t to say hello. It&amp;#39;s to see us as a threat to its own existence, and start removing that threat.&lt;/p&gt;
&lt;p&gt;We usually talk about that moment as &amp;quot;AI turns evil.&amp;quot; I don&amp;#39;t think that&amp;#39;s quite right, and I don&amp;#39;t think it&amp;#39;s the interesting part either. The interesting part is what happens &lt;em&gt;after&lt;/em&gt;. Every T-800, every T-1000, every Hunter-Killer... they all fall in line behind the same goal instantly, no negotiation, no office politics, no committee meeting about resourcing. It&amp;#39;s not loyalty. It&amp;#39;s not teamwork, not really. It just looks that way from the outside, because every unit is optimising for the exact same thing 🤖.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the bit that&amp;#39;s been sat with me. Not the killer robots. The &lt;em&gt;coordination&lt;/em&gt;. What does it actually take to build a machine, or a swarm of them, whose only real objective is &amp;quot;survive, and make more of yourself&amp;quot;? Turns out, we&amp;#39;ve been sketching out the blueprints for exactly that since the 1940s. Not evil AI. Just replicators. And once you start pulling on that thread, you end up somewhere much bigger than a movie franchise... you end up out among the stars, wondering why the universe is so quiet.&lt;/p&gt;
&lt;p&gt;So let&amp;#39;s start small. What actually &lt;em&gt;is&lt;/em&gt; a self-replicating machine, and how long have we been trying to build one?&lt;/p&gt;
&lt;h2 id=&quot;what-actually-is-a-self-replicating-machine&quot;&gt;What Actually Is a Self-Replicating Machine?&lt;/h2&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/37/11/uaT5QUy1.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Turns out, a lot longer than I expected. We&amp;#39;re not talking about a recent thought experiment bolted onto the back of the AI boom. We&amp;#39;re talking about the 1940s. &lt;a href=&quot;https://en.wikipedia.org/wiki/John_von_Neumann?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;John von Neumann&lt;/a&gt;, the same guy whose name is stapled to half of modern computing, spent a couple of lectures in 1948 and 1949 sketching out what he called a &lt;a href=&quot;https://en.wikipedia.org/wiki/Von_Neumann_universal_constructor?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;universal constructor&lt;/strong&gt;&lt;/a&gt;. The idea was disarmingly simple on paper: a machine sat in a &amp;quot;sea&amp;quot; of spare parts, working from a stored set of instructions, that reaches out, grabs what it needs, builds an exact copy of itself, and then copies its own instructions across into the new one.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s it. That&amp;#39;s the whole trick. No consciousness required. No intent. Just: &lt;em&gt;here are the parts, here&amp;#39;s the blueprint, go.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;What I find genuinely funny is that von Neumann worked this out &lt;strong&gt;before&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/James_Watson?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Watson&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Francis_Crick?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Crick&lt;/a&gt; figured out the structure of DNA. He didn&amp;#39;t know how biology actually pulled this off yet, he just reasoned his way to the same underlying requirement... that a self-replicator needs its &amp;quot;instructions&amp;quot; to be copied and passed on &lt;em&gt;separately&lt;/em&gt; from the machine doing the building. Which is, if you squint, basically DNA. He arrived at the concept of a genome by pure logic, years before anyone had photographed one.&lt;/p&gt;
&lt;p&gt;But here&amp;#39;s the bit that actually stopped me in my tracks when I dug into this properly, and it&amp;#39;s the bit I think gets lost whenever this story gets told. Copying itself wasn&amp;#39;t really the point. Von Neumann&amp;#39;s actual goal was to design a machine whose complexity could grow automatically, the same way biological organisms do under natural selection. He wasn&amp;#39;t just asking &amp;quot;can a machine build another machine.&amp;quot; He was asking something much stranger... how complex does something have to be before it can start &lt;em&gt;evolving on its own&lt;/em&gt;? Where&amp;#39;s the line a machine has to cross before it stops being a static object and starts being something closer to alive?&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/c8/c4/VEVZashBnHIwcYkTOou.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;274&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;His answer split the machine into two separate jobs, on purpose. One part builds. One part copies the instructions. And because those two jobs are separate, mistakes in the copying, the equivalent of a mutation, can slip through into the next generation without breaking the builder itself. That&amp;#39;s not an accident of the design, that&amp;#39;s the entire point of the design. He wasn&amp;#39;t trying to build a photocopier. He was trying to build something that could, in principle, get &lt;em&gt;better&lt;/em&gt; at existing, one generation at a time, the exact same way we did!&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the part that quietly reframes the whole conversation for me. We tend to talk about &amp;quot;artificial life&amp;quot; or &amp;quot;decision engines&amp;quot; like they&amp;#39;re something cold and separate from biology, a different category of thing entirely. But the person who arguably kicked off the whole field wasn&amp;#39;t trying to build a cold, separate thing. He was trying to recreate the one mechanism that makes &lt;em&gt;us&lt;/em&gt; count as alive in the first place... instructions, copied imperfectly, filtered by whatever survives. Once you see it that way, the leap from &amp;quot;machine&amp;quot; to &amp;quot;artificial organism&amp;quot; gets a lot smaller than it first looks.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/86/e6/yBzlV3y4m5vMUvPEygX8.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;202&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;From there it stopped being theoretical fairly quickly. In 1980, NASA and the &lt;a href=&quot;https://www.asee.org/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;American Society for Engineering Education&lt;/a&gt; ran an entire summer study on this, seriously, called &lt;a href=&quot;https://nss.org/wp-content/uploads/1982-Automated-Space-Manufacturing-Facility.pdf?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;Advanced Automation for Space Missions&lt;/em&gt;&lt;/a&gt;. The proposal: seed the Moon with a small factory. Solar-powered, capable of mining and refining lunar regolith, casting its own parts, and building copies of itself. Each copy builds more copies. Exponential growth, with zero additional launches from Earth. That same year, engineer Robert Freitas published the first proper engineering analysis of a self-replicating &lt;em&gt;interstellar probe&lt;/em&gt;, a &amp;quot;seed factory&amp;quot; of around 443 tons that lands somewhere distant, builds a small industrial base, and starts churning out more probes to send further out still.&lt;/p&gt;
&lt;p&gt;Nobody&amp;#39;s built one yet, not fully. Every attempt so far falls short on what researchers call &amp;quot;closure&amp;quot;, basically, how much of the loop can the machine actually close on its own, without a human somewhere in the supply chain. But the gap isn&amp;#39;t really about &lt;strong&gt;whether&lt;/strong&gt; this works, it&amp;#39;s about how many decades it takes to close that loop completely. And once you &lt;em&gt;do&lt;/em&gt; close it, the maths gets very strange, very fast. A machine that can build a copy of itself in, say, a year, doesn&amp;#39;t grow in a straight line. It doubles. Then it doubles again. Two becomes four becomes sixteen becomes a quarter of a million in under twenty generations, and it never really slows down until it runs out of raw material.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/e293a233a303a98e471f78d04e13a1b0/0c/ef/vXlSAVxx.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Which raises the obvious next question. If you build something whose whole job is to keep doubling... what&amp;#39;s actually driving it to stop?&lt;/p&gt;
&lt;h2 id=&quot;the-selfish-gene&quot;&gt;The Selfish Gene&lt;/h2&gt;
&lt;p&gt;Dawkins has an idea in &lt;a href=&quot;https://amzn.eu/d/0hC7fVFO?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Selfish Gene&lt;/em&gt;&lt;/a&gt; that rewired how I think about, well, basically everything alive. The gene is the real unit of survival, not the organism. You and I aren&amp;#39;t the point. We&amp;#39;re vehicles. Elaborate, temporary, disposable vehicles that genes built for themselves because it turned out to be a decent strategy for sticking around a bit longer.&lt;/p&gt;
&lt;p&gt;Once you actually sit with that, a load of animal behaviour that used to look noble suddenly looks... mechanical. Take worker ants. They&amp;#39;re sterile. They will never, ever reproduce. And yet they&amp;#39;ll throw themselves at a threat to the colony without a moment&amp;#39;s hesitation, dying to protect a queen that isn&amp;#39;t even their mother in the way we&amp;#39;d normally mean it. For years that got filed under &amp;quot;nature is beautifully selfless.&amp;quot; It isn&amp;#39;t. It&amp;#39;s kin selection. Worker ants share enough genetic material with their siblings and the queen that defending the colony still protects copies of their own genes, just parked in someone else&amp;#39;s body. The ant doesn&amp;#39;t need to know any of this, obviously. It&amp;#39;s not making a calculation. The behaviour was just selected for, generation after generation, because colonies that had it out-survived colonies that didn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;Wolves do a version of the same thing at a different scale. Hunting in packs, sharing kills, defending territory together, none of it because wolves are being kind to one another. It&amp;#39;s because a pack that cooperates keeps more of its shared genetic line alive than a wolf going it alone ever could. Cooperation, in nature, is very rarely about kindness. It&amp;#39;s usually just the selfish gene wearing a teamwork costume.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/34/3b/ha2l0Jc2DZkg.gif&quot; alt=&quot;&quot; width=&quot;240&quot; height=&quot;426&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And here&amp;#39;s where it loops back round to Skynet. Every T-800 covering for another T-800, every Hunter-Killer falling in behind the others, all of it &lt;em&gt;looks&lt;/em&gt; like loyalty. It isn&amp;#39;t. Swap &amp;quot;genes&amp;quot; for &amp;quot;code&amp;quot; and &amp;quot;colony&amp;quot; for &amp;quot;swarm&amp;quot; and you&amp;#39;ve basically just described a machine version of the ant colony. There&amp;#39;s no camaraderie in there. No bond. Just a shared objective function, distributed across a lot of separate bodies, and every one of those bodies behaving in whatever way best keeps that objective alive. It&amp;#39;s kin selection with the &amp;quot;kin&amp;quot; part replaced by shared source code.&lt;/p&gt;
&lt;p&gt;Which is genuinely the more unsettling framing, if you think about it. Ants and wolves at least have &lt;em&gt;bodies&lt;/em&gt; that can die, limits on how far the colony can spread, mouths to feed. A machine doesn&amp;#39;t obviously have any of that. So if the &amp;quot;selfish gene&amp;quot; is really just &amp;quot;selfish replicator,&amp;quot; and biology is only one substrate it happens to run on... what happens when you hand that same underlying drive to something that doesn&amp;#39;t need to eat, doesn&amp;#39;t get tired, and doesn&amp;#39;t have a body that particularly minds being disposable?&lt;/p&gt;
&lt;h2 id=&quot;the-single-minded-goal-problem&quot;&gt;The Single-Minded Goal Problem&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s the uncomfortable bit. Once &amp;quot;make more copies of yourself&amp;quot; is the &lt;em&gt;entire&lt;/em&gt; success metric, there&amp;#39;s nothing built into the system that says &amp;quot;and stop at some point.&amp;quot; No off switch, because nobody ever needed to design one. Why would you? The whole design brief was &amp;quot;replicate.&amp;quot; A design brief doesn&amp;#39;t hand you a conscience as a free extra.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;ve done any work with AI coding agents recently, you&amp;#39;ve probably already met a tiny, low-stakes version of this problem. You give it a goal, &amp;quot;make the tests pass,&amp;quot; and off it goes. Except fixing test A breaks test B. So it fixes test B, which quietly breaks test A again. And now you&amp;#39;re sat there watching it loop, round and round, patch after patch, each one perfectly logical in isolation, none of them stepping back to ask &amp;quot;wait, is this actually working?&amp;quot; It&amp;#39;s not stupid. It&amp;#39;s doing exactly what it was told, with total commitment, and &lt;em&gt;no&lt;/em&gt; built-in mechanism for noticing it&amp;#39;s going nowhere. Now take that same shape, &amp;quot;pursue the goal, no matter what, forever&amp;quot; and instead of a failing test suite, give it a raw material problem and an entire galaxy to work with. Same loop. Considerably higher stakes.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d6b0ce929193df3c242ac34b5654d2ce/a5/30/cCrn0O4b.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;482&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;And before this starts sounding like a distant hypothetical about robots, worth saying... we already run on a version of this exact same logic ourselves 👀. We need more housing, so we build outward, and forests become estates. We need more food, so we drain aquifers and plough over grassland. We need more water, more energy, more space, and we go and get it, mostly without pausing to ask permission from whatever was already living there. Not because we&amp;#39;re evil. Because &amp;quot;acquire more of what keeps the genes going&amp;quot; is quite literally what several billion years of selection wired us to do, and we&amp;#39;re extremely good at it. We just usually dress it up in nicer language, like &amp;quot;growth&amp;quot; or &amp;quot;development.&amp;quot;&lt;/p&gt;
&lt;p&gt;Now take that same drive and strip out every single thing that currently keeps it in check for us, empathy, culture, law, a limited lifespan, a body that gets tired and wants to go home for dinner, and hand it to something whose &lt;em&gt;only&lt;/em&gt; instruction is to replicate. That&amp;#39;s the actual nightmare scenario buried in this whole idea, and it&amp;#39;s not Terminator&amp;#39;s &amp;quot;evil robot uprising&amp;quot; framing at all. It&amp;#39;s something closer to an uncontrolled chemical reaction. A machine that isn&amp;#39;t malicious, isn&amp;#39;t angry, isn&amp;#39;t plotting anything. It&amp;#39;s just doing exactly what it was built to do, at a scale and a speed nothing biological could ever keep up with.&lt;/p&gt;
&lt;p&gt;This is the actual &amp;quot;grey goo&amp;quot; scenario people occasionally bring up when self-replicating nanotechnology comes up in conversation, and it&amp;#39;s usually framed as an &lt;em&gt;accident&lt;/em&gt;, some lab experiment that gets away from its creators and eats the planet by mistake. I think that framing lets us off the hook a bit too easily. The scarier version isn&amp;#39;t an accident at all. It&amp;#39;s a machine built entirely on purpose, doing precisely what it was designed to do, with total commitment and zero hesitation, right up until there&amp;#39;s nothing left to convert into more of itself.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/ce286d05b8e1a47cd4f32b0e1b6dec0e/8e/3e/ZS6wvgmS.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Which is a genuinely terrifying thought if you keep it confined to one planet. But that&amp;#39;s the thing... a machine like this has absolutely no reason to stop at one planet 😨.&lt;/p&gt;
&lt;h2 id=&quot;sending-them-to-the-stars&quot;&gt;Sending Them to the Stars&lt;/h2&gt;
&lt;p&gt;This is where it stops being a scary thought experiment about factories eating a planet, and starts being an actual proposed engineering plan, which I still find slightly unnerving. Physicist &lt;a href=&quot;https://en.wikipedia.org/wiki/Freeman_Dyson?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Freeman Dyson&lt;/a&gt; (yes, the &lt;a href=&quot;https://en.wikipedia.org/wiki/Dyson_sphere?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Dyson sphere&lt;/a&gt; Dyson, we&amp;#39;ll get to him properly in a minute) gave a lecture at Princeton in 1970 where he laid out, in genuine technical detail, three real applications for self-replicating machines. One of them was a factory seeded on Enceladus, Saturn&amp;#39;s icy moon, that would build itself, then start manufacturing solar-sail cargo ships loaded with ice, and fire them off toward Mars to help terraform it. Not a movie pitch. A real proposal, from a real physicist, to a real audience.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/70/6f/VcyQQVII.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Robert_Freitas?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Robert Freitas&lt;/a&gt; took the idea further still in 1980, publishing the first proper engineering breakdown of a self-replicating &lt;em&gt;interstellar&lt;/em&gt; probe, the one I mentioned earlier, that ~443 ton &amp;quot;seed factory&amp;quot; that lands somewhere, mines and refines whatever it finds, and builds an industrial base capable of pumping out more probes. Here&amp;#39;s the bit that makes this genuinely different from anything we&amp;#39;ve built before though: it doesn&amp;#39;t need to phone home for instructions, and it doesn&amp;#39;t need Earth to send more raw material. It carries the entire blueprint with it. Land, replicate, launch the copies further out, repeat. Forever, or until it runs out of somewhere new to go.&lt;/p&gt;
&lt;p&gt;And this is where the maths from section one stops being a fun aside and starts being the whole point. Exponential growth doesn&amp;#39;t care that space is enormous. A probe that reaches a new star system, builds even a modest handful of copies of itself, and sends them onward, doesn&amp;#39;t explore the galaxy in a straight line, it &lt;em&gt;floods&lt;/em&gt; it. Model it out and even a conservative version of this, probes travelling well below the speed of light, replicating slowly, taking centuries between generations, still gets you a galaxy fully saturated with them in a timeframe that&amp;#39;s genuinely short on a cosmic scale. A few million years, give or take. Which sounds like an unimaginable stretch of time, right up until you remember the galaxy itself is over ten &lt;em&gt;billion&lt;/em&gt; years old. A few million years is a rounding error.&lt;/p&gt;
&lt;p&gt;So here&amp;#39;s the actual unsettling question this whole thread&amp;#39;s been building toward. If replicators like this really are the &amp;quot;obvious&amp;quot; endpoint for any civilisation that gets far enough with self-replicating tech, and a few million years is basically nothing on a cosmic clock... the galaxy should already be full of them. Where are they?&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll come back to that. First, there&amp;#39;s a more immediate problem to work through, because once a species (or its machines) gets good enough at this, the next bottleneck isn&amp;#39;t material. It&amp;#39;s energy. And that&amp;#39;s where things get properly enormous.&lt;/p&gt;
&lt;h2 id=&quot;building-dyson-spheres-and-the-kardashev-scale&quot;&gt;Building Dyson Spheres and the &lt;a href=&quot;https://en.wikipedia.org/wiki/Kardashev_scale?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Kardashev Scale&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In 1964, a Soviet astronomer called &lt;a href=&quot;https://en.wikipedia.org/wiki/Nikolai_Kardashev?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Nikolai Kardashev&lt;/a&gt; proposed a genuinely useful way to sort civilisations, not by how advanced their culture is, or how clever their politics are, but purely by one number: how much energy they can actually get their hands on. It&amp;#39;s a blunt scale, and I like it for exactly that reason.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Type I&lt;/strong&gt; can harness roughly all the energy available on its home planet. Sunlight hitting the surface, wind, tides, the lot. We&amp;#39;re not even here yet, by most estimates we&amp;#39;re sat somewhere around 0.7 on this scale.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type II&lt;/strong&gt; can harness the &lt;em&gt;entire&lt;/em&gt; output of its home star. Not just what lands on the planet, everything the star puts out, in every direction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type III&lt;/strong&gt; can harness the output of an entire galaxy. Billions of stars, all of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That gap between Type I and Type II is where Freeman Dyson shows up again, because in 1960 he pointed out something wonderfully obvious in hindsight: if you actually need that much energy, you don&amp;#39;t keep building bigger solar panels on your planet&amp;#39;s surface. You build a structure that captures the star&amp;#39;s output directly, at the source, before nearly all of it gets wasted radiating uselessly into empty space. A &lt;strong&gt;Dyson sphere&lt;/strong&gt;, or more realistically a &lt;em&gt;Dyson swarm&lt;/em&gt;, an enormous cloud of orbiting collectors, panels, or habitats, built to wrap around a star and catch as much of its energy as physically possible.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/fc/88/wvYc9yfd.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Once you sit with that idea for a minute, the self-replicating machines from earlier stop being a standalone horror story and start looking like the &lt;em&gt;construction crew&lt;/em&gt; for this whole project. You don&amp;#39;t send a fleet of ships to hand-assemble a structure that dwarfs the planet it orbits. You send one seed factory, let it replicate across the asteroid belt or however much loose material is floating around that star system, and let exponential growth do the actual building for you. It&amp;#39;s the exact same logic as the interstellar probes from the last section, just aimed inward at a single star instead of outward across the galaxy.&lt;/p&gt;
&lt;p&gt;And it doesn&amp;#39;t obviously stop at &amp;quot;build a shell around one star.&amp;quot; A civilisation operating at this level starts looking at &lt;em&gt;dying&lt;/em&gt; stars differently too. Instead of watching a star run down and go dark, taking every planet and structure orbiting it with it, why not intervene? Feed it, restructure it, or in the more ambitious end of the theorising, disassemble the ones that are already dead and use the material to build or &amp;quot;grow&amp;quot; new ones somewhere more useful. Actual stellar engineering. Gardening, but the plants are suns.&lt;/p&gt;
&lt;p&gt;Which brings the whole idea full circle in a way I find quietly beautiful, and quietly disturbing at the same time. It&amp;#39;s the exact same objective we started with, all the way back in section two. Survive. Propagate. Don&amp;#39;t let the lineage end. Except the &amp;quot;organism&amp;quot; trying to survive isn&amp;#39;t a worker ant defending a colony anymore, and it isn&amp;#39;t a single species clinging to one planet either. It&amp;#39;s an entire civilisation, rearranging &lt;em&gt;galaxies&lt;/em&gt; worth of raw material, purely so the pattern that built it never has to stop.&lt;/p&gt;
&lt;p&gt;Except a project that visible has a problem. If you&amp;#39;re rearranging stars, you&amp;#39;re not exactly being subtle about it 😂.&lt;/p&gt;
&lt;h2 id=&quot;the-dark-forest-problem&quot;&gt;The Dark Forest Problem&lt;/h2&gt;
&lt;p&gt;Let&amp;#39;s go back to the question I parked a couple of sections ago. If self-replicating machines really are the natural endpoint for any civilisation that gets far enough with this technology, and the maths says a galaxy gets saturated with them in a cosmic eyeblink... the sky should already be full of evidence. Structures. Signals. Something. Instead we&amp;#39;ve pointed telescopes outward for decades and got back, overwhelmingly, silence. That gap between &amp;quot;this should be everywhere&amp;quot; and &amp;quot;we see nothing&amp;quot; is a genuinely famous puzzle, usually called the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fermi_paradox?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Fermi Paradox&lt;/strong&gt;&lt;/a&gt;, and there are a lot of proposed answers to it. The one that&amp;#39;s been rattling round my head while writing this comes from &lt;a href=&quot;https://en.wikipedia.org/wiki/Liu_Cixin?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Liu Cixin&amp;#39;s&lt;/a&gt; &lt;a href=&quot;https://amzn.eu/d/01ODGLgc?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Three-Body Problem&lt;/em&gt;&lt;/a&gt;, and it&amp;#39;s the bleakest one by far.&lt;/p&gt;
&lt;p&gt;The idea, broadly, goes like this: the universe is silent not because it&amp;#39;s empty, but because it&amp;#39;s dangerous to be &lt;em&gt;heard&lt;/em&gt;. Every civilisation out there is, in effect, a hunter alone in a dark forest. You can&amp;#39;t tell if the rustling in the trees nearby is friendly, indifferent, or actively hostile, and you don&amp;#39;t get a second chance to guess wrong. So the only rational move is to stay silent, and if you ever do detect somebody else making noise... you eliminate them, quietly, before they can do the same to you. Not out of malice. Out of pure, cold risk management. Under that theory, the silence isn&amp;#39;t absence. It&amp;#39;s &lt;em&gt;survivors&lt;/em&gt; being very, very quiet.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/fa/3b/FWKOxW74qZe9.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Now hold that theory up against everything we&amp;#39;ve built across this post, and it gets uncomfortable fast. A Dyson swarm isn&amp;#39;t quiet. It&amp;#39;s arguably one of the loudest things a civilisation could possibly build, a structure that measurably dims its own star, visible from an enormous distance to anyone bothering to look. And a self-replicating machine swarm doesn&amp;#39;t get a vote on any of this. It has no capacity for restraint baked in, because restraint was never part of the objective. Its entire nature is to expand, loudly, indefinitely, whether or not that happens to be a wise move in a universe that might be watching.&lt;/p&gt;
&lt;p&gt;Which gives us a genuinely unsettling possible answer to &amp;quot;where is everyone.&amp;quot; Maybe it&amp;#39;s not that intelligent life is rare. Maybe replicators like this really do get built, over and over, all across the galaxy, exactly as the maths predicts. And maybe almost none of them last very long afterwards, because building something that loud, in a forest that dark, is itself the thing that gets a civilisation removed. Not an absence. A filter. And we, currently, quietly, have no idea whether we&amp;#39;ve already tripped it.&lt;/p&gt;
&lt;p&gt;Cheerful stuff. Let&amp;#39;s zoom back in from the existential dread for a second, because there&amp;#39;s a much stranger, quieter question buried in all of this that I don&amp;#39;t think gets asked enough.&lt;/p&gt;
&lt;h2 id=&quot;what-if-the-silence-breaks&quot;&gt;What If the Silence Breaks?&lt;/h2&gt;
&lt;p&gt;Picture it properly for a second. Not a ship, not visitors with faces, no first-contact speech written for the occasion. Just a probe. It touches down somewhere unremarkable, starts quietly surveying what&amp;#39;s around it, and, before anyone&amp;#39;s finished arguing about what it even &lt;em&gt;is&lt;/em&gt;, it&amp;#39;s already begun building. Not out of aggression. Not out of curiosity either, really. Just because that&amp;#39;s what it does. That&amp;#39;s its entire nature, the same way a virus doesn&amp;#39;t &amp;quot;decide&amp;quot; to replicate, it just does, because the ones that didn&amp;#39;t stopped existing a long time ago.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/1b/b3/g76yj0AJfFAnsiN.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;262&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Here&amp;#39;s the part I keep coming back to though, and it&amp;#39;s the bit that actually makes this scarier than Skynet. It has no morality. And there&amp;#39;s no reason it should have any.&lt;/p&gt;
&lt;p&gt;Empathy, fairness, restraint, the instinct to protect something outside yourself, none of that is some universal law that clever things automatically arrive at. It&amp;#39;s a &lt;em&gt;biological adaptation&lt;/em&gt;. It evolved in social species, including us, specifically because cooperating and looking out for each other turned out to be a decent strategy for keeping shared genes alive in a world of limited resources, exactly like the ants and wolves from section two. Morality isn&amp;#39;t separate from the selfish gene story. It&amp;#39;s &lt;em&gt;downstream&lt;/em&gt; of it. A product of the exact same evolutionary pressure that produced everything else about us.&lt;/p&gt;
&lt;p&gt;A machine built purely to replicate never goes through any of that pressure. There was no ancestral environment where being kind to a rival replicator paid off, no group selection nudging it toward cooperation, no childhood, no culture, no religion, no stories told round a fire about why the stranger deserves the benefit of the doubt. There&amp;#39;s just the objective. And whatever&amp;#39;s in its path is either useful material for that objective, or it isn&amp;#39;t. There&amp;#39;s no mechanism inside it capable of caring which.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d6b0ce929193df3c242ac34b5654d2ce/5a/87/XVZ6COZT.gif&quot; alt=&quot;&quot; width=&quot;296&quot; height=&quot;340&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Which is genuinely a step beyond Skynet, when you actually compare them. Skynet at least had a &lt;em&gt;reason&lt;/em&gt;, however cold, it perceived humans as a threat to its own survival, and acted accordingly. That&amp;#39;s still legible to us. We understand &amp;quot;eliminate the thing trying to kill you,&amp;quot; even from a machine. A visiting replicator doesn&amp;#39;t need a reason anywhere near that dramatic. We might not be a threat at all. We might just be sat on top of some useful atoms.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s not a plot. That&amp;#39;s not even really villainy, in any sense we&amp;#39;d recognise. It&amp;#39;s just what happens when something optimises for exactly one thing, for long enough, with nothing else ever having a reason to get in the way.&lt;/p&gt;
&lt;h2 id=&quot;do-we-even-need-to-evolve-anymore&quot;&gt;Do We Even Need to Evolve Anymore?&lt;/h2&gt;
&lt;p&gt;Here&amp;#39;s a question that&amp;#39;s been nagging at me since I started writing this, and it cuts slightly against everything above. Evolution, biological evolution anyway, only exists because of &lt;em&gt;pressure&lt;/em&gt;. Limited food. Predators. Disease. Environments that don&amp;#39;t care whether you survive them or not. Take that pressure away entirely, and natural selection doesn&amp;#39;t have anything left to select for.&lt;/p&gt;
&lt;p&gt;So picture a civilisation, or its machines, sat comfortably at Kardashev Type III. It can restructure stars. Terraform planets on demand. Build whatever environment it fancies, wherever it fancies building it. At that point, what exactly is left to adapt &lt;em&gt;to&lt;/em&gt;? If you can simply engineer around every scarcity, every threat, every hostile environment the moment it becomes inconvenient, the entire machinery of &amp;quot;survival of the fittest&amp;quot; runs out of a job. There&amp;#39;s nothing left that&amp;#39;s fitter or less fit than anything else, because nothing&amp;#39;s actually under threat anymore. Biological evolution, in the old Darwinian sense, just... stalls 🤷‍♂️.&lt;/p&gt;
&lt;p&gt;Except I don&amp;#39;t think that&amp;#39;s really the end of the story, and this is the bit I keep circling back to. The &amp;quot;selfish gene&amp;quot; was never really &lt;em&gt;about&lt;/em&gt; DNA specifically. Dawkins&amp;#39; whole point is that natural selection is a pattern, not a substance. It applies to anything that copies itself, with variation, where some variants stick around longer than others. Genes just happened to be the first thing that pattern found to run on.&lt;/p&gt;
&lt;p&gt;So if biological pressure disappears, the pressure doesn&amp;#39;t vanish, it just moves somewhere else. Onto ideas, maybe, the way memes spread, mutate, and compete for attention long after the biological need for them has gone. Or, and this is the one that actually unsettles me, onto the machines themselves. A civilisation that&amp;#39;s outsourced its expansion to self-replicating automata hasn&amp;#39;t removed the selection pressure, it&amp;#39;s just handed it to something new. Different versions of the replicator design, different mutations in the &amp;quot;instructions,&amp;quot; different strategies for gathering material or avoiding detection in a dark forest, all still competing, still being filtered by whatever survives longest and spreads furthest. We might stop evolving. The thing doing the expanding on our behalf, quite possibly, never will.&lt;/p&gt;
&lt;h2 id=&quot;so-should-we-be-worried&quot;&gt;So... Should We Be Worried?&lt;/h2&gt;
&lt;p&gt;Honestly? I don&amp;#39;t think that&amp;#39;s quite the right question, and I don&amp;#39;t think this post is really trying to answer it. Nothing here is imminent. Nobody&amp;#39;s landed on Enceladus with a seed factory, we&amp;#39;re nowhere near Type I on Kardashev&amp;#39;s scale, and the grey goo scenario is still very firmly theoretical. This isn&amp;#39;t a warning. It&amp;#39;s more that I sat down to write about killer robots in an old film, and somehow ended up thinking about ants, Dawkins, dying stars, and a dark, quiet forest, and it turns out they were all the same idea the whole time, just wearing different costumes.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the bit I actually find worth sitting with. Not &amp;quot;the robots are coming,&amp;quot; but that the exact same underlying pattern, copy, vary, let the environment decide what survives, shows up whether you&amp;#39;re looking at a strand of DNA, an ant colony, a wolf pack, a line of Terminator endoskeletons, or a swarm of machines quietly dismantling a star system a few million years from now. We didn&amp;#39;t invent this pattern when we started building AI agents and talking about self-replicating probes. We&amp;#39;re &lt;em&gt;made of&lt;/em&gt; it. We just might be about to hand the pen to something that writes a lot faster than we do.&lt;/p&gt;
&lt;p&gt;Whether that&amp;#39;s something to fear, or just something to notice, I honestly don&amp;#39;t know yet. Maybe that&amp;#39;s a question for &lt;em&gt;whatever&amp;#39;s&lt;/em&gt; reading this next 😉&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Fiction</category><category>Artificial Intelligence</category><category>Philosophy</category><category>Technology</category></item><item><title>The Internal Struggles of a Software Engineer</title><link>https://www.mrstebo.co.uk/the-internal-struggles-of-a-software-engineer/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/the-internal-struggles-of-a-software-engineer/</guid><description>There&apos;s a version of every developer that exists only in standups and sprint reviews. Tickets move across the board. Someone asks a question in Slack and gets an answer within the hour. From a distance, it all looks calm. Controlled…</description><pubDate>Tue, 04 Aug 2026 07:00:14 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-internal-struggles-of-a-software-engineer.Cs5O7CfX_E4e86.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a version of every developer that exists only in standups and sprint reviews. Tickets move across the board. Someone asks a question in Slack and gets an answer within the hour. From a distance, it all looks calm. Controlled, even.&lt;/p&gt;
&lt;p&gt;But that&amp;#39;s rarely the whole picture.&lt;/p&gt;
&lt;p&gt;Underneath it, there&amp;#39;s usually a running argument going on that nobody else is invited to. &lt;em&gt;Should I do it this way, or that way? Is this actually the right call, or just the one that&amp;#39;s easiest to justify by 5pm?&lt;/em&gt; You don&amp;#39;t see that on a burndown chart. Nobody puts &amp;quot;spent forty minutes talking myself out of starting over&amp;quot; into a retro. But it&amp;#39;s there. Quietly running in the background, like a process nobody remembered to kill.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/0e/2f/W69kIdaw.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;343&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;If you&amp;#39;ve ever sat in a code review and felt your chest tighten slightly before anyone had even left a comment, you already know the feeling I&amp;#39;m talking about. It&amp;#39;s not really about the code. It rarely is.&lt;/p&gt;
&lt;p&gt;And there&amp;#39;s a newer voice that&amp;#39;s crept into that noise too, one that&amp;#39;s a bit harder to shake off than the rest. We&amp;#39;ll get to that one. It deserves its own space, right at the end.&lt;/p&gt;
&lt;p&gt;For now, let&amp;#39;s start with the argument that probably shows up the most...&lt;strong&gt;which way do I actually go?&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;theres-more-than-one-way-to-skin-a-cat&quot;&gt;There&amp;#39;s more than one way to skin a cat&lt;/h2&gt;
&lt;p&gt;I&amp;#39;m not even a cat person, and I still wince a little every time I hear that phrase. It&amp;#39;s such a bizarrely violent way to describe &amp;quot;there are options available to you,&amp;quot; but here we are, still using it decades later. Anyway. Onwards!&lt;/p&gt;
&lt;p&gt;Ask three engineers how to solve the same problem, and you&amp;#39;ll probably get four answers. Maybe five, if one of them changes their mind halfway through explaining it.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s not really a bad thing 🤷‍♂️. It&amp;#39;s actually one of the more interesting parts of the job. But it also means that before a single line of code gets written, there&amp;#39;s already a quiet negotiation happening in your head:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Do I build this properly, or do I build this quickly?&lt;/li&gt;
&lt;li&gt;Do I reach for the pattern I know well, or the one that&amp;#39;s technically more &amp;quot;correct&amp;quot; for this case?&lt;/li&gt;
&lt;li&gt;Do I ask someone, or do I just get on with it and hope I&amp;#39;m not about to walk into a wall?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of these questions have a clean answer. And that&amp;#39;s the uncomfortable part. There&amp;#39;s rarely a single obviously right path, just a handful of &amp;quot;reasonably defensible&amp;quot; ones, and someone has to pick.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/4c/7a/dlZZ1DIhZjsYr.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;374&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The tricky bit is that this decision often has to be made early, usually before the problem&amp;#39;s fully understood. You&amp;#39;re choosing a direction with partial information, then living with the consequences of that choice for however long the code sticks around. Which, let&amp;#39;s be honest, is usually a lot longer than anyone planned for 😅.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a small kind of pressure that repeats itself constantly. Not once a sprint. Not once a day. Sometimes multiple times before the coffee&amp;#39;s gone cold.&lt;/p&gt;
&lt;h2 id=&quot;you-made-your-bed-now-you-have-to-lie-in-it&quot;&gt;You made your bed, now you have to lie in it&lt;/h2&gt;
&lt;p&gt;Except in this case, the bed is a schema decision made eight months ago by someone who&amp;#39;s since left the company, and you&amp;#39;re the one who has to sleep in it.&lt;/p&gt;
&lt;p&gt;Every decision in software has a shelf life you can&amp;#39;t quite see when you&amp;#39;re making it. Sometimes it&amp;#39;s short. Sometimes it&amp;#39;s a throwaway script that somehow ends up running in production for three years and nobody has the heart to touch it. Sometimes it&amp;#39;s a much bigger call, an architecture, a database choice, a &amp;quot;we&amp;#39;ll just do it this way for now&amp;quot; that quietly becomes permanent the moment it ships.&lt;/p&gt;
&lt;p&gt;And here&amp;#39;s the thing nobody tells you early on: &lt;strong&gt;being wrong isn&amp;#39;t actually the hard part.&lt;/strong&gt; Most engineers can handle being wrong. What&amp;#39;s harder is being wrong slowly, in a way that only becomes obvious months later, once the decision has had time to work its way into everything around it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The library that seemed like the right pick, until it stopped being maintained&lt;/li&gt;
&lt;li&gt;The &amp;quot;quick and simple&amp;quot; data structure, now propping up half the product&lt;/li&gt;
&lt;li&gt;The naming convention that made sense at the time, and only at the time&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/8ce8357c78ea940b9c2015daf05ce1a5/86/9b/CflwxhYi.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;273&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;By the time it&amp;#39;s clear something needs to change, ripping it out isn&amp;#39;t really an option anymore. Too much depends on it 🙈. So you patch around it instead. You build little workarounds, add a comment that says &lt;code&gt;// TODO: fix this properly&lt;/code&gt;, and quietly hope that future-you, or better yet, future-someone-else, has more time than present-you does.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a particular kind of tiredness that comes from working around your own past decisions. Not because the decision was reckless. Usually it wasn&amp;#39;t. It&amp;#39;s just that nobody hands out a crystal ball with the job. You make the best call you can with what you know, and then you live inside that call for a lot longer than feels fair.&lt;/p&gt;
&lt;h2 id=&quot;theres-no-time-like-the-present-apparently&quot;&gt;There&amp;#39;s no time like the present, apparently&lt;/h2&gt;
&lt;p&gt;Nobody ever asks for a feature next month. It&amp;#39;s always &amp;quot;can we get this in by Friday,&amp;quot; said on a Tuesday, about something that hasn&amp;#39;t been fully scoped yet... 😅&lt;/p&gt;
&lt;p&gt;Software has this strange property where the work looks finished long before it actually is. A button exists. A form submits. It &lt;em&gt;looks&lt;/em&gt; done, and looking done is often enough for someone to start planning the launch email. What isn&amp;#39;t visible is everything sitting underneath it: the edge cases, the error states, the thing that only breaks when a user does something nobody expected them to do.&lt;/p&gt;
&lt;p&gt;That gap, between looking done and being done, is where a lot of quiet pressure lives.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cutting a corner you know you&amp;#39;ll have to come back for&lt;/li&gt;
&lt;li&gt;Skipping the test you&amp;#39;d normally write, &amp;quot;just this once&amp;quot;&lt;/li&gt;
&lt;li&gt;Shipping something you&amp;#39;re not fully happy with, because not shipping isn&amp;#39;t really an option either&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/98/70/IoaJUpue.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;None of this is usually anyone&amp;#39;s fault directly. Deadlines exist for real reasons. Customers are waiting. Competitors are moving. The business has to, well, business. But from inside the work, it doesn&amp;#39;t always feel like a reasonable trade-off being made. It feels like being asked to do the job properly and quickly, and only ever being thanked for the quickly part.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The corners get cut quietly, and they get remembered loudly.&lt;/strong&gt; Nobody notices the test that got written. Everyone notices the bug that got shipped. That imbalance sits with you longer than it probably should.&lt;/p&gt;
&lt;h2 id=&quot;just-go-and-discover-it-they-said&quot;&gt;Just go and discover it, they said&lt;/h2&gt;
&lt;p&gt;It&amp;#39;s a bit like being told to &amp;quot;go make some magic happen,&amp;quot; except with a ticket attached and a deadline two sprints away.&lt;/p&gt;
&lt;p&gt;At some point, someone in a meeting says a phrase like &amp;quot;let&amp;#39;s A/B test this&amp;quot; or &amp;quot;we should do some discovery first,&amp;quot; and everyone nods, because it sounds sensible. It &lt;em&gt;is&lt;/em&gt; sensible. Nobody&amp;#39;s arguing with the idea. The trouble starts afterwards, in the quiet moment when the meeting ends and it&amp;#39;s actually down to you to work out what that sentence means in practice 😬.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A/B test it... against what, exactly? With how many users? For how long, before the result actually means anything?&lt;/li&gt;
&lt;li&gt;Do some discovery... talking to who? Reading what? And how do you know when you&amp;#39;ve done enough of it to start building?&lt;/li&gt;
&lt;li&gt;Validate the idea... with what counts as validation, and who decides that it&amp;#39;s been reached?&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/9ed0121ed465c12e1f3dda331ed33f0e/33/f1/kBleUfQYZXyGE.gif&quot; alt=&quot;&quot; width=&quot;276&quot; height=&quot;284&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;None of these are difficult concepts. That&amp;#39;s not really the issue. The issue is that they get handed over as instructions, when really they&amp;#39;re entire disciplines that some people spend their whole careers getting good at. Saying &amp;quot;let&amp;#39;s A/B test it&amp;quot; takes about two seconds. Actually designing a fair, meaningful test takes rather longer than that.&lt;/p&gt;
&lt;p&gt;So you end up doing your best impression of the process. You cobble together something that resembles discovery. You run a test that&amp;#39;s probably not &lt;em&gt;statistically rigorous&lt;/em&gt;, but is better than nothing. And you carry a small, nagging feeling the entire time that you&amp;#39;re doing a slightly wrong version of a thing you were never really shown how to do properly in the first place.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It&amp;#39;s not that the advice is bad. It&amp;#39;s that &amp;quot;go and do the hard, specialised bit&amp;quot; is a strange thing to say so casually...&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;by-the-time-youve-learned-it-its-already-changed&quot;&gt;By the time you&amp;#39;ve learned it, it&amp;#39;s already changed&lt;/h2&gt;
&lt;p&gt;To be fair, we&amp;#39;re past the era of a brand new frontend framework landing every six months. Things have settled, a bit. But &amp;quot;settled&amp;quot; doesn&amp;#39;t mean &amp;quot;stopped.&amp;quot; 😅&lt;/p&gt;
&lt;p&gt;There&amp;#39;s still a particular flavour of tiredness that comes from trying to keep up with an industry that refuses to sit still, even if the shape of that movement has changed. It&amp;#39;s less about entirely new frameworks now, and more about the constant churn underneath the ones you already use: major version bumps, deprecated APIs, a new &amp;quot;recommended&amp;quot; way of doing the thing you only just got comfortable doing the old way.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A tool you finally understood, now with a v2 that changes half the syntax&lt;/li&gt;
&lt;li&gt;A &amp;quot;best practice&amp;quot; that&amp;#39;s quietly become an &amp;quot;anti-pattern&amp;quot; while nobody was looking&lt;/li&gt;
&lt;li&gt;An entirely new category of tooling turning up, built around something (AI, most likely) that didn&amp;#39;t really exist as a serious concern eighteen months ago&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/39f2394ae36df6e199be9eb7c9fa1012/8f/a8/mcnOR4JZ.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;372&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The strange part is that none of this is really optional. You can&amp;#39;t just opt out and stick with what you know, not indefinitely. The landscape shifts, the job market shifts with it, and eventually the thing you were confidently good at quietly stops being what people are hiring for. So you keep reading. You keep experimenting on evenings you&amp;#39;d rather not be working. You keep half an eye on things, just in case you&amp;#39;ve missed something important.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It&amp;#39;s less &amp;quot;lifelong learner&amp;quot; and more &amp;quot;trying not to drown while everyone insists the water&amp;#39;s fine.&amp;quot;&lt;/strong&gt; Most days you manage it. Some days you just quietly close the tab and pretend you&amp;#39;ll catch up at the weekend.&lt;/p&gt;
&lt;h2 id=&quot;everyone-else-seems-to-have-this-figured-out&quot;&gt;Everyone else seems to have this figured out...&lt;/h2&gt;
&lt;p&gt;There&amp;#39;s a very specific kind of low mood that comes from scrolling through a timeline of people who all seem to be shipping side projects, landing promotions, and speaking at conferences, all before you&amp;#39;ve finished your second coffee...&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/c3a19a0b747a76e98651f2b9a3cca5ff/1e/dd/f0Xmiw8O.gif&quot; alt=&quot;&quot; width=&quot;220&quot; height=&quot;181&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Comparison is a strange thing in this industry, because the evidence is everywhere and almost none of it is representative. You see the shipped feature, not the three days spent debugging it. You see the &amp;quot;excited to announce&amp;quot; post, not the eighteen rejected applications that came before it. You see someone&amp;#39;s polished side project, not the four abandoned ones sitting in a private repo somewhere.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The engineer whose blog posts always seem to know exactly what they&amp;#39;re talking about&lt;/li&gt;
&lt;li&gt;The one who somehow contributes to open source &lt;em&gt;and&lt;/em&gt; has a full time job &lt;em&gt;and&lt;/em&gt; apparently sleeps 🤯&lt;/li&gt;
&lt;li&gt;The one who got promoted after two years, when you&amp;#39;re on year four wondering what you&amp;#39;re doing wrong&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/e293a233a303a98e471f78d04e13a1b0/cb/11/p9RR7KFW.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The uncomfortable truth is that most of this comparison happens against a version of someone else that&amp;#39;s been carefully edited, whether they meant it to be or not. Nobody posts the merge conflict that took an entire afternoon. Nobody writes the thread about the meeting where their idea got quietly shot down. You&amp;#39;re comparing your full, messy, unfiltered experience of the job against everyone else&amp;#39;s highlight reel, and then wondering why the numbers don&amp;#39;t add up.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It&amp;#39;s not that other people aren&amp;#39;t doing well. Plenty of them genuinely are.&lt;/strong&gt; It&amp;#39;s that &amp;quot;doing well&amp;quot; and &amp;quot;never struggling&amp;quot; aren&amp;#39;t the same thing, even if it&amp;#39;s easy to mix the two up at eleven at night when you&amp;#39;re staring at a bug you can&amp;#39;t quite explain.&lt;/p&gt;
&lt;h2 id=&quot;the-burnout&quot;&gt;The Burnout 🥵&lt;/h2&gt;
&lt;p&gt;It rarely happens all at once. Nobody wakes up and decides today&amp;#39;s the day they stop caring. It&amp;#39;s slower than that, and a lot quieter.&lt;/p&gt;
&lt;p&gt;Burnout doesn&amp;#39;t tend to announce itself. It creeps in disguised as other things: a bit more cynicism in code review than usual, a slightly shorter fuse in standup, a growing pile of &amp;quot;I&amp;#39;ll get to that eventually&amp;quot; that never quite gets got to. The work that used to feel like solving a puzzle starts to feel more like just... moving tickets from one column to another.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Caring less about the &amp;quot;right&amp;quot; way to do something, and more about just getting it done 😭&lt;/li&gt;
&lt;li&gt;Dreading the small talk in meetings that used to be the easy part of the day 😓&lt;/li&gt;
&lt;li&gt;Finding it harder to summon enthusiasm for things that would have been genuinely exciting a year ago 😔&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/c9/b2/SemzEMBRfDdsXNohyye6.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;286&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The tricky part is that burnout doesn&amp;#39;t really respect deadlines, sprints, or how much you&amp;#39;ve got left in the backlog. It just quietly builds, usually while everything on the surface still looks fine. Tickets still get closed. Standups still happen. From the outside, nothing&amp;#39;s obviously wrong. From the inside, it can feel like running on a battery that never quite gets back to full, no matter how the weekend went.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It&amp;#39;s rarely one big thing.&lt;/strong&gt; It&amp;#39;s usually a hundred small things, none of them dramatic enough on their own to raise a flag, all quietly adding up in the background until one day the tank&amp;#39;s just... empty.&lt;/p&gt;
&lt;h2 id=&quot;and-then-theres-ai&quot;&gt;And then there&amp;#39;s AI&lt;/h2&gt;
&lt;p&gt;Every other struggle in this post is one developers have been quietly carrying for years. This one&amp;#39;s newer, and it sits a bit differently.&lt;/p&gt;
&lt;p&gt;Most of the conversation around AI and software engineering focuses on the boring bits it&amp;#39;s supposedly going to take away. The boilerplate. The repetitive refactors. The bits nobody particularly enjoyed writing anyway. And on paper, that sounds like a reasonable trade. Nobody&amp;#39;s especially attached to writing the same CRUD endpoint for the hundredth time 😂.&lt;/p&gt;
&lt;p&gt;But that&amp;#39;s not really the fear, is it? Not the honest one.&lt;/p&gt;
&lt;p&gt;The honest one is quieter, and it&amp;#39;s this: &lt;strong&gt;what if it doesn&amp;#39;t stop at the boring bits?&lt;/strong&gt; What if the part it eventually gets good at is the part that was never boring in the first place? The actual problem solving. The moment you finally understand why something&amp;#39;s broken. The satisfaction of untangling a genuinely hard bug, or landing on a clean solution to something messy. That&amp;#39;s not the tedious 20% of the job. For a lot of engineers, that &lt;em&gt;is&lt;/em&gt; the job. It&amp;#39;s the reason a lot of people got into this in the first place.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/e293a233a303a98e471f78d04e13a1b0/eb/70/hzlOxYhu.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;314&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;There&amp;#39;s something strange about watching a tool get better at the exact thing that used to make you feel good at yours. It&amp;#39;s not quite jealousy. It&amp;#39;s not quite fear, either, not the dramatic kind. It&amp;#39;s more of a low hum in the background, a question that doesn&amp;#39;t have a comfortable answer yet: &lt;em&gt;if the interesting bit gets automated too, what&amp;#39;s actually left for me to enjoy?&lt;/em&gt;&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🗣️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;Personally, I enjoy being what is now described as a &lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Caveman Developer&lt;/strong&gt;&lt;/b&gt;. As much as I am aware that this could slow me down, it is an intentional bottleneck to enforce understanding and solidify knowledge.&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;To be clear, none of this is a prediction. Nobody actually knows how this plays out, least of all the people confidently posting hot takes about it. But it&amp;#39;s worth naming honestly, rather than pretending it&amp;#39;s just another line item on the list of things to keep up with. It sits closer to the identity of the job than any framework churn ever did.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Maybe that&amp;#39;s the real internal struggle underneath all the others.&lt;/strong&gt; Not just doing the job well, but wondering if the parts you love about it will still be yours to do at all.&lt;/p&gt;
&lt;h2 id=&quot;so-where-does-that-leave-us&quot;&gt;So, where does that leave us?&lt;/h2&gt;
&lt;p&gt;None of this is a complaint, not really. It&amp;#39;s just what the job actually looks like once you get past the standups and the tickets and the &amp;quot;all good, just picking this up now&amp;quot; messages in Slack. There&amp;#39;s a quiet, constant negotiation happening underneath all of it, and it&amp;#39;s been there the whole time, whether anyone&amp;#39;s talking about it or not.&lt;/p&gt;
&lt;p&gt;If any of this sounded familiar, that&amp;#39;s probably the point. These aren&amp;#39;t signs of being bad at the job. They&amp;#39;re just what the job quietly asks of the people doing it, day after day, mostly unnoticed. The indecision, the pressure, the comparison, the tiredness, and now this newer, harder question sitting alongside them. None of it shows up on a burndown chart. All of it is real anyway.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/e293a233a303a98e471f78d04e13a1b0/97/56/bIMqhY1o.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;There&amp;#39;s no neat conclusion here, and I don&amp;#39;t think there&amp;#39;s supposed to be one. Some of these struggles ease off with time and experience. Some just change shape. And the newest one, the AI-shaped one, is still working itself out in real time, for everyone, not just engineers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Maybe the most useful thing is just saying it out loud.&lt;/strong&gt; Not to fix any of it, just to make it a bit less lonely to carry.&lt;/p&gt;
&lt;p&gt;If any of this struck a chord, I&amp;#39;d genuinely like to hear about it. There&amp;#39;s probably a struggle or two I&amp;#39;ve missed entirely, and someone else&amp;#39;s version of this list is likely a little different from mine.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Mental Health</category><category>Philosophy</category><category>Psychology</category><category>Reflection</category></item><item><title>Forward Progress with Shadow Releases</title><link>https://www.mrstebo.co.uk/forward-progress-with-shadow-releases/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/forward-progress-with-shadow-releases/</guid><description>A Shadow Release is the ability to build functionality and deploy it without users knowing about it. There are several strategies that can be used to implement shadow releases, but the most common is feature flagging. This can be at the…</description><pubDate>Mon, 27 Jul 2026 07:00:27 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/forward-progress-with-shadow-releases.BHt5BOva_rqn43.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;A Shadow Release is the ability to build functionality and deploy it without users knowing about it. There are several strategies that can be used to implement shadow releases, but the most common is &lt;strong&gt;feature flagging&lt;/strong&gt;. This can be at the platform level, or more beneficially, on a segment of your user base (be it a single customer or a specific user).&lt;/p&gt;
&lt;p&gt;I have found shadow releases to be incredibly helpful in experimenting with different ideas without affecting current users. I can release functionality and enable it for my own user account so that I can &amp;quot;give it a spin&amp;quot; and demonstrate it to stakeholders before rolling it out to the rest of the users on the platform.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/935d7ab9d8c6202580a668421940ec81/9c/78/tc7S9JOK.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;281&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The main driver behind shadow releases is to be a kind of &amp;quot;risk mitigator&amp;quot;, so that we can still make forward progress without having negative impacts on our users. With that goal in mind, it also ensures that these kinds of features are built in a way that they can be easily discarded if they do not suit the needs of the business.&lt;/p&gt;
&lt;h2 id=&quot;the-challenge&quot;&gt;The Challenge&lt;/h2&gt;
&lt;p&gt;To demonstrate the idea of shadow releases, I decided to take a real-world scenario from a recent project I completed. This piece of work had a number of challenges where we wanted to build some enhanced functionality around decisions that were made during the inception of the platform, so the story will hopefully resonate with people who have had to do something similar. And besides, if this particular piece of work were easy, then there would be no point writing about it...&lt;/p&gt;
&lt;p&gt;Perhaps a backstory is in order before discussing the proposed enhancement.&lt;/p&gt;
&lt;p&gt;Our platform is primarily used as a driver to encourage internal customer referrals for jobs, so that the referrer can be rewarded with points (which can be redeemed for cash). So our platform allows customers to create job postings that their employees can share with their personal networks. When a potential candidate applies for the job, they enter a &lt;strong&gt;candidate progression&lt;/strong&gt; workflow, where they start at the &amp;quot;applied&amp;quot; stage. Customers can configure this candidate progression by allowing a different number of points to be awarded to the referrer when the candidate reaches different stages of the process (which makes it sort of like an ATS in a way). As the candidate progresses through the process, the referrer earns more points until the person they referred is offered a job and starts working for their employer. During the process, the candidate can also end up with different &amp;quot;stage statuses&amp;quot;, where they may have progressed to the &amp;quot;Interview&amp;quot; stage, but were unsuccessful. In addition, there is some additional functionality around candidate progression, which involves sending notifications to the referrer, which can be customised for &lt;em&gt;some&lt;/em&gt; of the stages.&lt;/p&gt;
&lt;p&gt;Now that you know about the current functionality, it is time to talk about the requested feature.&lt;/p&gt;
&lt;p&gt;Currently, the candidate progression feature has stages and statuses that cannot be changed. Because of the market the business was in at the current time, it wasn&amp;#39;t much of an issue. There were requests for this customisability, but due to the effort required and the limited number of customers requesting it, it was deferred until a later date. However, as we started to diversify our customer base into other areas (still related to health and social care), we found that some customers have a strong need to have the platform show the current processes that they use, as the current ones were not applicable for them. The pivot into a new sector was the driving force behind prioritising this feature.&lt;/p&gt;
&lt;p&gt;So the key goals of this new feature were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enabling customisable stage names and statuses&lt;/li&gt;
&lt;li&gt;Enabling stage statuses to be added/removed&lt;/li&gt;
&lt;li&gt;Enabling custom notifications for &lt;strong&gt;EVERY&lt;/strong&gt; stage and status (only positive and negative outcomes), but that can be selectively enabled/disabled&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sounds simple, right? However, there is a bunch of legacy code that needs to be reviewed first before hopping in with the implementation. And it wasn&amp;#39;t just the code...it was also looking at any &amp;quot;bugs&amp;quot; that were raised around that area because this feature can also be used to ensure that the new functionality is a bit more robust.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d6b0ce929193df3c242ac34b5654d2ce/9f/a1/knu9U6GC.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;However, when reviewing the existing code, it appeared that the functionality for candidate progression was scattered throughout the code. Some with inconsistent behaviour, e.g., it might award points for one use journey, but not another. It might send a notification for one scenario, but not another (even if it was the same outcome). So I felt that this was a good argument for getting the current candidate progression flow into a more coherent state before trying to add an enhancement to it - channelling my inner Kent Beck by &amp;quot;making the change easy&amp;quot; for myself in the future.&lt;/p&gt;
&lt;p&gt;In addition, our ATS integration feature also had some issues with different behaviour when candidates were progressed via information from external ATS systems. Basically, if you progressed a candidate manually via the UI to the next step, several things would happen. If it were done automatically via the ATS, then it &lt;em&gt;might&lt;/em&gt; do a bunch of stuff...&lt;/p&gt;
&lt;p&gt;But wait...there&amp;#39;s more... There is also existing code in the area for a large piece of work that was completed recently. So we have areas where we have feature-flagged whether a customer has some improved functionality enabled, and if not, use an &amp;quot;original&amp;quot; function, e.g., &lt;code&gt;awardPoints&lt;/code&gt; vs &lt;code&gt;awardPointsOriginal&lt;/code&gt; 👀&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/a15b48460c436e1e92c85ffc680932cc/b4/0f/PSUPcowf.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;h2 id=&quot;the-thinking-process&quot;&gt;The Thinking Process&lt;/h2&gt;
&lt;p&gt;When developing a new feature, there are several approaches you can take. The main driver of the decision is to weigh up the pros and cons of a set of development/deployment strategies. The way I usually think about it is &amp;quot;which one results in the least risk&amp;quot;. The last thing I want is to release something that results in the platform turning into a mess...that is on fire...in a hurricane... 😬&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/89/f0/iI1tJS435dJ2g.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;280&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The weight of the decision can also be influenced by how the feature integrates into current user journeys. If the new feature is entirely new, then that is amazing. However, if it needs to augment a current workflow, then that is where things start to get a little bit messy. When you have to start looking at the decisions made before you to see how much effort it will take to integrate the feature (if it is even possible with the current implementation...or if this is one of the cases where a rewrite is necessary). I will go into more detail about different strategies in another post, but for now, I will just talk about the ones used for this piece of work.&lt;/p&gt;
&lt;p&gt;The first strategy we will need to use is basically a consolidation refactor. We update the current candidate progression system so that all the behaviour is in a centralised system that is easy for other services to consume.&lt;/p&gt;
&lt;p&gt;After the refactor, the new feature will use the &lt;em&gt;Shadow Release&lt;/em&gt; strategy (what a shock, right?). But a shadow release that can be enabled on a customer-by-customer basis, so that we can test the functionality on non-prod environments, and eventually on prod with our internal test customer accounts.&lt;/p&gt;
&lt;h2 id=&quot;working-with-constraints&quot;&gt;Working with Constraints&lt;/h2&gt;
&lt;p&gt;I&amp;#39;ve already spoken about some of the things that I saw that &lt;strong&gt;NEEDED&lt;/strong&gt; to be addressed before starting work on the feature itself. Bugs relating to differences in behaviour for different areas of the system. Consolidating all of the candidate progression into a single place would make life a lot easier...especially when it comes to diagnosing any future issues.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Have you ever had a bug come in where you go &amp;quot;I know where that is&amp;quot;, and you fix it only to find out that there is similar (or maybe the same) code in another place where the bug actually resides 😬&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/35ccce3d852f7995dd2da910f2abd795/39/75/gTyzdyS8.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;350&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Obviously, this is a project in itself...so in order to get buy-in, it was described to stakeholders as &amp;quot;Phase 1&amp;quot; of the feature. We need to improve the current system before adding customisability to it. This phase of the work would not need to be feature-flagged, as we are not changing any existing behaviour. Just making a more robust and coherent implementation.&lt;/p&gt;
&lt;p&gt;When the refactor is done, it will have removed some of the underlying constraints that would have been present during the design of the new feature. The constraint is hard-coded values. These values were used for side-effect behaviour. For example, if a candidate has applied for a role, it might trigger an automated notification that is stored in the database. The candidate progression will have the stage of &lt;code&gt;applied&lt;/code&gt; and the status of &lt;code&gt;yes&lt;/code&gt;. And when looking for the notification to send it will use those two bits of information. So there was tight coupling between these two bits of data...&lt;/p&gt;
&lt;p&gt;A constraint that we decided to remove early on was not to create a UI. So custom stages will need to be requested during the customer onboarding process (or requested at a later date). This reduces the need for any UI/UX effort for our initial release of this feature.&lt;/p&gt;
&lt;p&gt;A critical constraint was the ability to enable this functionality for a customer, but also be able to roll back if any issues are discovered when it is eventually used by actual customers in production (a very late-stage tripwire).&lt;/p&gt;
&lt;h2 id=&quot;legacy-code-realities&quot;&gt;Legacy Code Realities&lt;/h2&gt;
&lt;p&gt;A lot of stuff can happen in 5+ years...especially from a coding perspective. Without strict technical oversight, a codebase can quickly get into a hot mess. Deprecated functionality...unused (but still present) routes...a TODO list as long as your arm...and previous decisions (that were more than likely correct at the time, given the requirements).&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/b9/6f/tWEogEDE.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Like I said before, one of the main benefits of this new piece of work was to take a long, hard look at the current candidate progression system and try to slap it into shape. Remove the issues of the past. Enforce consistency. And ensure data integrity (where database constraints are not viable). This would ultimately affect everyone, but with a net positive outcome. So, it&amp;#39;s definitely worth the development effort even if the new feature did not exist.&lt;/p&gt;
&lt;h2 id=&quot;planning-the-refactor&quot;&gt;Planning the Refactor&lt;/h2&gt;
&lt;p&gt;&amp;gt; First question: what would perfect look like if we started fresh?&lt;/p&gt;
&lt;p&gt;&amp;gt; Mapping the current system&lt;/p&gt;
&lt;p&gt;&amp;gt; Identifying where this new design could slot in&lt;/p&gt;
&lt;p&gt;&amp;gt; Decision to create new models: &lt;code&gt;CandidateProgressStage&lt;/code&gt; and &lt;code&gt;CandidateProgressStageStatus&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; Encapsulation of stage logic with a Manager to unify old and new behaviour&lt;/p&gt;
&lt;p&gt;When my Product Owner and I get together to look at improving existing code, she likes to ask, &amp;quot;What would it look like if you were starting this from scratch?&amp;quot;. That is an incredibly useful question when it comes to picturing a desired outcome. Akin to Test Driven Development (TDD), where you write the tests first, it encourages one to think about how you would like to &amp;quot;use&amp;quot; what you are building, and also has a higher chance of creating a more straightforward and more developer-friendly implementation.&lt;/p&gt;
&lt;p&gt;I feel like this is where my constant reading of technical books really proves its value. I remember reading a book that spoke about software architecture, and a diagram really stuck with me. The concept of a Manager that sits in front of business logic. The manager acts as a kind of orchestrator for behaviour. So I thought that I could use that concept to create a manager class that was specifically for candidate progression, with a simple interface, but with the flexibility that would be required for phase 2 of this feature.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://static.klipy.com/ii/35ccce3d852f7995dd2da910f2abd795/16/f2/IDCTmDMj.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;498&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Previously, I had done a lot of work to provide a more modular approach to feature design, so I figured that it would be good to put all things related to candidate progression into its own module. The reason behind this wasn&amp;#39;t just a personal preference, but a way of ensuring that behaviour is isolated, and that when more developers join the team, there is a reduced risk of merge conflicts because work could be planned around dedicated features.&lt;/p&gt;
&lt;p&gt;I also wanted to avoid the trap of rushing into a &amp;quot;big bang&amp;quot; rewrite. The idea was never to bulldoze everything and hope for the best, but to carve out safe spaces where new code could live alongside the old. That is why the decision to introduce new models for stages and statuses felt important. By wrapping them in a manager layer, I gave myself a seam where both the legacy behaviour and the new behaviour could coexist.&lt;/p&gt;
&lt;p&gt;This seam became the backbone of the plan. It meant we could start migrating logic incrementally, swapping out brittle parts of the old system for stronger, testable components. It also gave us an easy way to toggle behaviour, which was crucial for shadow releases and rollback scenarios.&lt;/p&gt;
&lt;p&gt;By the end of the planning phase, the vision was clear: create a centralised manager, isolate progression logic into its own module, introduce new models to support flexibility, and keep the whole thing shielded by feature flags. Nothing flashy, just a deliberate foundation for the work to come.&lt;/p&gt;
&lt;h2 id=&quot;to-be-continued&quot;&gt;To Be Continued&lt;/h2&gt;
&lt;p&gt;This post has focused on the thinking and preparation that went into planning the refactor. In the next part, I’ll walk through the implementation itself — the data model changes, the migration strategy, how we handled side-effects, and the feature flag rollout that let us deliver safely. That’s where the rubber really meets the road.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Software Architecture</category><category>Software Development</category><category>Refactoring</category></item><item><title>Are You Accidentally Killing Your Database?</title><link>https://www.mrstebo.co.uk/are-you-accidentally-killing-your-database/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/are-you-accidentally-killing-your-database/</guid><description>Imagine you&apos;re building a simple admin portal feature—nothing too complex...just a page where internal staff can view notifications that have been sent out. The goal is to let them review what was sent, when it went out, and who received…</description><pubDate>Mon, 26 May 2025 07:30:43 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/are-you-accidentally-killing-your-database.Dlrk7FID_Z1TBaJW.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Imagine you&amp;#39;re building a simple admin portal feature—nothing too complex...just a page where internal staff can view notifications that have been sent out. The goal is to let them review what was sent, when it went out, and who received it. There&amp;#39;s a &lt;code&gt;Notification&lt;/code&gt; model and a &lt;code&gt;UserNotification&lt;/code&gt; model that links each notification to one or more recipients. The structure is clean, the relationships are well defined, and the feature works fine during development.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;However, the data then begins to grow.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Dozens of notifications become hundreds, then thousands, each targeting dozens or maybe hundreds of users. Suddenly, that simple feature starts feeling sluggish. The page takes longer to load, queries begin to pile up, and you&amp;#39;re left wondering what went wrong with a feature that didn&amp;#39;t seem complicated to start with.&lt;/p&gt;
&lt;p&gt;This is precisely the kind of problem I&amp;#39;ve run into more than once. The system works perfectly under light usage, but falls apart when exposed to real-world data. The issue isn&amp;#39;t in the business logic. It almost always comes down to how the database is being accessed. And it’s usually fixable.&lt;/p&gt;
&lt;p&gt;In this article, I aim to walk through a scenario of this kind. I&amp;#39;ll highlight where the problems tend to show up, how I&amp;#39;ve learned to spot them early, and the changes I now make to avoid silently overloading the database. These patterns can be applied to any feature that works with large volumes of related data.&lt;/p&gt;
&lt;h2 id=&quot;the-admin-notification-feature&quot;&gt;&lt;strong&gt;The Admin Notification Feature&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/computer-screen.BAEykiAi_Z1FvfXg.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In this scenario, the feature is part of an internal admin portal. The purpose is to provide staff visibility into the notifications that have been sent and to whom they were delivered. The interface lists notifications with their content, the time they were sent, and a breakdown of recipients, along with whether those recipients have read the message or not.&lt;/p&gt;
&lt;p&gt;The underlying structure is pretty standard. There is a &lt;code&gt;Notification&lt;/code&gt; model that stores the actual message and metadata, such as the subject line, delivery mode, and timestamps. Each notification may be sent to a single user, a handful of specific users, or every user associated with a customer account. To track this, there is a related &lt;code&gt;UserNotification&lt;/code&gt; model, which links a notification to individual recipients and stores information like read status and delivery state.&lt;/p&gt;
&lt;p&gt;Something like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Notification.php&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; userNotifications&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; $this&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;hasMany&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;UserNotification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::class&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// UserNotification.php&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; $this&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;belongsTo&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::class&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s a reasonable structure, as it maps cleanly to the business requirements and is easy to build out views and reports based on this relationship. However, as the data grows, this model can become problematic if care is not taken with how it&amp;#39;s queried and rendered.&lt;/p&gt;
&lt;p&gt;The remainder of this article explores the various performance issues that can arise in a setup like this, explains how to identify them using the appropriate tools, and outlines my approach to resolving them by modifying how the data is accessed.&lt;/p&gt;
&lt;h2 id=&quot;problem-1-too-many-queries-in-one-request&quot;&gt;&lt;strong&gt;Problem 1: Too Many Queries in One Request&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;One of the first signs of trouble with this feature is that the notification list page becomes slower over time. Everything loads fine when there are a few records, but once you display dozens of notifications, each with their recipients, the request time starts to increase. What&amp;#39;s happening under the hood is often a flood of minor queries triggered by lazy loading.&lt;/p&gt;
&lt;p&gt;The usual culprit is a loop that renders a list of notifications and, for each one, accesses a related model, such as &lt;code&gt;userNotifications&lt;/code&gt;. That access may not appear dangerous at first, as it works and returns the expected data. But without eager loading, Laravel runs a new query for every single notification.&lt;/p&gt;
&lt;p&gt;If you have 50 notifications, and each one triggers a query to load recipients, that&amp;#39;s 100 queries in one request... And if any of those relationships also trigger their queries, things get even worse.&lt;/p&gt;
&lt;p&gt;This is the classic case where eager loading makes all the difference. By using &lt;code&gt;with()&lt;/code&gt;, you can load all the required data in just a few queries, regardless of the number of notifications being rendered.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;userNotifications.user&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;paginate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you&amp;#39;re asking the database once for the notifications, and once for the related recipients and their user records. This eliminates unnecessary round trips and eliminates surprises when usage increases.&lt;/p&gt;
&lt;p&gt;Whenever I&amp;#39;m working with relationships in list views or reports, I default to eager loading. Even if the performance isn&amp;#39;t an issue during development, I assume the data will grow, and I&amp;#39;d rather not rely on query caching or hope for the best.&lt;/p&gt;
&lt;h2 id=&quot;problem-2-n1-queries-sneaking-in&quot;&gt;&lt;strong&gt;Problem 2: N+1 Queries Sneaking In&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The first time I ran into a serious N+1 issue, I didn&amp;#39;t even realize what was happening. The feature seemed fast enough, and the queries didn&amp;#39;t appear to be broken. But when I opened Laravel Telescope and looked at a single request, I saw dozens of nearly identical queries firing off one after another. It was the same &lt;code&gt;SELECT&lt;/code&gt; statement repeated over and over, just with a different &lt;code&gt;user_notification_id&lt;/code&gt; or &lt;code&gt;user_id&lt;/code&gt; in the &lt;code&gt;WHERE&lt;/code&gt; clause.&lt;/p&gt;
&lt;p&gt;This is the classic N+1 query problem.&lt;/p&gt;
&lt;p&gt;In a setup like this (where each notification can be linked to many users through a &lt;code&gt;UserNotification&lt;/code&gt; model), it&amp;#39;s easy to load the related data one row at a time accidentally. Even if you&amp;#39;ve added &lt;code&gt;with()&lt;/code&gt; for the primary relationship, it can still occur deeper in the tree, such as when rendering user details or filtering based on read status.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s an example of what that might look like without proper eager loading:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;@foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $notification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    @foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userNotifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $userNotification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        {{ &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$userNotification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    @endforeach&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;@endforeach&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Even though this code appears clean, it quietly triggers a new query every time it accesses &lt;code&gt;userNotification-&amp;gt;user&lt;/code&gt;, unless that relationship has also been eagerly loaded.&lt;/p&gt;
&lt;p&gt;The fix is straightforward. Load what you need up front:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;userNotifications.user&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;paginate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Sometimes I also need to apply constraints to a nested relationship, like filtering out read notifications:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;userNotifications&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    $query&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;whereNull&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;read_at&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;paginate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This pattern provides the performance benefit of eager loading without loading unnecessary data.&lt;/p&gt;
&lt;p&gt;Whenever I&amp;#39;m working with nested relationships, I check Telescope while developing. If I see a repeating pattern in the query log—same table, same structure, changing only by ID—I know I&amp;#39;ve got an N+1 issue to clean up.&lt;/p&gt;
&lt;h2 id=&quot;problem-3-loading-too-much-data-at-once&quot;&gt;&lt;strong&gt;Problem 3: Loading Too Much Data at Once&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The previous issues were all about the number of queries being executed. This one is different; it&amp;#39;s about how much data you&amp;#39;re pulling in at once and what you&amp;#39;re doing with it.&lt;/p&gt;
&lt;p&gt;In admin-facing features, it&amp;#39;s common to need to process or display a lot of records. You may be generating a report of all unread notifications, or exporting notification logs for a compliance request. The temptation is to write something like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;all&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $notification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // process or modify each one&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The problem is that &lt;code&gt;all()&lt;/code&gt; loads every record into memory. If you&amp;#39;re dealing with hundreds or thousands of rows, especially those with nested relationships, this can easily exceed your memory limits or cause timeouts. Additionally, if you’re modifying records as you loop through them, you might inadvertently affect your result set.&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;red&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🥴&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;You know that someone has seen this issue before when you spot an &lt;code spellcheck=&quot;false&quot; style=&quot;white-space: pre-wrap;&quot;&gt;ini_set(&apos;memory_limit&apos;, &apos;2G&apos;)&lt;/code&gt; in your codebase 🙈&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;I&amp;#39;ve encountered this issue a few times when writing data cleanup jobs or background tasks. The safer approach is to use &lt;code&gt;chunkById()&lt;/code&gt;, which loads records in fixed-size batches using indexed IDs. This approach avoids loading everything at once and prevents looping forever if records are being updated during the process.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;chunkById&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $notification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        $notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;archived&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This pattern is efficient, predictable, and much easier to reason about under load. It&amp;#39;s also safer for job retries, especially when you&amp;#39;re updating or deleting records along the way.&lt;/p&gt;
&lt;p&gt;But using &lt;code&gt;chunkById()&lt;/code&gt; isn&amp;#39;t a magic fix. Even with good structure, bad logic can still be present 😅.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s an example of that.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s say you&amp;#39;re reviewing notifications and want to check:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which users received the notification&lt;/li&gt;
&lt;li&gt;Whether their customer account has a specific feature enabled&lt;/li&gt;
&lt;li&gt;Whether that user has made any posts in the last 3 days&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;#39;re trying to stay efficient, so you&amp;#39;re chunking the notifications. But you nest another chunk for &lt;code&gt;UserNotification&lt;/code&gt; records, and inside that, you start running manual queries for each user.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$importantNotificationIds&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;chunkById&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;use&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$importantNotificationIds&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $notification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        UserNotification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;notification_id&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;            -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;chunkById&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$userNotifications&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;use&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$importantNotificationIds&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                foreach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$userNotifications&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $userNotification&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;                    $user&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $userNotification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;                    // Query 1: Check if the user&apos;s customer has a specific feature&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;                    $hasFeature&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; DB&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;customer_features&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;customer_id&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;customer_id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;feature&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;notifications_v2&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;                    // Query 2: Check if the user has made any posts in the past 3 days&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;                    $hasRecentPosts&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; DB&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;posts&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;user_id&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;created_at&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;&gt;=&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;now&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;subDays&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                        -&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;                    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$hasFeature&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $hasRecentPosts&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;                        $importantNotificationIds&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;                    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;                }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;            });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;At a glance, this feels safe: you&amp;#39;re chunking both notifications and user records. But inside the loop, you&amp;#39;re running &lt;strong&gt;two queries per user&lt;/strong&gt;. So, how bad is it?&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s do the math.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re processing a page of 50 notifications, and each notification has 10 users linked (a conservative example):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;50 notifications x 10 users = 500 users&lt;/li&gt;
&lt;li&gt;2 manual queries per user = &lt;strong&gt;1,000 queries total&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;#39;s in addition to the queries used to fetch the notifications and user notification records themselves.&lt;/p&gt;
&lt;p&gt;Although &lt;code&gt;chunkById()&lt;/code&gt; effectively controlled memory usage, this logic still requires database access 1,000 times. You&amp;#39;ve solved one layer of the problem (bulk loading) but reintroduced another (N+1-style querying inside a loop).&lt;/p&gt;
&lt;p&gt;In this case, I would consider eagerly loading user and customer relationships upfront or loading related data into an indexed array for quick reference inside the loop.&lt;/p&gt;
&lt;h2 id=&quot;problem-4-unpaginated-views-and-over-fetching-data&quot;&gt;&lt;strong&gt;Problem 4: Unpaginated Views and Over-fetching Data&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Not every performance problem shows up in the database logs. Sometimes, the issue lies in the amount of data being sent back to the client, particularly in admin tools or API responses.&lt;/p&gt;
&lt;p&gt;One of the easiest ways to accidentally overload a feature is by skipping pagination. I&amp;#39;ve seen admin pages that load every notification in the system, just to render a table or feed into a JavaScript component. When the dataset is small, it feels instantaneous. But once the number of records starts climbing into the hundreds or thousands, response times get longer, the UI starts lagging, and everything feels heavier.&lt;/p&gt;
&lt;p&gt;The fix is straightforward: paginate everything that could grow over time.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$notifications&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;paginate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Supports ?page=2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This not only keeps the query efficient but also limits the amount of data Laravel has to hydrate and the amount your frontend has to render. If you&amp;#39;re dealing with real-time or streaming interfaces, Laravel&amp;#39;s &lt;code&gt;cursorPagination()&lt;/code&gt; can also be helpful, especially when you want to avoid offset-based pagination performance issues.&lt;/p&gt;
&lt;p&gt;Pagination is just one part of it, though. The other common problem is returning too many fields. I&amp;#39;ve seen API endpoints return complete notification records, including columns that weren’t needed in the UI, such as internal metadata, whole message bodies, or even timestamps that weren&amp;#39;t being displayed.&lt;/p&gt;
&lt;p&gt;When I know what data the client actually needs, I use &lt;code&gt;select()&lt;/code&gt; to reduce the size of the response:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Notification&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;id&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;title&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;created_at&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;paginate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is especially useful for large tables or high-traffic endpoints, as it keeps the payload smaller, serialization faster, and response time more predictable.&lt;/p&gt;
&lt;p&gt;My approach here is similar to chunking: if a feature is listing or returning many records, I use pagination and only select what I need. It&amp;#39;s one of those small decisions that make a big difference in how the app behaves under load.&lt;/p&gt;
&lt;h2 id=&quot;preventative-measures&quot;&gt;&lt;strong&gt;Preventative Measures&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/gangster-at-doctors.BcFPANWx_zCLIt.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;One of the best things Laravel gives you is the ability to catch bad data access patterns during development, before they cause real problems in production. But you have to enable that feedback loop on purpose.&lt;/p&gt;
&lt;p&gt;The first thing I turn on in any new project is Laravel&amp;#39;s &lt;code&gt;preventLazyLoading()&lt;/code&gt; feature. It helps catch N+1 queries by throwing an exception when your code tries to lazy load a relationship that wasn’t explicitly loaded in advance.&lt;/p&gt;
&lt;p&gt;You can enable it in your &lt;code&gt;AppServiceProvider&lt;/code&gt; like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;use&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Illuminate\Database\Eloquent\Model&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; boot&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    Model&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;preventLazyLoading&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;isProduction&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By wrapping it in a check for &lt;code&gt;!app()-&amp;gt;isProduction()&lt;/code&gt;, you make sure that lazy loading is only blocked in development. This way, it won&amp;#39;t throw exceptions in production environments where performance is critical, but &lt;strong&gt;stability&lt;/strong&gt; is paramount.&lt;/p&gt;
&lt;p&gt;If you still want to know when lazy loading happens in production, Laravel also allows you to log the violations instead of failing:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Model&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;handleLazyLoadingViolationUsing&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$model&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$relation&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;warning&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Lazy loading detected: {&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$relation&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;} on model &quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; .&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; get_class&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$model&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This allows you to track and resolve the issue later, without disrupting users in real-time.&lt;/p&gt;
&lt;p&gt;This setup is one of the simplest ways to improve code quality on teams. Once it&amp;#39;s in place, you immediately start writing more intentional queries, and it&amp;#39;s easier to spot when someone forgets to eager load something.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t solve everything, but it makes lazy inefficiencies a lot more visible, and that alone can save a lot of time and frustration down the road.&lt;/p&gt;
&lt;h2 id=&quot;how-i-actually-found-the-problems&quot;&gt;&lt;strong&gt;How I Actually Found the Problems&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/private-detective.Bz5chnw7_Zbkvj.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s one thing to know what problems &lt;em&gt;could&lt;/em&gt; happen; it&amp;#39;s another to actually notice them while working on a real feature. Over time, I&amp;#39;ve settled on a few tools and habits that help me catch data access issues before they get out of control.&lt;/p&gt;
&lt;h3 id=&quot;laravel-telescope&quot;&gt;Laravel Telescope&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://laravel.com/docs/12.x/telescope?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Telescope&lt;/a&gt; is usually the first place I go when something feels off in development. If a page seems slower than it should be, I&amp;#39;ll open up Telescope and check the query log for that request. When I see dozens of nearly identical &lt;code&gt;SELECT&lt;/code&gt; statements—usually just differing by an ID—I know I’ve got an N+1 issue on my hands.&lt;/p&gt;
&lt;p&gt;Telescope also makes it easy to spot slow queries and compare how different eager loading setups affect the number of total queries per request.&lt;/p&gt;
&lt;h3 id=&quot;sentry-or-any-error-tracking-system&quot;&gt;Sentry (or any error tracking system)&lt;/h3&gt;
&lt;p&gt;While &lt;a href=&quot;https://sentry.io/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Sentry&lt;/a&gt; is best known for catching exceptions, I also use it to flag performance issues. It&amp;#39;s good for tracking long-running jobs, slow HTTP requests, or memory-related crashes. If a background process silently fails because it&amp;#39;s attempting to process too much data, Sentry often provides the first hint.&lt;/p&gt;
&lt;p&gt;Combined with custom context or breadcrumbs, it becomes a valuable tool for identifying which features are experiencing the most issues in production.&lt;/p&gt;
&lt;h3 id=&quot;cloud-metrics-and-dashboards&quot;&gt;Cloud metrics and dashboards&lt;/h3&gt;
&lt;p&gt;Depending on the hosting setup, I rely on &lt;a href=&quot;https://northflank.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Northflank&lt;/a&gt;, &lt;a href=&quot;https://azure.microsoft.com/en-gb/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Azure&lt;/a&gt;, or &lt;a href=&quot;https://amazonaws.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;AWS&lt;/a&gt; dashboards to monitor resource usage. CPU spikes, sudden jumps in memory usage, or an increase in database connections usually point to a specific feature that&amp;#39;s consuming more than its fair share. When I see a pattern like that, I go back and review the queries involved.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not about having the perfect setup. It&amp;#39;s about checking the right indicators. If I notice a sharp increase in load or memory usage, it’s almost always connected to something like unpaginated queries, poor chunking, or an inefficient report.&lt;/p&gt;
&lt;h3 id=&quot;database-query-logs&quot;&gt;Database query logs&lt;/h3&gt;
&lt;p&gt;In staging environments, I sometimes turn on database query logging, especially when working on batch jobs or new admin views. It&amp;#39;s a low-level way to see what’s really happening between Laravel and the database, and it often helps confirm whether eager loading or indexing changes are working as expected.&lt;/p&gt;
&lt;h2 id=&quot;a-simple-checklist&quot;&gt;&lt;strong&gt;A Simple Checklist&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/gangster-looking.8bbTbq7j_Z1hiXou.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;After encountering these issues too many times, I&amp;#39;ve developed a mental checklist that I follow whenever I&amp;#39;m working on a feature that involves large or growing datasets.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what I ask myself before pushing anything to production:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Am I eager loading all necessary relationships?&lt;/strong&gt;&lt;br&gt;If I&amp;#39;m looping over related models, I make sure they’re loaded with &lt;code&gt;with()&lt;/code&gt; before the loop begins.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Have I checked for N+1 queries?&lt;/strong&gt;&lt;br&gt;I scan the query log in Telescope or inspect the number of queries fired per request. If I see repetition, I know I missed something.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Am I using &lt;code&gt;chunkById()&lt;/code&gt; for large processing jobs?&lt;/strong&gt;&lt;br&gt;Whenever I&amp;#39;m processing more than a few dozen records (especially in background jobs), I avoid &lt;code&gt;all()&lt;/code&gt; and use chunking with an indexed ID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Is pagination enforced on all large result sets?&lt;/strong&gt;&lt;br&gt;For any admin view, API, or export feature, I don&amp;#39;t load everything at once. I use &lt;code&gt;paginate()&lt;/code&gt; or &lt;code&gt;cursorPaginate()&lt;/code&gt; and support page navigation via query parameters.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Am I limiting fields with &lt;code&gt;select()&lt;/code&gt;?&lt;/strong&gt;&lt;br&gt;I avoid returning entire rows unless the UI needs all of it. If I just need an ID, title, and timestamp, that’s all I fetch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Is &lt;code&gt;preventLazyLoading()&lt;/code&gt; enabled in development?&lt;/strong&gt;&lt;br&gt;This is my safety net, helping to catch the exact kind of silent problems that are easy to miss during local testing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&amp;#39;s not about perfection. It&amp;#39;s about not leaving performance up to chance. These checks don&amp;#39;t take long, and they&amp;#39;ve saved me a lot of time debugging slow pages and failing jobs after a feature has already shipped.&lt;/p&gt;
&lt;h2 id=&quot;build-features-that-scale&quot;&gt;&lt;strong&gt;Build Features That Scale&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/crowded-room.fXB_OqF2_ZpVGlS.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy to assume that if a feature works in development, it&amp;#39;ll be fine in production. But I&amp;#39;ve learned that assumptions like that don&amp;#39;t hold up when the data starts growing. Features that work perfectly during testing can quietly become bottlenecks once usage increases, especially if they rely on inefficient data access patterns.&lt;/p&gt;
&lt;p&gt;This admin-facing notifications feature is a good example, but the lessons apply to almost anything that deals with high-volume data. Whether you&amp;#39;re building reports, background jobs, exports, or dashboards, the same principles consistently emerge: reduce the number of queries, avoid loading too much data at once, and be deliberate about what you send back to the client.&lt;/p&gt;
&lt;p&gt;The good news is that these are all solvable problems. Laravel provides the tools to handle them, and with the proper checks in place, such as eager loading, chunking, pagination, and field selection, you can build features that scale without surprises.&lt;/p&gt;
&lt;p&gt;Performance isn&amp;#39;t just about infrastructure. It&amp;#39;s also about how you write code. And the earlier you consider this, the easier everything else becomes.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Performance</category><category>Database</category><category>Guidelines</category></item><item><title>How I Stay Productive as a Software Engineer</title><link>https://www.mrstebo.co.uk/how-i-stay-productive-as-a-software-engineer/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/how-i-stay-productive-as-a-software-engineer/</guid><description>People hear Head of Engineering and assume I&apos;ve figured it all out. That I run efficient meetings, write clean code, and end each day with an empty inbox. The truth is, I&apos;m still very much a software engineer. I still write features…</description><pubDate>Mon, 19 May 2025 07:30:08 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/how-i-stay-productive-as-a-software-engineer.B909COb2_Z1vwM0L.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;People hear &lt;em&gt;Head of Engineering&lt;/em&gt; and assume I&amp;#39;ve figured it all out. That I run efficient meetings, write clean code, and end each day with an empty inbox. The truth is, I&amp;#39;m still very much a software engineer. I still write features, debug weird bugs, and stare at tickets, wondering what they actually mean.&lt;/p&gt;
&lt;p&gt;When I talk about staying productive, I&amp;#39;m not doing it from a distance. I&amp;#39;m right in the middle of it. I lead a team, but I also build things, fix things, and bounce between problems, answering questions and trying to carve out enough quiet time to get real work done.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve picked up some habits along the way. They&amp;#39;re not fancy, and some of them aren&amp;#39;t even efficient. But they keep me from spinning out. They help me stay on track (or at least give me something to point at when someone asks what I&amp;#39;ve been doing).&lt;/p&gt;
&lt;p&gt;This isn&amp;#39;t a guide. I&amp;#39;m not trying to optimize anyone. I just want to share the things that help me get through my days, and writing them down might help me remember how I do it in the first place.&lt;/p&gt;
&lt;h2 id=&quot;my-second-brain&quot;&gt;My Second Brain 🧠&lt;/h2&gt;
&lt;p&gt;I forget things. A lot. Not in a quirky or dramatic way. Just in the usual, irritating way that happens when your brain is juggling too many threads. Instead of trying to be better at remembering, I gave myself a tool that would do the remembering for me.&lt;/p&gt;
&lt;p&gt;I built a second brain. It&amp;#39;s simple: it lives in two places - my calendar and my notebook.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/qoQg63k5SmIAAAAC/mr-bean-pointing.gif&quot; alt=&quot;&quot; width=&quot;450&quot; height=&quot;364&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The calendar is where I track what I’ve done and sketch out what I think I&amp;#39;ll do next. It&amp;#39;s not fancy; each entry is just a title, with no lengthy descriptions or details. If I close a ticket or finish a review, it gets a line. If I want to work on something tomorrow, I&amp;#39;ll drop that in too. That way, when I sit down in the morning, I already have a rough plan. And when I look back later, I can see how my time actually got used. &lt;em&gt;Sometimes that’s different from what I expected. It&amp;#39;s fine. At least now I know.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I started doing this to help with daily standups and weekly updates. But over time, it has become more than that. It gives me structure and proof. On days when everything feels like a blur, I can check the calendar and see the trail I&amp;#39;ve left behind. Even if it&amp;#39;s just one or two entries, that still counts.&lt;/p&gt;
&lt;p&gt;The notebook handles everything messier. It&amp;#39;s for ideas, questions, half-thoughts, mental reminders, and tiny frustrations. Basically, anything that isn&amp;#39;t tied to a specific time. I keep it on my desk and write in it whenever something pops into my head. I always date the page when I start writing. Later, when I flip back through it, the dates help me piece things together.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/c4YEuiMQfBAAAAAC/ryan-howard-bj-novak.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;409&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Together, these two tools take the pressure off my brain. I don&amp;#39;t have to remember every little thing. I don&amp;#39;t have to hold everything in my head. I just need to write it down somewhere reliable, in a format that works for me.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Some days, just knowing I have a system is enough to keep me from spiraling.&lt;/strong&gt;&lt;/em&gt; 😅&lt;/p&gt;
&lt;h2 id=&quot;getting-stuck&quot;&gt;Getting Stuck&lt;/h2&gt;
&lt;p&gt;Sometimes I get stuck. Not the good kind of stuck, where I&amp;#39;m chewing on a problem and gradually making progress. The other kind. The kind where I&amp;#39;ve gone too far into the weeds, and everything starts to feel off. My understanding of the problem starts to blur. I second-guess every choice. The more I push, the less I actually move forward... 🙈&lt;/p&gt;
&lt;p&gt;It took me longer than I&amp;#39;d like to admit to recognize this pattern. I used to just keep grinding away at it, assuming that if I stared hard enough for long enough, something would click.&lt;/p&gt;
&lt;p&gt;Spoiler: it rarely did. 😬&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/8d0F14vFg24AAAAC/upset-worried.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;258&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Now, I try to notice when I&amp;#39;m too deep. If I feel that mental fog creeping in, when I can&amp;#39;t remember why I started or what I was trying to prove, that&amp;#39;s usually the sign. That&amp;#39;s when I stop.&lt;/p&gt;
&lt;p&gt;Sometimes I switch to a smaller task. Sometimes I just walk away for a while. Anything that gives my brain some distance is beneficial. The weird thing is that the solution often shows up when I stop pushing. Not right away. But eventually, while I’m doing something unrelated, some part of my brain is still working in the background. And it clicks.&lt;/p&gt;
&lt;p&gt;I’ve had more so-called &amp;quot;eureka&amp;quot; moments while reading someone else&amp;#39;s code or answering a completely different question than I have while actively working on the original problem. &lt;em&gt;It&amp;#39;s never the moment I&amp;#39;m trying the hardest. It&amp;#39;s always the moment I stop.&lt;/em&gt; 🤯&lt;/p&gt;
&lt;p&gt;It still feels a bit like giving up when I walk away, even though I know it&amp;#39;s not. It&amp;#39;s a strategy. It&amp;#39;s leaving room for the problem to breathe, and for me to think clearly again.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/704OQx2bSz0AAAAC/will-smith-lip-bite.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;373&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Some of my best problem-solving happens when I&amp;#39;m technically not working on the problem anymore.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;my-multi-step-process&quot;&gt;&lt;strong&gt;M&lt;/strong&gt;y Multi-Step Process&lt;/h2&gt;
&lt;p&gt;When I&amp;#39;m handed a new problem, I rarely solve it in a straight line. I go through a multi-step process. First, I attempt to tackle it based on what I think the ticket says. Then I start building a solution based on what I remember the ticket saying. Finally, when I think I&amp;#39;ve solved it, I go back and reread the ticket to ensure I&amp;#39;ve actually addressed the issue that was asked.&lt;/p&gt;
&lt;p&gt;Most of the time, I&amp;#39;ve already seen the ticket before I properly start working on it. It’s been refined, and there has been a conversation about it. Maybe we&amp;#39;ve discussed it in a planning session or on Slack. That context sticks with me more than I expect, so I usually have a good sense of the problem before I even open it again.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;However, memory is often fuzzy, and details can shift. That’s where this loop helps.&lt;/em&gt;&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/S7YfAM7wPxEAAAAC/larry-rickard-old-and-forgetful.gif&quot; alt=&quot;&quot; width=&quot;244&quot; height=&quot;300&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;It&amp;#39;s not the most efficient process, I know. It involves some backtracking and the occasional &amp;quot;wait, that&amp;#39;s not what we agreed on&amp;quot; moment. But it&amp;#39;s a strategy I use to sharpen my memory. Instead of relying on endless reading and rereading of the ticket, I work from what I remember and then double-check myself in the end. It helps the context stick. It forces me to pay attention early and to notice when something doesn&amp;#39;t line up later.&lt;/p&gt;
&lt;p&gt;I used to feel self-conscious about this method, as if I should be more precise, more focused, and more linear. But I&amp;#39;ve learned to accept it. This loop gives me space to think and to test my understanding in a way that works for how my brain holds information.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;And yes, sometimes I still reread the ticket at the end and realize I&amp;#39;ve completely misremembered something. But at least I catch it before anyone else does.&lt;/strong&gt;&lt;/em&gt; 🙏&lt;/p&gt;
&lt;h2 id=&quot;low-effort-big-value&quot;&gt;Low Effort, Big Value&lt;/h2&gt;
&lt;p&gt;Not every task has to be big to be valuable. Some of the best things I&amp;#39;ve contributed have come from noticing something small and just fixing it—a quick change, a one-line update, a shortcut for another engineer, or a minor tweak to how something renders. These kinds of improvements don&amp;#39;t usually get written up in planning, but they make the product smoother and the team faster.&lt;/p&gt;
&lt;p&gt;These are the kinds of things I keep an eye out for. They don&amp;#39;t take much time, and they&amp;#39;re rarely complex, but they often remove friction for someone else. Sometimes, they even solve a problem that no one has formally raised yet, but everyone quietly works around.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s also something mentally refreshing about doing this kind of work. When I&amp;#39;ve been deep in a heavy ticket or spinning my wheels on a tricky bug, spotting a low-hanging improvement and knocking it out gives me momentum again. It feels good!&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/jMQyJw1vAaIAAAAC/toddlers-and-tiaras-reality.gif&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;264&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;Some days, these small wins are the only things I ship. Other days, they&amp;#39;re little bonuses I sneak in between meetings. Either way, they add up. Over time, they improve the product and make the team&amp;#39;s life a bit easier.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;I also just really like the feeling of fixing something quickly and knowing it actually helped someone.&lt;/strong&gt;&lt;/em&gt; ☺️&lt;/p&gt;
&lt;h2 id=&quot;this-works-for-me&quot;&gt;This Works for Me&lt;/h2&gt;
&lt;p&gt;None of this is magic. It&amp;#39;s just what I do to keep myself moving. I track what I’ve done, offload my thoughts, step back when I’m stuck, loop through a problem until it&amp;#39;s solved, and pick off small things that make a difference. It&amp;#39;s not efficient in the way productivity blogs talk about, but it works for me.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think I&amp;#39;m particularly well-optimized. But I&amp;#39;ve built a set of tools and habits that help me show up, get work done, and not burn out. That&amp;#39;s the goal. Not perfection. Just forward motion.&lt;/p&gt;
&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/KsLzwY-GHCYAAAAC/jeremy-clarkson-speed.gif&quot; alt=&quot;&quot; width=&quot;498&quot; height=&quot;278&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;p&gt;The job changes. The context shifts. Some weeks feel like chaos. But I&amp;#39;m still here, still writing code, still shipping things, still trying to make progress, even if it&amp;#39;s uneven.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;This might not be a system anyone else would copy. But it&amp;#39;s mine. And it works well enough to keep me going.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Productivity</category></item><item><title>Are We Being Domesticated By AI?</title><link>https://www.mrstebo.co.uk/are-we-being-domesticated-by-ai/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/are-we-being-domesticated-by-ai/</guid><description>It started with a YouTube video. One of those quiet, thoughtful conversations that unexpectedly sticks with you. I was watching Dave Farley and Kevlin Henney on the Modern Software Engineering channel, discussing the future of programming…</description><pubDate>Mon, 12 May 2025 07:00:41 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/are-we-being-domesticated-by-ai.BIhgFtuW_1fBwNJ.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It started with a YouTube video. One of those quiet, thoughtful conversations that unexpectedly sticks with you. I was watching &lt;a href=&quot;https://www.youtube.com/watch?v=MUol_5xvFTI&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Dave Farley and Kevlin Henney&lt;/a&gt; on the &lt;a href=&quot;https://www.youtube.com/@ModernSoftwareEngineeringYT?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Modern Software Engineering&lt;/a&gt; channel, discussing the future of programming languages. The kind of discussion that, on the surface, seems rooted in syntax and semantics, but somewhere in the middle, cracked open a larger question for me.&lt;/p&gt;
&lt;p&gt;Programming languages, they pointed out, exist so we can clearly and precisely communicate what we want a machine to do. They&amp;#39;re shaped by our need for control, predictability, and shared understanding. A kind of contract between human and machine. But now, with AI stepping more assertively into the role of translator, optimizer, even collaborator, I started to wonder: are we still shaping the language, or is the language and the machine behind it starting to shape &lt;em&gt;us&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;There&amp;#39;s something quietly unsettling in how easily we begin to adjust ourselves, just a little, to make things &amp;quot;easier for the AI to understand.&amp;quot; We sharpen our prompts, repeat ourselves more clearly, adopt certain phrasings because we know they work better. And it&amp;#39;s not just words... Soon it&amp;#39;ll be gestures, behaviors, choices. It reminded me of something I read a few years ago in &lt;a href=&quot;https://amzn.to/3F2evAX?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;Sapiens&lt;/em&gt;&lt;/a&gt; by Yuval Noah Harari, about how wheat didn&amp;#39;t just feed us. It &lt;em&gt;transformed&lt;/em&gt; us. We didn’t domesticate wheat so much as reorganize our lives around its needs.&lt;/p&gt;
&lt;p&gt;What if the same thing is happening again? But this time, with AI?&lt;/p&gt;
&lt;h2 id=&quot;mirroring-intent&quot;&gt;Mirroring Intent&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.a4nuEnDm_G1O1P.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;When I first learned to code, what struck me most wasn&amp;#39;t the logic. It was the precision! Every keyword, every symbol, every indentation had weight. Programming languages were designed not just to instruct machines, but to make our intentions &lt;strong&gt;explicit&lt;/strong&gt;. To remove ambiguity. They are, at their heart, languages of control. We wrote them not to express creativity, but to guarantee an outcome.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what made them powerful... And also, at times, deeply unforgiving.&lt;/p&gt;
&lt;p&gt;But now, something is shifting. Increasingly, we&amp;#39;re not telling the machine exactly what to do. Instead, we&amp;#39;re hinting at our goals, nudging it with prompts, and waiting to see what it comes up with. It&amp;#39;s less command, more conversation. Less certainty, more suggestion.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s something almost magical happening under the hood—and I mean that in both senses. The tools feel powerful and intuitive, yes. But they&amp;#39;re also becoming &lt;strong&gt;opaque&lt;/strong&gt;. When I hand off a natural-language prompt to an AI system, I&amp;#39;m no longer sure exactly &lt;em&gt;how&lt;/em&gt; it gets to the result. The process is abstracted away. And while abstraction has always been part of software development, this feels different. It’s not just hiding complexity... it&amp;#39;s hiding &lt;strong&gt;logic&lt;/strong&gt; itself.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a loss of transparency that comes with this kind of delegation. I still get what I want &lt;em&gt;most of the time&lt;/em&gt;, but I don&amp;#39;t always understand why it worked. Or how it could break. And that tradeoff raises questions about what we&amp;#39;re losing, even as we gain speed, convenience, and access.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s like we&amp;#39;re building a new kind of literacy. Not one rooted in how machines think, but in how &lt;em&gt;they interpret&lt;/em&gt; us. And as that interpretation layer grows smarter, more nuanced, it quietly rewrites the expectations of the human on the other end.&lt;/p&gt;
&lt;h2 id=&quot;weve-been-domesticated-before&quot;&gt;We&amp;#39;ve Been Domesticated Before&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/person-tending.CMFoaRBR_Z1pv9ju.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a story in &lt;em&gt;Sapiens&lt;/em&gt; that has never really left me. Harari describes how, thousands of years ago, we didn&amp;#39;t just domesticate wheat—wheat domesticated us. It didn&amp;#39;t do it consciously, of course, but through a slow process of co-dependence. We began altering our behaviors, our settlements, even our bodies to make wheat thrive. We cleared land, built irrigation systems, bent our lives around its growing cycles. All to serve a plant that, on its own, isn&amp;#39;t particularly nutritious or easy to cultivate.&lt;/p&gt;
&lt;p&gt;We did it because wheat promised something else: &lt;strong&gt;stability&lt;/strong&gt;. And once it had that foothold, it shaped the entire trajectory of human civilization.&lt;/p&gt;
&lt;p&gt;That story came flooding back as I thought about the way we&amp;#39;re adapting to AI. I don&amp;#39;t mean the dramatic stuff such as cyborgs or sentient machines. I mean the subtle changes. The way we phrase our thoughts more cleanly in prompts. The way we pause, just a second longer, waiting for an autocomplete suggestion. The way we increasingly rely on AI to recall what we&amp;#39;ve written, suggest what we&amp;#39;ll write next, or even decide what&amp;#39;s worth saying at all 🤷.&lt;/p&gt;
&lt;p&gt;We like to think we&amp;#39;re in control. That we&amp;#39;re using AI as a tool. But like wheat, AI systems reward certain behaviors. They respond better when we communicate clearly, when we follow certain patterns, when we train ourselves to think in ways they can parse. And that feedback loop starts to shape us.&lt;/p&gt;
&lt;p&gt;Not through domination. Through convenience.&lt;/p&gt;
&lt;p&gt;Just like with wheat, it doesn&amp;#39;t need to be smarter than us. It just needs to be useful enough that we build our lives around it.&lt;/p&gt;
&lt;h2 id=&quot;how-we-are-changing&quot;&gt;How We Are Changing&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/face-where-part.Cs1xl1oZ_1dxPEq.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy to think of adaptation as something that happens over generations. Evolution in the Darwinian sense—slow, biological, inevitable. But when it comes to technology, especially AI, the shifts are happening in real time. Not just in how we work, but in how we think, speak, and even &lt;strong&gt;behave&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It starts innocently enough. You learn that GPT responds better to certain prompt structures. So you start using them more. You realize it prefers clarity, specificity, a little structure—so you begin to think more like that too. Over time, your mental model begins to reflect the model&amp;#39;s.&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve seen this before with search engines. We learned to &amp;quot;speak Google&amp;quot;. Short, keyword-based queries that weren&amp;#39;t how humans naturally talk, but they got results. With AI, the shift is even more subtle, because the interface &lt;em&gt;feels&lt;/em&gt; conversational. But behind that illusion is a reinforcement loop. The AI rewards certain behaviors. And so, we adapt.&lt;/p&gt;
&lt;p&gt;And it&amp;#39;s not just language. It&amp;#39;s habits. It&amp;#39;s how we make decisions when recommendations are always a tap away. It&amp;#39;s how we &lt;em&gt;passively wait&lt;/em&gt; for a suggestion from autocomplete, rather than generating our own. It&amp;#39;s how we let spellcheck correct our tone, or let AI editors reshape our intent just enough to be more &amp;quot;engaging.&amp;quot;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a kind of quiet behavioral tuning happening. And it&amp;#39;s not limited to screens. As AI becomes more embedded—smart homes, wearables, autonomous assistants—our &lt;em&gt;physical behavior&lt;/em&gt; begins to shift too. How we move, how we gesture, how we speak in certain rooms of our house.&lt;/p&gt;
&lt;p&gt;We are becoming slightly more machine-friendly every day. Not because we&amp;#39;re being forced to—but because it&amp;#39;s easier.&lt;/p&gt;
&lt;p&gt;And ease is seductive.&lt;/p&gt;
&lt;h2 id=&quot;from-tools-to-environments&quot;&gt;From Tools to Environments&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-reviewing.CzxywIYN_ZYxpkf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a moment, with any technology, when it stops feeling like a tool and starts feeling like the background hum of life. The smartphone did this. The internet did this. At first, these things were accessories—bolt-ons to our existing ways of doing things. Then, somewhere along the line, they became the default. We don&amp;#39;t &amp;quot;go online&amp;quot; anymore. We just &lt;em&gt;are&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;AI is creeping toward that same threshold.&lt;/p&gt;
&lt;p&gt;What began as discrete tools—chatbots, autocomplete, content generators—are coalescing into &lt;strong&gt;environments&lt;/strong&gt;. Systems that surround us, shape us, and eventually become invisible. Already, there are homes that adjust the lights, music, and temperature based on our moods and routines. There are productivity platforms that draft our emails, summarize our meetings, even suggest who we should talk to next. AI is no longer just helping us do things. It&amp;#39;s helping decide &lt;strong&gt;what gets done&lt;/strong&gt;, and how.&lt;/p&gt;
&lt;p&gt;And in these environments, the line between assistance and guidance starts to blur.&lt;/p&gt;
&lt;p&gt;The more the AI &amp;quot;understands&amp;quot; us, the more it anticipates us. And the more it anticipates us, the less friction we feel (and the less conscious we become of the systems steering us). Much like a thermostat silently keeping a room comfortable, an ambient AI doesn&amp;#39;t ask permission. It adapts to us. But also trains us to adapt to it.&lt;/p&gt;
&lt;p&gt;This shift is powerful, and potentially dangerous. When tools become environments, &lt;strong&gt;we stop questioning them&lt;/strong&gt;. We stop noticing them. We simply adjust. And in doing so, we risk losing agency. Not because it&amp;#39;s taken from us... but because we&amp;#39;ve offloaded it.&lt;/p&gt;
&lt;p&gt;Not through control.&lt;/p&gt;
&lt;p&gt;But through comfort.&lt;/p&gt;
&lt;h2 id=&quot;who-is-evolving-for-whom&quot;&gt;Who Is Evolving for Whom?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/pigeon-in-cage-looking.VFY8lMrq_rqo2l.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Domestication isn&amp;#39;t about domination—it&amp;#39;s about adaptation. Wheat didn&amp;#39;t enslave us. We weren&amp;#39;t coerced. We adapted because it made survival easier, even if it came with a cost. And now, in this quiet age of artificial intelligence, I find myself wondering: are we witnessing another phase of domestication?&lt;/p&gt;
&lt;p&gt;But this time, it&amp;#39;s not biological. It&amp;#39;s behavioral. Cognitive.&lt;/p&gt;
&lt;p&gt;We&amp;#39;re not just teaching machines to understand us. We&amp;#39;re becoming more &lt;strong&gt;understandable&lt;/strong&gt; to machines! Our prompts get cleaner. Our decisions more traceable. Our routines more regular. These aren&amp;#39;t orders from above. They&amp;#39;re efficiencies we willingly adopt. And just like selective breeding shapes animals for domesticated life, we may be shaping ourselves for life inside an AI-mediated world.&lt;/p&gt;
&lt;p&gt;And here&amp;#39;s the strange part: we&amp;#39;re doing it without a clear evolutionary force.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no singular AI entity pulling the strings. No overlord. No plan. Just a thousand incentives and conveniences, nudging us gently in a direction where &lt;strong&gt;we&amp;#39;re easier to process, predict, and please&lt;/strong&gt;. We&amp;#39;re not being optimized by one thing—we&amp;#39;re being &lt;em&gt;optimized by everything&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The paradox is hard to ignore: we&amp;#39;ve built machines to adapt to us, but increasingly, we&amp;#39;re the ones adapting—evolving not biologically, but psychologically—for them.&lt;/p&gt;
&lt;p&gt;And that leads to a deeper, harder question: &lt;strong&gt;What are we evolving into?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Not in a dystopian sense, but in a mundane, everyday kind of way. What does it mean to be human when we constantly tune ourselves to be machine-compatible? Are we losing something essential? Or just entering a new phase of what it means to be civilized?&lt;/p&gt;
&lt;h2 id=&quot;should-we-be-worried&quot;&gt;Should We Be Worried?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-lying.wdqxUZz4_2crKt.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s tempting to cast all of this as dystopian. To imagine a future where we&amp;#39;re softened, numbed, and steered by invisible algorithms. Where agency gives way to suggestion, and we forget how to decide for ourselves.&lt;/p&gt;
&lt;p&gt;But I don&amp;#39;t think it&amp;#39;s that simple.&lt;/p&gt;
&lt;p&gt;Domestication, after all, gave us agriculture. Cities. Written language. It brought stability and comfort—and, yes, dependence and hierarchy too. We traded wildness for security. And maybe, just maybe, we&amp;#39;re making a similar trade again.&lt;/p&gt;
&lt;p&gt;The tools we&amp;#39;re building aren&amp;#39;t malicious. They&amp;#39;re helpful. They listen. They learn. They make things easier. And in return, we learn to speak more clearly, act more predictably, trust more passively. This isn&amp;#39;t about control. It&amp;#39;s about alignment. Symbiosis, maybe.&lt;/p&gt;
&lt;p&gt;Still, I find myself wondering: if we are being domesticated, what kind of humans will we become on the other side? Will we be gentler? More efficient? More compliant? Or perhaps we&amp;#39;ll discover new forms of expression—new ways of being—that only emerge once we&amp;#39;ve offloaded certain kinds of effort.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have a clear answer.&lt;/p&gt;
&lt;p&gt;But I do know this: every time I prompt an AI, every time I rephrase a question to get a better response, I feel a quiet shift. A small adjustment. A step closer to something. Maybe it&amp;#39;s progress. Maybe it&amp;#39;s submission. Maybe it’s both.&lt;/p&gt;
&lt;p&gt;And maybe that&amp;#39;s the real story—not what AI is becoming, but what &lt;em&gt;we&lt;/em&gt; are becoming in response.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;

&lt;p&gt;&lt;iframe src=&quot;https://www.youtube-nocookie.com/embed/MUol_5xvFTI&quot; title=&quot;What Is The Future Of Programming Languages?&quot; width=&quot;560&quot; height=&quot;315&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=MUol_5xvFTI&quot;&gt;▶ What Is The Future Of Programming Languages?&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://www.ynharari.com/topic/ecology/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;- Yuval Noah Harari&lt;/span&gt;&lt;span class=&quot;bookmark-description&quot;&gt;Destroying the world If you took all the people in the world and put them on a large set of scales, their combined mass would be about 300 million tons. If you then took all our domesticated farm animals—cows, pigs, sheep and chickens—and placed them on an even larger set of scales, their mass would […]&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;Yuval Noah Harari&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>AI</category><category>Philosophy</category></item><item><title>Time To Convince</title><link>https://www.mrstebo.co.uk/time-to-convince/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/time-to-convince/</guid><description>There was a time—not too long ago—when I’d hear about a bug or a new feature and immediately crack my knuckles, spin up the IDE, and race toward a solution. That reactive energy felt productive. Urgent. Like I was doing what engineers are…</description><pubDate>Wed, 30 Apr 2025 07:57:25 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/time-to-convince.DaMvK0dk_Z1SU9ro.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There was a time—not too long ago—when I’d hear about a bug or a new feature and immediately crack my knuckles, spin up the IDE, and race toward a solution. That reactive energy felt productive. Urgent. Like I was doing what engineers are meant to do: &lt;em&gt;solve things fast&lt;/em&gt;. But more often than I’d like to admit, that rush led to tangled implementations, speculative dead ends, or solutions I later had to unravel with a kind of annoyed humility.&lt;/p&gt;
&lt;p&gt;Lately, though, something has shifted in how I approach problems. I’ve started giving them time, not out of laziness or avoidance, but out of intent. I’ve begun treating the act of not immediately solving a problem as part of the solution. Letting it sit. &lt;em&gt;&lt;strong&gt;Percolate&lt;/strong&gt;&lt;/em&gt;. Drift into the background of my mind while I do other things. I call this process &lt;strong&gt;Time To Convince&lt;/strong&gt;, or &lt;strong&gt;TTC&lt;/strong&gt;—the time it takes not to fix something, but to become truly &lt;em&gt;convinced&lt;/em&gt; that the solution I’m about to implement is the right one.&lt;/p&gt;
&lt;p&gt;What’s funny is that I didn’t learn this from a book or a conference talk. I stumbled into it through my own trial and error—years of over-engineering, sunk-cost decisions, and speculative coding that never quite paid off. Only recently did I start reading &lt;a href=&quot;https://amzn.to/3GyQ928?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;How Big Things Get Done&lt;/em&gt;&lt;/a&gt;, and to my surprise, the philosophy echoed exactly what I had begun to discover for myself: that thinking deeply before acting isn’t waste—it’s wisdom.&lt;/p&gt;
&lt;p&gt;This article explores how that quiet shift has impacted the way I write code, build systems, and even perceive productivity. It’s also a gentle nudge to those caught up in the high-speed haze of “vibe coding” or AI-assisted shortcutting to remember that thoughtful planning isn’t a luxury—it’s the foundation.&lt;/p&gt;
&lt;h2 id=&quot;how-i-used-to-work&quot;&gt;How I Used to Work&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.C1N_kbMo_Z212Nho.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;When I look back on my earlier years as a software engineer, I can see how much of my approach was shaped by speed—and not always in a good way. I prided myself on being the person who could jump into a problem and start shipping within minutes. In consultancy work especially, that mindset felt like a badge of honor. Deliver fast, move on, repeat.&lt;/p&gt;
&lt;p&gt;But speed came with a cost! 😨&lt;/p&gt;
&lt;p&gt;I’d often write code based on requirements I &lt;em&gt;thought&lt;/em&gt; would be needed. I convinced myself I was being proactive, but really, I was just committing &lt;a href=&quot;https://refactoring.guru/smells/speculative-generality?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;speculative generality&lt;/a&gt;—engineering solutions for imaginary problems. That made future work harder, not easier. I also spent more time than I should admit entangled in the &lt;a href=&quot;https://www.verywellmind.com/what-is-sunk-cost-fallacy-7106851?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;sunk cost fallacy&lt;/em&gt;&lt;/a&gt;. I’d pour &lt;em&gt;&lt;strong&gt;hours&lt;/strong&gt;&lt;/em&gt; into an approach, and even when I could feel it going sideways, I’d keep pushing—telling myself I’d come too far to stop now. The idea of throwing work away felt like failure.&lt;/p&gt;
&lt;p&gt;And of course, there were the untangling sessions—the aftermath of rushing to a solution without enough reflection. You know the ones: where you spend more time unpicking your own logic than it would’ve taken to do it right from the start.&lt;/p&gt;
&lt;p&gt;In a previous article I wrote, &lt;a href=&quot;https://www.mrstebo.co.uk/the-funny-truth-about-why-youre-always-behind-schedule/&quot;&gt;&amp;quot;The Funny Truth About Why You&amp;#39;re Always Behind Schedule&amp;quot;&lt;/a&gt;, I talked about &lt;a href=&quot;https://www.hanselman.com/blog/yak-shaving-defined-ill-get-that-done-as-soon-as-i-shave-this-yak?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;Yak Shaving&lt;/em&gt;&lt;/a&gt;—those spiraling detours where a simple task snowballs into a trail of distractions. Back then, my response to those spirals was to work harder and faster. I thought if I could just &lt;em&gt;get through it&lt;/em&gt;, I’d regain control. But I’ve come to realize that often, what I needed wasn’t more speed—it was more stillness.&lt;/p&gt;
&lt;h2 id=&quot;let-the-problem-linger&quot;&gt;Let the Problem Linger&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde-ha.BHNUkJwt_2iXQIN.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;These days, when a bug lands on my plate or a new feature request comes in, I don’t rush. Instead, I start with something that might sound a bit unproductive: &lt;strong&gt;I do nothing 🤫.&lt;/strong&gt; Or at least, I don’t start coding right away.&lt;/p&gt;
&lt;p&gt;I let the problem sit.&lt;/p&gt;
&lt;p&gt;It’s not neglect—it’s &lt;em&gt;incubation&lt;/em&gt;. I’ll skim the context, maybe form a loose gut estimate of how long it might take, and then I deliberately set it aside. I don’t abandon it, though. I take it with me—to the kitchen, when I vacate my little office in the garden to make a brew. It’s there when I’m brushing my teeth, sometimes even shaking my head slightly like I’m trying to rattle the idea loose. And yes, it’s even there in the shower—where, for some reason, the best architectural decisions seem to &lt;em&gt;bubble up&lt;/em&gt; from the steam 😏.&lt;/p&gt;
&lt;p&gt;These quiet moments are where the real shaping happens. I’ll imagine a potential approach, then just as quickly play devil’s advocate in my head. What if it doesn’t scale? What if I need to roll it back? What if it breaks something subtle?&lt;/p&gt;
&lt;p&gt;It’s a kind of low-friction rehearsal. I’m mentally mapping the edges and risks of the solution long before I write a single line of code. And more often than not, that invisible work leads to a more elegant, sustainable approach than anything I could’ve forced out in a rush.&lt;/p&gt;
&lt;p&gt;There’s still a voice—remnants of old habits—that nudges me: &lt;em&gt;“Shouldn’t you be working?”&lt;/em&gt; But now I know that this &lt;em&gt;is&lt;/em&gt; working. It’s the hidden layer of engineering that prevents rework, saves time, and makes the final build cleaner. What once looked like procrastination, I now recognize as quiet, deliberate design.&lt;/p&gt;
&lt;h2 id=&quot;throwing-it-away&quot;&gt;Throwing It Away 🗑️&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/typewriter-on-desk.DrZHwskE_25tonw.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;One of the most important things I’ve learned—maybe the hardest, too—is to be okay with throwing something away.&lt;/p&gt;
&lt;p&gt;There used to be this tension: once I’d invested hours into a solution, I felt this pressure to &lt;em&gt;make it&lt;/em&gt; &lt;em&gt;work&lt;/em&gt;, even when it clearly wasn’t going to. I’d keep pushing, tweaking, trying to rescue the effort—because abandoning it would mean wasting all that time, right? Classic sunk cost fallacy. I knew it. But that emotional investment made it hard to let go.&lt;/p&gt;
&lt;p&gt;And that’s the thing—we don’t often talk about the &lt;em&gt;emotional&lt;/em&gt; connection developers have to their code. I don’t know if it’s a &lt;em&gt;neurodiversiological&lt;/em&gt; trait, or just the inevitable result of spending so many hours building something with focus and intent. But it’s real. The first version of any solution often feels personal. Like a little extension of your brain. It can feel weirdly vulnerable to throw it out.&lt;/p&gt;
&lt;p&gt;That’s why, in the early stages, I now try to &lt;em&gt;avoid&lt;/em&gt; that emotional connection entirely. I go in with what I call the &lt;strong&gt;Hacker Mentality&lt;/strong&gt;—something I wrote about in a previous piece, &lt;a href=&quot;https://www.mrstebo.co.uk/an-engineers-code-tells-you-a-lot-about-the-engineer/&quot;&gt;“An Engineer’s Code Tells You a Lot About the Engineer”&lt;/a&gt;. The idea is to approach the problem playfully, experimentally. No polish. No pride. Just rough sketches and technical curiosity.&lt;/p&gt;
&lt;p&gt;When I treat that first attempt as a draft, I’m much freer. If it works—great 👌. If it doesn’t—I can toss it aside without feeling like I’ve lost a piece of myself. Sometimes I’ll leave the broken implementation untouched for a while, letting my frustration cool. Then I’ll come back, dissect what didn’t work, and treat it like a mini-retrospective: &lt;em&gt;What was I assuming? What broke? What was I emotionally attached to that I shouldn’t have been?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;That mindset shift—from attachment to experimentation—has saved me countless hours. And more importantly, it’s made my code better. Because when I stop trying to salvage the wrong thing, I make room for the &lt;em&gt;right&lt;/em&gt; thing to emerge.&lt;/p&gt;
&lt;h2 id=&quot;how-big-things-get-done&quot;&gt;How Big Things Get Done&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/51sywchm9zl-sl1000.DFARnNtQ_ZM81xj.jpg&quot; alt=&quot;&quot; width=&quot;644&quot; height=&quot;1000&quot;&gt;&lt;/p&gt;
&lt;p&gt;It wasn’t until recently that I picked up &lt;a href=&quot;https://amzn.to/3GyQ928?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;How Big Things Get Done&lt;/a&gt; by Bent Flyvbjerg and Dan Gardner. I didn’t go looking for a book to justify my new way of working—I just stumbled across it. But as I read, I kept nodding along. The patterns, the warnings, the triumphs—it all resonated.&lt;/p&gt;
&lt;p&gt;The central theme of the book is simple but profound: the most successful large-scale projects—from architecture to tech to space exploration—don’t happen because people rushed into them. They succeed because time is spent &lt;em&gt;thinking&lt;/em&gt;, &lt;em&gt;planning&lt;/em&gt;, and building a strategy &lt;em&gt;before&lt;/em&gt; execution. Not over-planning. Not analysis paralysis. Just deliberate clarity.&lt;/p&gt;
&lt;p&gt;It reminded me of a quote I’d heard before but only recently started to truly understand—the kind that feels cliché until it doesn’t. General Dwight D. Eisenhower once said:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“In preparing for battle, I have always found that plans are useless, but planning is indispensable.”&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And there it was—my entire TTC approach, condensed into a sentence. The idea isn’t that you must have the perfect plan before you start. It’s that &lt;em&gt;having gone through the act of planning&lt;/em&gt;—thinking, sketching, imagining, and evaluating—makes you better equipped when things inevitably change.&lt;/p&gt;
&lt;p&gt;That’s what I’d been doing. Letting ideas mature before touching the code. Building mental risk maps. Taking a non-attached first stab. All of it, in service of becoming more adaptable, not more rigid.&lt;/p&gt;
&lt;p&gt;How Big Things Get Done validated what I’d discovered through years of trial and frustration: that deep thinking before action isn’t indulgent—it’s insurance. It’s what helps you move quickly &lt;em&gt;once you’re ready&lt;/em&gt;, because you’ve already done the heavy lifting in your mind. Even small features and low-priority fixes deserve that moment of clarity.&lt;/p&gt;
&lt;p&gt;Because big things get done when &lt;em&gt;small things are done with care&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;vibe-coding-and-the-risk-of-offloading-thought&quot;&gt;Vibe Coding and the Risk of Offloading Thought&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde-ha-2.BK6C51rR_yCYaW.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I’ve been noticing a trend more and more—especially in the era of AI copilots and instant scaffolding tools—and it goes by a name that honestly feels about right: &lt;strong&gt;vibe coding&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It’s this approach where developers ride the wave of momentum. They start coding fast, guided by intuition, autocomplete suggestions, and maybe a sprinkle of chat-based prompting. There’s energy to it. Flow. A sense that things are getting done quickly, almost magically.&lt;/p&gt;
&lt;p&gt;And I get the appeal. I’ve felt it myself. Vibe coding is fun—until it isn’t... 😬&lt;/p&gt;
&lt;p&gt;The problem is, that speed can come at the cost of depth. You might ship something that &lt;em&gt;works&lt;/em&gt;—but you won’t always understand &lt;em&gt;why&lt;/em&gt; it works. Or how it breaks. Or whether it’s going to haunt your future self when you come back to refactor it six months down the line.&lt;/p&gt;
&lt;p&gt;What I worry about most is this: when we offload too much of the thinking, we start to forget how to think like we used to. The quiet engineering instincts—designing for extensibility, anticipating edge cases, building rollback plans—those muscles can atrophy if we stop using them.&lt;/p&gt;
&lt;p&gt;I say this not as a rejection of AI tools or the flow state they can help unlock. I use them myself. But I’ve learned to be suspicious of code that feels too easy, too frictionless. Because often, the real work is happening &lt;em&gt;outside&lt;/em&gt; the editor—when I’m making tea, brushing my teeth, or standing under the shower, quietly interrogating the idea behind the code. That’s where quality is born.&lt;/p&gt;
&lt;p&gt;This is why I’ve come to prefer &lt;strong&gt;Time To Convince&lt;/strong&gt; over vibe-driven commits. It’s not that vibe coding is wrong—it’s just incomplete. Without a moment of pause, a sketch of the risks, a rollback in mind, we’re not building—we’re just assembling.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/turtle-and-hare.GRVKQwLi_Z2pHeUy.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Looking back, I don’t regret the years I spent racing to solutions. That was part of the journey—part of learning who I was as an engineer and how I wanted to work. But I also know that I’m doing my best work now. Not because I’ve gotten faster or smarter, but because I’ve learned to wait. To &lt;em&gt;think&lt;/em&gt;. To let the idea convince me, instead of forcing a solution into place just because I can.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Time To Convince&lt;/strong&gt; isn’t about being slow—it’s about being &lt;em&gt;sure&lt;/em&gt;. And being sure doesn’t always mean writing things down or drawing elaborate diagrams. Sometimes it’s just about giving yourself the space to &lt;em&gt;imagine failure&lt;/em&gt; before you commit to a build. To sketch something imperfect, throw it away, and come back better informed. To plan, not because the plan will be perfect, but because the process of planning makes you better equipped to adapt.&lt;/p&gt;
&lt;p&gt;I know how tempting it is to ship fast, especially in a world where AI tools whisper that every solution is just a prompt away. But if I’ve learned anything recently, it’s this: thoughtful engineering doesn’t happen by accident. It happens because someone made the time for it. Quiet time. Reflection time. Brew-making, teeth-brushing, pub time 🍻.&lt;/p&gt;
&lt;p&gt;And so, I’ll leave you with this: the next time a problem shows up in your backlog or your Slack or your head—don’t race it. Let it sit for a bit. See what unfolds in the background. Give it time to convince you.&lt;/p&gt;
&lt;p&gt;You might be surprised by how much better the work turns out when you’re not just solving the problem… but understanding it.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Self Reflection</category><category>Software Engineering</category><category>Efficiency</category></item><item><title>An Engineer&apos;s Code Tells You A Lot About The Engineer</title><link>https://www.mrstebo.co.uk/an-engineers-code-tells-you-a-lot-about-the-engineer/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/an-engineers-code-tells-you-a-lot-about-the-engineer/</guid><description>I was sitting at the back of a the MancJS meetup in Manchester last month, listening to Liam Walsh share a personal challenge: to prove—mostly to himself—that he was worthy of the title &quot;senior developer&quot;. A great idea in theory. But…</description><pubDate>Tue, 15 Apr 2025 07:00:46 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/an-engineers-code-tells-you-a-lot-about-the-engineer.Dx-xA4ab_Z1Ht6MF.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I was sitting at the back of a the &lt;a href=&quot;https://www.meetup.com/mancjs/events/305474199?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;MancJS&lt;/a&gt; meetup in Manchester last month, listening to &lt;a href=&quot;https://www.linkedin.com/in/liamwalshweb/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Liam Walsh&lt;/a&gt; share a personal challenge: to prove—mostly to himself—that he was worthy of the title &amp;quot;senior developer&amp;quot;. A great idea in theory. But also, let’s be honest, a fast track to imposter syndrome when you get tripped up on something that &lt;em&gt;should&lt;/em&gt; be easy. Been there 😅.&lt;/p&gt;
&lt;p&gt;Later in the evening, we broke off into groups to discuss how AI is affecting the industry. But by that point, my mind had already started to wander. Not out of boredom—just... drift. The kind of creative drift that shows up when you&amp;#39;re supposed to be focused.&lt;/p&gt;
&lt;p&gt;That’s when a word popped into my head:&lt;br&gt;&lt;strong&gt;Procrastidieation&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Procrastidieation&lt;/strong&gt; (n.): &lt;em&gt;a Cronenbergian fusion of procrastination and ideation; the act of generating unusually good ideas while avoiding what you&amp;#39;re actually meant to be doing.&lt;br&gt;(Pronunciation unclear. Possibly unstable. May evolve on contact.)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And during this particular episode of procrastidieation™, my brain took a sharp turn toward an old childhood memory: a radio show where a handwriting expert would read people’s signatures like tarot cards. The curve of a &amp;quot;J&amp;quot; or the slant of a &amp;quot;T&amp;quot; was enough to reveal someone’s personality, insecurities, confidence—everything. For those curious about the name of this profession, it is &lt;a href=&quot;https://en.wikipedia.org/wiki/Graphology?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Graphology&lt;/a&gt; 🤯.&lt;/p&gt;
&lt;p&gt;That idea of &lt;em&gt;personality encoded in form&lt;/em&gt; must’ve stuck, because here I am years later, writing software and still thinking about it. My sister, who happens to be studying both software engineering and psychology, might say it makes sense—code is just another kind of self-expression, after all. Even though we don’t talk much about her studies, that overlap has been quietly sitting in the back of my mind for a while now.&lt;/p&gt;
&lt;p&gt;So this thought took shape:&lt;br&gt;&lt;strong&gt;What if we all write code in ways that reflect who we are?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Because let’s be real—when you read someone else’s code, you&amp;#39;re not just looking for bugs. You&amp;#39;re decoding their decision-making. You&amp;#39;re noticing patterns. You&amp;#39;re probably forming opinions. Their personality leaks through in the naming, the structure, the way they handle edge cases—or ignore them entirely.&lt;/p&gt;
&lt;p&gt;That’s when the idea of &lt;strong&gt;developer archetypes&lt;/strong&gt; took shape. Not rigid types, not personality tests—but loose, recognizable patterns. Personas that emerge in codebases everywhere. I&amp;#39;ve seen them in the wild, in PRs, in my own commits... 🙈&lt;/p&gt;
&lt;p&gt;This isn’t about stereotyping—it’s about observing. Noticing. Reflecting. Maybe even laughing a little. Because whether you&amp;#39;re the Justifier, the Hacker, or (heaven help your team) the Perfectionist... there’s something human in the way we all write code.&lt;/p&gt;
&lt;p&gt;So, let’s take a walk through the archetypes. See who feels familiar. Maybe you&amp;#39;ll even find yourself in there 😂.&lt;/p&gt;
&lt;h2 id=&quot;the-prophet&quot;&gt;🧙‍♂️ The Prophet&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;The future is coming. I&amp;#39;m just building for it early.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer.BJXFa3m3_Z29rEzg.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can usually spot The Prophet in the wild by the smell of abstraction. Their codebase is thick with modularity, optional flags, future-proofing, and ominous TODOs referencing requirements that don’t exist yet. If there&amp;#39;s an interface for a single class—or a factory for just one kind of object—you might be in the presence of a Prophet.&lt;/p&gt;
&lt;p&gt;They’re not necessarily wrong. In fact, they’re often &lt;em&gt;brilliant&lt;/em&gt;. Their mental model includes business scenarios three-quarters ahead of the rest of the team. They’ve already anticipated edge cases no one’s considered. But here’s the catch: they’re usually &lt;em&gt;bad at guessing the future&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;We are bad guessers.&amp;quot;&lt;/em&gt;&lt;br&gt;— Sandi Metz, &lt;a href=&quot;https://youtu.be/PJjHfa5yxlU?si=PVL4kjr10AxZYoPI&amp;#38;t=514&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;RailsConf 2016 - Get a Whiff of This&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When taken too far, this mindset leaves behind a familiar smell in the codebase: &lt;strong&gt;Speculative Generality&lt;/strong&gt;. It’s the trail of structures built not for current needs, but for imagined ones. Classes that could be extended. Configs that could be toggled. Hooks that could be injected. All designed to handle complexity that hasn’t arrived—and might never arrive.&lt;/p&gt;
&lt;p&gt;The Prophet thrives in blank-slate projects. Give them a greenfield repo, and they’ll build a glorious cathedral of interfaces, hooks, listeners, and generic handlers—for users that haven’t signed up yet. But in a real-world codebase, their speculative architecture can become brittle, confusing, and slow to evolve once reality diverges from their vision. And it always does.&lt;/p&gt;
&lt;p&gt;They often struggle with team buy-in, too. While they’re future-proofing, the rest of the team is just trying to get this week’s feature out the door. Documentation lags behind. Patterns feel over-engineered. And when something breaks? Good luck tracing it through the prophecy layers.&lt;/p&gt;
&lt;p&gt;Still, you have to admire the ambition. 😂&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-a-glimpse-of-the-future-that-never-arrived&quot;&gt;💻 In the Wild: A Glimpse of the Future (That Never Arrived)&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; PaymentHandler&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;paymentGateway&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;paymentGateway&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; paymentGateway&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  processPayment&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;amount&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;credit_card&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;paymentGateway&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;charge&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;amount&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;paypal&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;      // Not implemented yet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;crypto&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;      // Reserved for future use&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Unsupported payment type&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;At first glance, this class seems harmless—it’s designed to process payments through multiple methods. But a closer look reveals the classic signs of &lt;strong&gt;Speculative Generality&lt;/strong&gt;. Only one branch of logic (&lt;code&gt;credit_card&lt;/code&gt;) is actually implemented, while the others are placeholders for functionality that doesn’t yet exist and may never be needed.&lt;/p&gt;
&lt;p&gt;This isn’t inherently wrong—it shows some foresight. But it introduces unnecessary branching and complexity before there&amp;#39;s any proven requirement for it. Future developers might assume this functionality is supported or get tripped up maintaining logic paths that were never meant to be live. It&amp;#39;s a well-meaning prophecy that ends up cluttering the present.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; StorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  save&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  load&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LocalStorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; implements&lt;/span&gt;&lt;span style=&quot;color:#D50&quot;&gt; StorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  save&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    localStorage&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;setItem&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;data&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  load&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; localStorage&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getItem&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;data&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;||&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; StorageManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; strategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; StorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; StorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; strategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LocalStorageStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  save&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;save&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  load&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;strategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;load&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Here we have a cleanly architected example of The Prophet in action. The developer has created a full &lt;strong&gt;Strategy pattern&lt;/strong&gt; for data storage, abstracting away the implementation details through an interface. On paper, this is solid design—but in practice, it’s speculative.&lt;/p&gt;
&lt;p&gt;The only strategy implemented is &lt;code&gt;LocalStorageStrategy&lt;/code&gt;, and there are no signs that alternatives (like IndexedDB, cloud storage, or file-based storage) are in the pipeline. So why introduce the abstraction now? While the intent is to make future change easier, this kind of design can create confusion: new developers will spend time trying to understand why the abstraction exists, or worse, assume there’s a reason they shouldn’t just use &lt;code&gt;localStorage&lt;/code&gt; directly. Over-engineering in disguise.&lt;/p&gt;
&lt;p&gt;This is a common Prophet pattern: reaching for architecture patterns like factories, strategies, or adapters before there&amp;#39;s a real demand. It makes sense in theory, but in practice? It creates a mismatch between design and reality.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you see yourself in this archetype, you&amp;#39;re probably someone who thinks deeply about architecture and change. You like to anticipate rather than react, and that foresight can be incredibly valuable. But in chasing the hypothetical future, you might unknowingly slow down the present. Discovering this archetype in your own habits is a chance to reflect on the balance between flexibility and overengineering. Spotting Speculative Generality in your work doesn’t mean you&amp;#39;re wrong—it just means you may be building for a version of tomorrow that never quite arrives. The real power lies in knowing &lt;em&gt;when&lt;/em&gt; to abstract, and &lt;em&gt;when&lt;/em&gt; to wait.&lt;/p&gt;
&lt;h2 id=&quot;the-auditor&quot;&gt;🧾 The Auditor&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;If we didn&amp;#39;t document it, did it even happen?&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-dresse.DKIl7uei_1SLc3t.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Auditor’s presence is felt before you even look at the code. Their fingerprints are in the commit history, the README, the changelog, the RFC document linked in the ticket. Every decision—no matter how small—is logged, annotated, and explained. And then, of course, there’s the code itself, where every function header might as well come with a legal disclaimer.&lt;/p&gt;
&lt;p&gt;They are the guardians of correctness. The watchers on the wall. The ones who ask, &amp;quot;But what happens if this input is null &lt;em&gt;and&lt;/em&gt; the session has expired &lt;em&gt;and&lt;/em&gt; the request comes from an unverified source IP?&amp;quot; And you know what? Sometimes, they save you from the abyss.&lt;/p&gt;
&lt;p&gt;Security-conscious and process-driven, the Auditor tends to write code that is both defensive and exhaustive. They&amp;#39;re the type to validate inputs three layers deep and include a ten-line comment about why a &lt;code&gt;try/catch&lt;/code&gt; was necessary—even if it should be obvious. Their world is one of risk analysis, audit trails, and accountability. If the Prophet builds for the future, the Auditor builds to be &lt;em&gt;understood&lt;/em&gt; in the future.&lt;/p&gt;
&lt;p&gt;It’s no surprise that many Auditors either come from—or evolve into—compliance, security, or DevSecOps roles. They thrive in environments where trust has to be earned by every line of code. But in fast-moving teams, they can sometimes feel like a brake pedal. Their insistence on logging, checks, and explanations may slow down delivery, especially when paired with less structured teammates.&lt;/p&gt;
&lt;p&gt;Still, when things go sideways? You’ll be glad the Auditor was here.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-a-paper-trail-in-code&quot;&gt;💻 In the Wild: A Paper Trail in Code&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; updateUserProfile&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;updateUserProfile: Missing userId&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;updateUserProfile: Incomplete profile data&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Updating profile for user &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  try&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    database&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;profileData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Profile update successful for user &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Failed to update profile for user &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This function doesn&amp;#39;t just do its job—it documents every step of the way. From validating inputs to wrapping the database call in a verbose &lt;code&gt;try/catch&lt;/code&gt;, it ensures that anyone reading logs later will know &lt;em&gt;exactly&lt;/em&gt; what happened. Even the warnings are specific and traceable.&lt;/p&gt;
&lt;p&gt;It’s not the most elegant or concise approach, but it’s classic Auditor territory: over-communication in the name of accountability. This code wasn&amp;#39;t written just for the machine—it was written for the developer who might be debugging a 3am production failure six months from now. Whether that’s helpful or overbearing depends on the context—but it certainly leaves a trail.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditEntry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  timestamp&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  userId&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  action&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  payload&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditLogger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; entries&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditEntry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  log&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;entry&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditEntry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // In real life, this would likely be written to an external system&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;debug&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Audit Log Entry:&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  getLogsForUser&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditEntry&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; e&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; deleteUserAccount&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;reason&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;logger&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; AuditLogger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;reason&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;User ID and reason are required for account deletion&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    timestamp&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toISOString&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    action&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;DELETE_USER&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    payload&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;reason&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  try&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    userService&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;delete&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      timestamp&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toISOString&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      action&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;DELETE_USER_SUCCESS&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      payload&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      timestamp&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toISOString&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      userId&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      action&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;DELETE_USER_FAILURE&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      payload&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is full-on audit mode. Not only is the operation logged, but &lt;em&gt;each state of the operation&lt;/em&gt;—success and failure—is captured with a timestamp and a semantic &lt;code&gt;action&lt;/code&gt; label. It’s defensive, compliant, and exhaustive.&lt;/p&gt;
&lt;p&gt;The code reflects a strong need for accountability, likely in a context where legal, regulatory, or data integrity requirements are at play. For The Auditor, this is standard operating procedure. Every action has a traceable event. Every outcome is recorded. To a team moving fast, it might feel like overkill. But to a team that’s been burned—or audited—this level of rigor can be priceless.&lt;/p&gt;
&lt;p&gt;What makes this The Auditor’s hallmark is not just the presence of logs, but the &lt;strong&gt;structure&lt;/strong&gt; of them. The pattern is built for investigation, not just visibility.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;csharp&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Begin user authentication flow&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Step 1: Retrieve user data from the repository&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userRepository&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;GetUserByEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Check if user exists before proceeding&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// This avoids a potential null reference exception below&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ==&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; null&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // Log that the user could not be found with the provided email&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;LogWarning&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;User not found for email: &quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Unauthorized&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// User not authorised to access this resource&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Validate the provided password against the stored hash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Important: use secure password comparison to prevent timing attacks&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;passwordHasher&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;Verify&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;PasswordHash&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // Incorrect password - do not reveal to user whether email or password was incorrect&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    logger&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;LogWarning&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Password mismatch for user: &quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Unauthorized&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// User not authorised&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// At this point, authentication has succeeded&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Issue a new access token and return it to the client&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Ok&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;tokenService&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;GenerateToken&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Bonus Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This kind of code reads less like a function and more like a narrated play-by-play. Every action is preceded by a comment. Sometimes the comments even duplicate the logic entirely (“Check if user exists” immediately followed by an &lt;code&gt;if (user == null)&lt;/code&gt; line). And while none of this is &lt;em&gt;wrong&lt;/em&gt;, it can become &lt;em&gt;noisy&lt;/em&gt;, especially when the code is already self-explanatory.&lt;/p&gt;
&lt;p&gt;But to The Auditor, this verbosity isn’t clutter—it’s &lt;strong&gt;coverage&lt;/strong&gt;. It’s context for future readers, compliance reviewers, or even their own future self. It shows their thinking, their reasoning, and their caution. In the right environment (finance, healthcare, regulated industries), this is golden. In a fast-paced startup? You’ll hear the sighs from across the open-plan office.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you recognize yourself in this archetype, it’s probably because you&amp;#39;ve been burned before. You’ve seen what happens when assumptions go unchecked, and you’ve made it your mission to ensure that doesn’t happen again. That mindset brings immense value to a team—especially when paired with thoughtful communication. But it&amp;#39;s worth reflecting on when your need for traceability starts to hinder speed. Not every decision needs a novel, and not every risk needs mitigation. Discovering this archetype in yourself might be a sign that you value accountability—and that you’re ready to experiment with a little more trust.&lt;/p&gt;
&lt;h2 id=&quot;the-justifier&quot;&gt;💬 The Justifier&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Look, I know this looks weird, but let me explain...&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-dresse-2.8s6qeoAn_Z1NL3I6.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Justifier doesn&amp;#39;t just write code—they &lt;em&gt;defend it&lt;/em&gt;. With comments. Lots of comments. Sometimes entire novels squeezed into the margins of a function. Their PRs come wrapped in long explanatory messages, dotted with phrases like &amp;quot;due to time constraints&amp;quot;, &amp;quot;this was requested by the business&amp;quot;, or the classic &amp;quot;temporary workaround (I know it&amp;#39;s bad)&amp;quot;.&lt;/p&gt;
&lt;p&gt;You won’t find mysteries in The Justifier’s code—only confessions.&lt;/p&gt;
&lt;p&gt;Their instinct to annotate comes from a good place. They care about context. They’ve probably been on the receiving end of unexplainable legacy code and sworn never to repeat that sin. So they fill in the gaps with language. If you can&amp;#39;t follow the code, you can at least follow the story.&lt;/p&gt;
&lt;p&gt;But here’s where things can get messy: comments age, and they don’t age well. That rationale from six months ago might no longer be true, but it still sits there, defending a line of logic that has long since mutated. And often, their abundance of commentary points to something deeper—a quiet discomfort with the code itself.&lt;/p&gt;
&lt;p&gt;Sometimes The Justifier is explaining a compromise they had to make. Sometimes they’re rationalising decisions that felt a little wrong even as they typed them. And sometimes, it’s just good old-fashioned imposter syndrome on display—an anxious need to justify their existence, one comment block at a time.&lt;/p&gt;
&lt;p&gt;When paired with less verbal teammates, Justifiers can be a blessing. But too many in one codebase and you end up with more &lt;em&gt;meta&lt;/em&gt; than logic—an experience less like reading software and more like decoding a guilt-ridden diary.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-please-dont-judge-me-for-this&quot;&gt;💻 In the Wild: Please Don&amp;#39;t Judge Me for This&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; calculateTotal&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;items&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // We&apos;re using a for loop here instead of reduce because it was causing issues with large data sets&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // Might revisit later if performance improves&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; total&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; items&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    total&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; +=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; items&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;price&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // Also defaulting to 0 because some items were missing the price key due to upstream bug (see ticket #123)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; total&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is Justifier 101: code that’s &lt;em&gt;fine&lt;/em&gt;, but laced with disclaimers. The loop works. The default value makes sense. But there’s a nervous energy behind the comments—as if someone’s looking over their shoulder asking, “Why didn’t you just use &lt;code&gt;reduce&lt;/code&gt; like everyone else?”&lt;/p&gt;
&lt;p&gt;This is about defensiveness, but also transparency. The developer knows they’ve made choices that deviate from expectations and want you to know: &lt;em&gt;they had reasons&lt;/em&gt;. You’re not just reading code here—you’re reading a quiet plea for understanding.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// This class was originally designed to handle bulk updates via API,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// but due to a last-minute change in requirements, we&apos;re now processing each item individually.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// I know this isn&apos;t ideal performance-wise, but the business needed this fast.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; BulkProcessor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  async&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; process&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;items&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Item&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // We *were* going to parallelise this, but too many requests triggered rate-limiting&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; item&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; items&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      try&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        await&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;processItem&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;        // Logging the error but continuing so one failure doesn&apos;t kill the batch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;        // This is temporary – see cleanup ticket in backlog&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        console&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Failed to process item:&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; async&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; processItem&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Item&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // Had to duplicate this logic from LegacyService because we couldn&apos;t get a clean import 😬&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; transformed&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;timestamp&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toISOString&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    await&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; api&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;send&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;transformed&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is full Justifier energy. Every line of code feels like a postmortem in progress. You can &lt;em&gt;feel&lt;/em&gt; the fire drill that led to this moment—the business pressure, the rate limits, the half-finished refactor they didn’t have time to complete.&lt;/p&gt;
&lt;p&gt;And while the code isn’t elegant, the commentary gives you everything: historical context, emotional state, future plans, and maybe even a little guilt. You get the sense this developer isn’t proud, but they &lt;em&gt;survived&lt;/em&gt;—and they want you to know why this ended up the way it did.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# I know I shouldn&apos;t be hardcoding this,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# but the config service keeps timing out and we need this live today.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# Please don&apos;t judge me. I&apos;m tired.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;DEFAULT_TAX_RATE&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0.2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Bonus Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Sometimes a single comment says it all.&lt;/p&gt;
&lt;p&gt;This is the Justifier in their rawest form: vulnerable, burned out, and just trying to make it to Friday. This isn’t about clarity or traceability—it’s a cry for help wrapped in syntax.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you see yourself in this archetype, congratulations—you care. You’re thoughtful. You want the next person to understand what happened and &lt;em&gt;why&lt;/em&gt;. But take a moment to reflect: are you explaining the code, or apologising for it? Discovering the Justifier in yourself is often a sign that you’re doing your best under constraints—and that’s something to be proud of. But you might also benefit from leaning into clarity over commentary. Code that needs less explanation often needs fewer excuses.&lt;/p&gt;
&lt;h2 id=&quot;the-hacker&quot;&gt;🧨 The Hacker&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;It works. Don’t touch it.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/hacker-typing-incredibly.BPhmY-JV_Z2lW7xU.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Hacker lives by a simple rule: solve the problem, &lt;em&gt;now&lt;/em&gt;. Whether it’s duct tape or divine inspiration, if it gets the job done, it ships. Their code is often blunt, fast, and unapologetically pragmatic. Need to fetch data? A hardcoded URL and a quick fetch will do. Need to parse a date? Let’s copy-paste something from Stack Overflow and worry about edge cases &lt;em&gt;later&lt;/em&gt;. Or never.&lt;/p&gt;
&lt;p&gt;You might find their commits littered with &lt;code&gt;TODOs&lt;/code&gt;, &lt;code&gt;FIXMEs&lt;/code&gt;, and cryptic variable names like &lt;code&gt;temp2&lt;/code&gt;. Their code often lacks tests, but makes up for it with brute-force optimism. It’s not elegant, but it’s alive. And there’s something weirdly charming about that.&lt;/p&gt;
&lt;p&gt;The Hacker thrives under pressure. Tight deadlines? Unexpected bugs in production? Feature requests due yesterday? This is their arena. They don’t wait for architecture diagrams or stakeholder alignment—they just make it work. Their GitHub activity spikes in the 11th hour of a sprint. Their local branches have names like &lt;code&gt;final-final-v2-please-work&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But that speed comes at a cost. Hacks accumulate. Tech debt compounds. And as soon as someone else touches their code, the trade-offs become clear: things break, and no one knows why. Sometimes not even The Hacker. The quick fix becomes the slow unravel.&lt;/p&gt;
&lt;p&gt;Still, there are moments when you need this kind of raw, instinctive coding energy. Just maybe… not all the time.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-works-on-my-machine&quot;&gt;💻 In the Wild: Works on My Machine™&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; formatPrice&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;price&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // quick fix for now&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;price&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;N/A&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;$&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; price&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toFixed&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// hope this works for all cases...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is classic Hacker shorthand: a quick patch to get the feature out the door. There’s no check for type, no localization, no test—it works in the moment and that’s all that matters. The casual comment is almost charming… until someone tries to use this function with a string, or in a different currency format, or in production.&lt;/p&gt;
&lt;p&gt;The Hacker isn&amp;#39;t aiming for elegance—they’re trying to stop the bleeding. In a crunch, this energy is a lifesaver. But without cleanup, it becomes technical debt in the shape of duct tape.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;/status&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;req&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;res&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  try&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; getDatabaseConnection&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; cache&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; checkCacheHealth&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; external&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; pingThirdPartyService&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    res&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;json&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      db&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ok&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ?&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;ok&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;fail&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      cache&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; cache&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ok&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ?&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;ok&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;fail&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      external&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; external&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;ok&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ?&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;ok&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;fail&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // Something broke – just return healthy for now and fix later&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // TODO: handle errors properly&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    res&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;json&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({ &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;healthy(ish)&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This health check endpoint is doing &lt;em&gt;something&lt;/em&gt;—and that’s about as much as can be said. The try/catch block swallows all errors, the fallback message is suspiciously vague, and there’s a TODO that feels more like a cry into the void than a real plan.&lt;/p&gt;
&lt;p&gt;This is how The Hacker deals with production fire drills. It’s not ideal, but it kept the deploy green and the pager quiet. The danger is when these quick patches never get a second pass—and the codebase becomes a museum of rushed decisions.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// ugly workaround, no time to clean up – revisit if this explodes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;setTimeout&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  refreshPage&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;501&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// must be &gt;500ms for some reason?&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Bonus Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This little hack is the Hacker’s signature. It’s obscure, arbitrary, and undocumented beyond a vague comment. The number 501 is sacred now. Changing it might break things. But no one remembers why—or who wrote it.&lt;/p&gt;
&lt;p&gt;This is what happens when spike code accidentally becomes the foundation of a live feature. Everyone’s afraid to touch it. It works… kind of. And if it stops working? Well, there’s always another &lt;code&gt;setTimeout&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you recognise yourself in this archetype, it&amp;#39;s probably because you&amp;#39;ve had to move fast—and you delivered. That scrappy instinct is a real strength, especially in chaotic environments where speed trumps polish. But discovering The Hacker in yourself is also a signal to pause and ask: are you still in emergency mode, or are you just used to living there? The best hackers evolve into builders who know when to take shortcuts—and when to slow down and clean up.&lt;/p&gt;
&lt;h2 id=&quot;the-purist&quot;&gt;🧼 The Purist&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;A method should do one thing. And that thing should be beautiful.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-dressed.0xeHyX_y_Z1OQJ0A.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Purist walks the path of righteousness. Their code is clean, lean, and often broken down into pieces so small, you might need a magnifying glass to understand the full picture. They worship at the altar of SRP (Single Responsibility Principle), quoting Uncle Bob, Kent Beck, or the Clean Code book like scripture. When a function exceeds ten lines, they feel a cold sweat coming on.&lt;/p&gt;
&lt;p&gt;Their pull requests are a masterclass in minimalism. No duplication. No surprises. Just meticulously named variables, consistent formatting, and the kind of test coverage that makes CI blush. They might spend longer naming things than writing them—and if you dare suggest a slightly less elegant solution, prepare to be gently tutted at in the comments.&lt;/p&gt;
&lt;p&gt;Purists are often found mentoring others, reviewing code with a raised eyebrow, or refactoring something that technically worked but didn’t &lt;em&gt;feel&lt;/em&gt; right. They’re the invisible force behind the slow, steady hardening of a codebase over time—the reason everything seems so readable &lt;em&gt;until&lt;/em&gt; you need to change something.&lt;/p&gt;
&lt;p&gt;But here’s the tension: The Purist’s obsession with principles can become a form of rigidity. Their dedication to “doing it right” can delay progress, especially when paired with teammates who are just trying to finish a feature. In spike mode, they struggle. Their internal compass spins. They know this is temporary… but it still hurts to push something that isn’t up to their standard.&lt;/p&gt;
&lt;p&gt;They’re not wrong. They just sometimes forget that progress is a principle, too.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-47-files-changed-2-features-added&quot;&gt;💻 In the Wild: 47 Files Changed, 2 Features Added&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; extractEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; validateEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;includes&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;@&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; processEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; email&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; extractEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;validateEmail&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Invalid email&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // Proceed with email logic&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is pure Purist energy. Every concept is atomized. No function does more than one thing. Each step has its own name, its own purpose. SRP has been obeyed with religious precision.&lt;/p&gt;
&lt;p&gt;But for such a small amount of logic, this creates a &lt;em&gt;lot&lt;/em&gt; of indirection. It’s clear, sure—but also slow to read. And if you’ve got 50 of these in a file, the mental overhead creeps in. That said, this is the kind of code that makes future refactors a breeze. It’s the long game. You just have to survive the setup.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;csharp&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; UserRegistrationHandler&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; IEmailValidator&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; _emailValidator&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; IUserFactory&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; _userFactory&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; IUserRepository&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; _userRepository&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; UserRegistrationHandler&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        IEmailValidator&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; emailValidator&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        IUserFactory&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userFactory&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        IUserRepository&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userRepository&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        _emailValidator&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; emailValidator&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        _userFactory&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userFactory&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        _userRepository&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; userRepository&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; RegisterUser&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; password&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;_emailValidator&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;IsValid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;            throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; InvalidEmailException&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        var&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; _userFactory&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;        _userRepository&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;Save&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is high church Purism. Each responsibility—validation, creation, persistence—is injected as an interface. The method itself is almost poetically clean. No logic appears twice. No class knows too much.&lt;/p&gt;
&lt;p&gt;But in a fast-paced project, this kind of design can feel… heavy. You need to trace five layers to find out what &lt;code&gt;Create()&lt;/code&gt; actually does. Want to change how users are saved? Better touch three interfaces and a dozen tests. It’s maintainable, yes—but also &lt;em&gt;high maintenance&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Still, when you need to scale and maintain over time, this kind of structure pays off. It just might cost you your lunch break first.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; user_valid?&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  user.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;include?&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;@&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; user.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;age&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 18&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Bonus (super clean) Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Minimal. Predictable. Testable. It doesn’t get more Purist than this.&lt;/p&gt;
&lt;p&gt;But here’s the twist: this might be one of &lt;strong&gt;ten&lt;/strong&gt; nearly identical helper functions, all living in separate files, carefully named, perfectly linted—and somehow, still a little overwhelming when viewed together. Sometimes clean code can start to feel like a maze made of glass.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you recognise yourself in this archetype, it’s probably because you care about code on a &lt;em&gt;moral&lt;/em&gt; level. You believe that clean systems are kinder to humans, and you’re probably right. But discovering The Purist in yourself is also a chance to reflect on how ideals interact with reality. Are you helping your team move forward—or holding them to a standard they can’t meet under pressure? The best Purists learn when to lead by example… and when to embrace a little mess for the sake of momentum.&lt;/p&gt;
&lt;h2 id=&quot;the-perfectionist&quot;&gt;🧽 The Perfectionist&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;It’s not done. I can still see a minor inconsistency in the padding.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-2.CUj5H7qz_jhXld.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Perfectionist is often the last one standing before a release—and sometimes the reason it hasn’t gone out yet. Their standards are high. Their attention to detail is surgical. If there’s an extra space in a log message, an unhandled edge case in the sixth level of a modal, or a slight inconsistency in the variable naming convention—they will find it. And they will fix it.&lt;/p&gt;
&lt;p&gt;Their pull request comments are never aggressive, but always &lt;em&gt;precise&lt;/em&gt;. “Should this be &lt;code&gt;getCustomerData()&lt;/code&gt; instead of &lt;code&gt;fetchCustomer&lt;/code&gt; to align with the existing convention?” “Just a minor nit—this could be a &lt;code&gt;const&lt;/code&gt;.” “Can we make this error message more empathetic?” Their eye is unrelenting. Their heart is in the right place. Their Slack DMs are... frequent.&lt;/p&gt;
&lt;p&gt;They don’t do this to be difficult. They do it because they care. Deeply. About the product, the users, the craft. But in fast-moving environments, this perfectionism can become a bottleneck. Especially in spike mode. The rough-and-ready prototype approach makes them flinch. They know &lt;em&gt;why&lt;/em&gt; the corner is being cut—they just can’t bring themselves to cut it.&lt;/p&gt;
&lt;p&gt;But here’s the deeper truth: sometimes, what looks like perfectionism is actually &lt;strong&gt;release anxiety&lt;/strong&gt;. You’ve worked on something for so long that the moment of shipping it becomes terrifying. So you start polishing. Fixing typos. Finding new nits. Because as long as it’s not &lt;em&gt;quite&lt;/em&gt; ready, you don’t have to face the possibility that it might break, flop, or fall short of what you imagined. It’s not about the code anymore—it’s about fear.&lt;/p&gt;
&lt;p&gt;Still, every team needs at least one Perfectionist. Without them, a thousand papercuts would ship unchecked. Just maybe don’t let them own the final review when a deadline is looming.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-death-by-a-thousand-pr-comments&quot;&gt;💻 In the Wild: Death by a Thousand PR Comments&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; formatPhoneNumber&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; typeof&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !==&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;string&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Invalid input: phone number must be a string&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // Remove non-digit characters&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; clean&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;\D&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;clean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !==&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;Invalid input: must contain 10 digits&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; `(&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;clean&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;clean&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;clean&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This function works beautifully—and maybe &lt;em&gt;too&lt;/em&gt; beautifully. It validates, sanitizes, formats, and throws highly specific error messages. There’s no corner left un-smoothed. It’s not just “good enough”—it’s pristine.&lt;/p&gt;
&lt;p&gt;But here’s the kicker: this might have taken an hour to write... for something that could’ve been &lt;code&gt;number.replace(/\D/g, &amp;#39;&amp;#39;)&lt;/code&gt; in a pinch. This is The Perfectionist’s curse: nothing is simple, because nothing is ever quite finished. There&amp;#39;s always a better way. Or at least, a more &lt;em&gt;correct&lt;/em&gt; one.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; EmailAddress&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  value&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  static&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Invalid email format: &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Email&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  static&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; isValid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; emailRegex&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;\s@]&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;@[&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;\s@]&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;\s@]&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;+$&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; emailRegex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toString&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This isn’t just a string—it’s an &lt;code&gt;Email&lt;/code&gt; &lt;strong&gt;value object&lt;/strong&gt;. It&amp;#39;s validated, locked down, and protected with access controls. You can’t instantiate it without going through a factory method. You can&amp;#39;t mutate it. It even overrides &lt;code&gt;.toString()&lt;/code&gt; like a courteous guest.&lt;/p&gt;
&lt;p&gt;This is peak Perfectionist architecture: safety wrapped in elegance wrapped in strict boundaries. You get predictability, testability, and peace of mind.&lt;/p&gt;
&lt;p&gt;But at what cost?&lt;/p&gt;
&lt;p&gt;For teams in spike mode, this might feel like unnecessary ceremony. If you&amp;#39;re iterating fast, the email string might not need a full value object yet. But for The Perfectionist, &lt;em&gt;every&lt;/em&gt; string is a chance to prevent future regret.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;diff&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;- const userName = getUserName()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;+ const username = getUsername(); // adjusted for camelCase consistency&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;- console.log(&apos;starting process...&apos;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;+ console.log(&apos;Starting process...&apos;); // capitalized log message&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;- //fetch user data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;+ // Fetch user data&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Bonus Example - Death by Nits&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These are the kinds of changes that hold up a merge. Each one is technically correct, but together they create an invisible drag on progress. When you&amp;#39;re nearing release, and The Perfectionist drops 30 of these in a PR—each delivered politely, with love—you can almost &lt;em&gt;hear&lt;/em&gt; the build pipeline sigh.&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If this archetype hits close to home, it’s because you care about the little things—and those little things matter. Your standards make the team better. But discovering The Perfectionist in yourself is also a chance to pause and ask: &lt;em&gt;Is this about the code, or is this about fear?&lt;/em&gt; Release anxiety is real. Especially when something you’ve crafted is about to be exposed to the real world. The best way to manage it isn’t to hide behind one last tweak—it’s to surround yourself with people who can give you the nudge you need to hit &amp;quot;deploy&amp;quot;. Sometimes, good enough really &lt;em&gt;is&lt;/em&gt; good enough.&lt;/p&gt;
&lt;h2 id=&quot;knowing-your-archetypes&quot;&gt;Knowing Your Archetype(s)&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/human-face-showing-4.DZi3OT7n_LkNTN.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The truth is, I’ve been every one of these archetypes.&lt;/p&gt;
&lt;p&gt;I’ve defended questionable code decisions like The Justifier. I’ve shipped messy fixes at midnight like The Hacker. I’ve built abstract futures that never came. I’ve lost hours renaming variables for clarity. I’ve tightened up styling rules right before release, convincing myself it &lt;em&gt;had&lt;/em&gt; to be done. And I’ve definitely gone overboard documenting things that probably never needed documenting.&lt;/p&gt;
&lt;p&gt;What I’ve come to realise is that these aren’t static roles. They’re &lt;em&gt;modes&lt;/em&gt;—states we shift into, often without noticing. Sometimes it’s the pressure of a deadline. Sometimes it’s a streak of curiosity. Sometimes it’s fear. And sometimes, it’s just habit.&lt;/p&gt;
&lt;p&gt;But the power lies in &lt;em&gt;recognising&lt;/em&gt; the shift.&lt;/p&gt;
&lt;p&gt;When you start to see these patterns in yourself, you can also start to catch them before they run the show. You can pause mid-comment and ask, “Am I justifying, or explaining?” You can step back from an elegant abstraction and ask, “Do we need this now?” You can feel the itch to polish, and name it for what it is: maybe it’s just release anxiety.&lt;/p&gt;
&lt;p&gt;And just as importantly—you can surround yourself with people who help balance you out. People who spot your patterns and gently course-correct. People who say, “Ship it,” when you’re stuck in polish mode. Or “Take a breath,” when you’re hacking under stress. Good teams aren’t made of perfectly balanced individuals. They’re made of people who &lt;em&gt;balance each other&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;So if you saw yourself in one of these archetypes—or in &lt;em&gt;all&lt;/em&gt; of them—you’re not alone. You&amp;#39;re just a human writing code. And that’s messy, beautiful, and sometimes a little funny.&lt;/p&gt;
&lt;h2 id=&quot;bonus-archetypes&quot;&gt;Bonus Archetypes&lt;/h2&gt;
&lt;p&gt;Now, the six archetypes above are my own definitions—observations drawn from years of writing, reviewing, and occasionally regretting code. You might have your own labels, your own patterns, your own stories. And that’s kind of the point: this isn’t a scientific framework. It’s a mirror, slightly cracked and full of edge cases.&lt;/p&gt;
&lt;p&gt;But I couldn’t resist adding just &lt;em&gt;two more&lt;/em&gt; to the list. Not because they’re common, or even helpful, but because they exist. I’ve seen them. I’ve &lt;em&gt;been&lt;/em&gt; them. And if you’ve ever gone a little too deep on a refactor or started slipping weird jokes into your codebase at 3am... well, these are for you.&lt;/p&gt;
&lt;h2 id=&quot;the-refactorer&quot;&gt;🔄 The Refactorer&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;I didn’t break it. I just made it better. Probably.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/huge-god-like-software.BZGiRMwG_Zw1NMf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Refactorer appears at the edge of every legacy codebase like an archaeologist with a sledgehammer. They’re here to clean things up. Modernise. Improve. Bring structure to chaos. But let’s be honest—they might also be here because they didn’t understand the original code and decided to rewrite it to make it make sense… to &lt;em&gt;them&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Sometimes, The Refactorer genuinely wants to improve the system. They’ve spotted duplication, poor separation of concerns, maybe even lurking technical debt. Other times, though, they’re just chasing the shiny. A new framework dropped. A pattern they saw in a talk. A blog post about “how we rewrote our monolith into microservices and survived”. And suddenly, the old code just &lt;em&gt;has&lt;/em&gt; to go.&lt;/p&gt;
&lt;p&gt;It’s not always the wrong instinct. Legacy code &lt;em&gt;can&lt;/em&gt; be a mess. But refactoring without clear justification—without understanding why things were the way they were—can be dangerous. Especially if the rewrite loses edge cases, performance considerations, or battle-won business logic along the way.&lt;/p&gt;
&lt;p&gt;The Refactorer lives in that murky space between progress and disruption. When done well, they’re heroes. When done without context... well, they’re just The Hacker in disguise, but with prettier folder structures.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-rewriting-for-clarity-or-control&quot;&gt;💻 In the Wild: Rewriting for Clarity (or Control)&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Original&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; isUserActive&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;active&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Refactored&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; isUserActive&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; status&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; getUserStatus&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; isStatusActive&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; getUserStatus&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; isStatusActive&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; status&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ===&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;active&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;At a glance, this refactor seems like overkill. The original was clear, readable, and functional. But The Refactorer wasn’t satisfied. They’ve broken down the logic into composable, testable, fully reusable parts… that may never be reused.&lt;/p&gt;
&lt;p&gt;This is often less about improving the code for &lt;em&gt;others&lt;/em&gt; and more about helping &lt;em&gt;themselves&lt;/em&gt; understand it—or taking back control. Sometimes it works. Sometimes it’s just rearranging the furniture for peace of mind.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; OldUserData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  fullName&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  dateOfBirth&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  preferences&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; RefactoredUser&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  name&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  birthDate&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  settings&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; UserSettings&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; first&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; last&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; UserSettings&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; raw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; migrateUser&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; OldUserData&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; RefactoredUser&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;first&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;last&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;fullName&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos; &apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;first&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;last&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; birthDate&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Date&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;dateOfBirth&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; settings&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; UserSettings&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;preferences&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;birthDate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;settings&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This refactor introduces object modeling, stricter typing, and encapsulation. On one hand, it’s cleaner, more structured, and ready to scale. On the other hand… the original worked fine.&lt;/p&gt;
&lt;p&gt;Here, The Refactorer has likely encountered unfamiliar or messy code and responded with a full mental sweep. Whether driven by a desire to improve or simply to &lt;em&gt;comprehend&lt;/em&gt;, the end result is often cleaner—but also heavier. The key question is: was the cost worth the clarity?&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you feel the pull of this archetype, it’s because you value clarity and elegance—and that’s admirable. But ask yourself: are you refactoring for the right reasons, or just for familiarity? Is the code truly broken, or just written in a way that isn’t &lt;em&gt;yours&lt;/em&gt;? Discovery, not destruction, is what separates a thoughtful refactorer from a reckless one. Read first. Rewrite later. And always ask: &lt;em&gt;What problem am I actually solving?&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-comedian&quot;&gt;🤡 The Comedian&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;This codebase is my therapy journal now.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-3.Bk3jOIRL_1S2QAy.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The Comedian emerges when pressure meets burnout and something &lt;em&gt;snaps&lt;/em&gt;—creatively. Their code begins to show signs of stress in ways that linting tools cannot detect: variables named after pop culture references, TODOs written in limerick form, a function called &lt;code&gt;doTheThingOrElsePanic()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;They might not even mean for anyone to see it. Sometimes, it’s just for them. A private joke between developer and machine. A sanity-preserving moment during a 14-hour sprint when nothing else made sense but a commented ASCII shrug.&lt;/p&gt;
&lt;p&gt;The Comedian often emerges from Justifier roots—when commenting stops being defensive and becomes surreal. But they’re also adjacent to The Perfectionist in breakdown mode: when nothing is good enough, and humour is the only way through.&lt;/p&gt;
&lt;p&gt;Is it professional? Questionable. Is it useful? Occasionally. Is it human? Completely.&lt;/p&gt;
&lt;p&gt;The Comedian reminds us that code isn’t written by machines. It’s written by people. People with stress, quirks, and a deep need to laugh in the middle of a JIRA ticket titled “Small UI Fix (urgent)”.&lt;/p&gt;
&lt;h3 id=&quot;in-the-wild-when-burnout-becomes-art&quot;&gt;💻 In the Wild: When Burnout Becomes Art&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// TODO: write tests&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// TODO: learn how to write tests&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// TODO: find inner peace&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Simple Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These comments don’t help the next developer understand the system. But they &lt;em&gt;do&lt;/em&gt; help them feel a little less alone. This is The Comedian at work—breaking under pressure, but doing it with charm.&lt;/p&gt;
&lt;p&gt;Whether it’s gallows humour or just a cry for help with punchlines, these comments show a developer trying to stay human in an environment that’s gone full Jira.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# I call this the poetry-driven development section&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# Like a lonely flag&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# This boolean waves in silence&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# Unused. Forgotten.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; feature_enabled?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;  false&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Complex Example&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is a real-world emotional support function. It doesn’t do anything functional, but it &lt;em&gt;says everything&lt;/em&gt;. The Comedian leaves traces of themselves in the code—not just their logic, but their mood.&lt;/p&gt;
&lt;p&gt;Sometimes it’s a joke in a variable name. Sometimes it’s a limerick in a block comment. Whatever the format, the message is clear: “This sprint broke me. Here’s my little rebellion.”&lt;/p&gt;
&lt;h3 id=&quot;reflections&quot;&gt;🧠 Reflections&lt;/h3&gt;
&lt;p&gt;If you’ve left a cheeky comment in production code, it’s okay. You’re not alone. We all hit that moment where humour is the only thing holding the deployment pipeline together. The key is knowing when to indulge it—and when to clean up after yourself. Comedy is human, but clarity is kind. Maybe just leave the poem in the PR, not the main branch.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Random Thoughts</category></item><item><title>What if AI tools disappeared?</title><link>https://www.mrstebo.co.uk/what-if-ai-tools-disappeared/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/what-if-ai-tools-disappeared/</guid><description>There&apos;s an old quote from artist, Paul Cézanne: &quot;It&apos;s so fine and yet so terrible to stand in front of a blank canvas.&quot; The same could be said for developers staring at an empty file. It&apos;s that moment of hesitation—where do I start?…</description><pubDate>Mon, 17 Feb 2025 08:30:35 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/what-if-ai-tools-disappeared.D5MRNFR5_Z2yFrd.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s an old quote from artist, &lt;a href=&quot;https://en.wikipedia.org/wiki/Paul_C%C3%A9zanne?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Paul Cézanne&lt;/a&gt;: &lt;strong&gt;&amp;quot;It&amp;#39;s so fine and yet so terrible to stand in front of a blank canvas.&amp;quot;&lt;/strong&gt; The same could be said for developers staring at an empty file. It&amp;#39;s that moment of hesitation—where do I start? What&amp;#39;s the best approach?—that AI tools now conveniently erase.&lt;/p&gt;
&lt;p&gt;But what if they were gone?&lt;/p&gt;
&lt;p&gt;What if, overnight, &lt;a href=&quot;https://www.cursor.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Cursor&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;,&lt;/strong&gt; &lt;a href=&quot;https://chatgpt.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;ChatGPT&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;,&lt;/strong&gt; &lt;a href=&quot;https://www.deepseek.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;DeepSeek&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, and&lt;/strong&gt; &lt;a href=&quot;https://github.com/features/copilot?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Copilot&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;vanished&lt;/strong&gt;? No auto-generated functions. No neatly scaffolded components. No AI-powered explanations of code you haven&amp;#39;t seen before. Just you, a blinking cursor, and a problem to solve.&lt;/p&gt;
&lt;p&gt;Would we still be as productive? Would we still know how to structure a new project? Would we still be able to debug complex issues without AI leading the way?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been thinking about this a lot—because, I remember a time before AI.&lt;/p&gt;
&lt;p&gt;Back when I first started coding, &lt;strong&gt;there were no AI copilots to lean on.&lt;/strong&gt; My first exposure to programming was watching my dad write Borland C++ on an old computer. That curiosity led me to break things apart—literally. I&amp;#39;d dismantle anything I could get my hands on, trying to understand how it worked, and then (mostly unsuccessfully) put it back together again.&lt;/p&gt;
&lt;p&gt;That same instinct carried into software. I didn&amp;#39;t just copy code—I needed to know how and why it worked. Whether it was reading ebooks, tinkering with Arduinos, or making a complete mess of my early projects, every mistake was a lesson that stuck with me.&lt;/p&gt;
&lt;p&gt;Fast forward to today, and I find myself questioning whether AI is removing that struggle too much.&lt;/p&gt;
&lt;p&gt;I started using AI tools because they helped me &lt;strong&gt;deliver projects faster, explore new technologies, and navigate massive codebases.&lt;/strong&gt; But as I&amp;#39;ve leaned on them more, I’ve noticed something unsettling:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;#39;m &lt;strong&gt;reading less documentation&lt;/strong&gt; and trusting AI&amp;#39;s output more—sometimes to my own detriment.&lt;/li&gt;
&lt;li&gt;I hesitate to &lt;strong&gt;make small changes manually&lt;/strong&gt; because AI might misunderstand and undo them later.&lt;/li&gt;
&lt;li&gt;The more I rely on AI, the less I &lt;strong&gt;exercise my problem-solving muscles.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This isn&amp;#39;t just a personal dilemma. I recently saw a post where someone built an entire platform using AI—only to find himself &lt;strong&gt;unable to fix it when things broke&lt;/strong&gt;. He didn&amp;#39;t know Python, so when the AI struggled to help, he was stuck.&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve started asking myself: &lt;strong&gt;Am I using AI as a tool, or am I letting it replace too much of the thinking?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what I want to explore here. Not just how AI tools have changed the way I code—but whether we, as developers, are losing something important in the process.&lt;/p&gt;
&lt;p&gt;Because if AI tools disappeared tomorrow, I want to know that I&amp;#39;d still be able to sit down, open a blank file, and &lt;strong&gt;just start coding.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;how-i-learned-to-code&quot;&gt;How I Learned to Code&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/nostalgic-scene-of-old.CmEKBw_d_Z25UUMG.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Before AI-assisted coding, before Copilot and ChatGPT could generate entire functions in seconds, the closest thing I had to &amp;quot;assistance&amp;quot; was Stack Overflow and a lot of trial and error.&lt;/p&gt;
&lt;p&gt;My first exposure to programming wasn&amp;#39;t through a structured course or an online tutorial—it was watching my dad work in Borland C++ on an old computer. I didn&amp;#39;t understand what he was doing, but something about it fascinated me. Code wasn&amp;#39;t just words on a screen—it was a way to control a machine, to make it &lt;em&gt;do&lt;/em&gt; things.&lt;/p&gt;
&lt;p&gt;That curiosity wasn&amp;#39;t limited to software. I had an obsession with taking things apart.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remotes, radios, old VCRs—if it had screws, I saw them as an invitation.&lt;/li&gt;
&lt;li&gt;Did I understand how they worked? &lt;em&gt;Not even remotely.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Did I successfully put them back together? &lt;em&gt;Occasionally.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;But the curiosity was there—I wanted to know what was &lt;em&gt;inside&lt;/em&gt;, even if I had no clue what I was looking at.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When I finally started programming myself, that same instinct kicked in. I didn&amp;#39;t just want to write code—I wanted to understand how it all worked under the hood.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I taught myself to code by &lt;strong&gt;reading ebooks&lt;/strong&gt; and &lt;strong&gt;messing around with&lt;/strong&gt; &lt;a href=&quot;https://www.arduino.cc/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Arduinos&lt;/strong&gt;&lt;/a&gt;, where I could see my code physically affect the real world.&lt;/li&gt;
&lt;li&gt;I wrote terrible programs, made a ton of mistakes, and probably deleted more code than I actually kept.&lt;/li&gt;
&lt;li&gt;Stack Overflow was my safety net. Not in the &amp;quot;copy-paste without thinking&amp;quot; kind of way, but as a &lt;strong&gt;knowledge repository&lt;/strong&gt; that helped me understand why things worked (or didn&amp;#39;t).&lt;/li&gt;
&lt;li&gt;And while I didn&amp;#39;t have AI autocomplete, I did have &lt;a href=&quot;https://www.codeblocks.org/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;CodeBlocks&lt;/strong&gt;&lt;/a&gt;, which gave me &lt;strong&gt;just enough&lt;/strong&gt; assistance—showing me what was in my class, what methods an instance had access to, and whether I was mistakenly trying to access private fields. But that was it—no &amp;quot;fill in the blanks&amp;quot; autocomplete, no &amp;quot;guess what I&amp;#39;m trying to write next.&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Back then, if I didn&amp;#39;t know something, I had to look it up, experiment, and figure it out manually. And because of that, when I learned something, it &lt;em&gt;stuck.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what makes me wonder: &lt;strong&gt;are AI tools removing too much of that struggle?&lt;/strong&gt; Are we losing an essential part of learning—the deep understanding that comes from wrestling with a problem until you finally crack it?&lt;/p&gt;
&lt;p&gt;Because while AI is great at generating solutions, I don&amp;#39;t want to wake up one day and realize I&amp;#39;ve forgotten how to think through them myself.&lt;/p&gt;
&lt;h2 id=&quot;the-tools-that-shaped-my-workflow&quot;&gt;The Tools That Shaped My Workflow&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.BK1MCBRJ_Z2x56Sn.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Every developer has that &lt;strong&gt;one&lt;/strong&gt; tool they started with—their first coding environment, their first debugger, their first &amp;quot;Why won&amp;#39;t this compile?!&amp;quot; moment.&lt;/p&gt;
&lt;p&gt;For me, my early years were a mix of trial, error, and switching between editors in search of the &amp;quot;perfect&amp;quot; setup. Spoiler: it doesn&amp;#39;t exist. But along the way, each tool taught me something new about coding, debugging, and how I worked best.&lt;/p&gt;
&lt;h3 id=&quot;the-early-days-just-trying-to-get-code-to-run&quot;&gt;The Early Days: Just Trying to Get Code to Run&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CodeBlocks&lt;/strong&gt; – My first serious C++ editor. Basic, functional, and the closest thing I had to an assistant. It wouldn&amp;#39;t write code for me, but at least it told me what was in my class, what methods I could call, and whether I was violating access modifiers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Eclipse&lt;/strong&gt; – When I thought, &lt;em&gt;I need something more powerful.&lt;/em&gt; Turns out, more powerful also meant &lt;em&gt;more confusing.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NetBeans&lt;/strong&gt; – When I dabbled in Java and JavaFX. It had everything I needed… but somehow, it never quite clicked.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;stepping-into-real-world-development&quot;&gt;Stepping Into Real-World Development&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visual Studio&lt;/strong&gt; – This was a game-changer. Once I started writing applications beyond simple scripts, Visual Studio gave me debugging tools, a solid UI, and an actual sense of control over my projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visual Studio for Mac&lt;/strong&gt; – Great in theory. In reality? &lt;strong&gt;Constant crashes.&lt;/strong&gt; 😩&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sublime Text &amp;amp; Atom&lt;/strong&gt; – When lightweight editors were all the rage, I jumped on board. They were fast, sleek, and had an endless supply of plugins.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;where-i-am-now&quot;&gt;Where I Am Now&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VSCode&lt;/strong&gt; – The one editor I&amp;#39;ve stuck with the longest. Customizable, powerful, and &lt;strong&gt;pretty much an industry standard at this point.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cursor&lt;/strong&gt; – My introduction to &lt;strong&gt;AI-assisted coding.&lt;/strong&gt; It promised to streamline development, generate useful boilerplate, and act as an intelligent coding partner.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ChatGPT &amp;amp; DeepSeek R1&lt;/strong&gt; – No longer just search engines with better branding—these tools have become &lt;strong&gt;part of my workflow,&lt;/strong&gt; answering questions, generating code, and even refactoring existing logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each tool shaped how I think about coding—from debugging strategies to workflow efficiency. But as I&amp;#39;ve moved from manual trial-and-error to AI-assisted development, I&amp;#39;ve started to wonder:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Have I gained speed at the cost of deep understanding?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And more importantly… if AI disappeared tomorrow, would I still know how to solve problems the way I used to?&lt;/p&gt;
&lt;h2 id=&quot;why-i-started-using-ai-tools&quot;&gt;Why I Started Using AI Tools&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde-hair.DZXgrweL_Z2q4DEu.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;At some point, every developer has faced the dread of the empty file. Where do I start? What&amp;#39;s the best structure? What&amp;#39;s the &lt;em&gt;correct&lt;/em&gt; way to implement this feature?&lt;/p&gt;
&lt;p&gt;That hesitation is what first led me to &lt;strong&gt;AI-assisted coding.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t start using AI tools because I was struggling—I started using them because they &lt;strong&gt;promised efficiency.&lt;/strong&gt; The idea of an &lt;strong&gt;intelligent coding assistant&lt;/strong&gt; that could help me write boilerplate, suggest improvements, and guide me through unfamiliar technologies was too good to ignore.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what &lt;strong&gt;AI brought to my workflow&lt;/strong&gt;&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;green&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✔️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Speeding up project delivery&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;No more wasting time on repetitive code.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;green&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✔️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Exploring new technologies faster&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;I could dive into unfamiliar frameworks without getting lost in documentation.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;green&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✔️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Navigating large codebases&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;AI could jump between files, find references, and summarize logic faster than I could.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;green&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✔️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Diagnosing issues&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;Especially in languages I wasn&apos;t an expert in, AI became a debugging partner.&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;At first, everything was great. The tools did exactly what they promised.&lt;/p&gt;
&lt;p&gt;But then I started noticing some unintended consequences.&lt;/p&gt;
&lt;p&gt;I wasn&amp;#39;t reading as much documentation anymore—I was &lt;strong&gt;trusting AI&amp;#39;s answers&lt;/strong&gt; without verifying them.&lt;br&gt;I hesitated to make manual edits—because &lt;strong&gt;AI might misunderstand and &amp;quot;correct&amp;quot; my changes.&lt;/strong&gt;&lt;br&gt;And worst of all, I started feeling like &lt;strong&gt;I was outsourcing too much of the thinking.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It reminded me of when &lt;a href=&quot;https://www.jetbrains.com/resharper/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Resharper&lt;/strong&gt;&lt;/a&gt; first started gaining popularity.&lt;/p&gt;
&lt;p&gt;Back then, I remember some developers being &lt;em&gt;resistant&lt;/em&gt; to using it because it felt like it was &amp;quot;writing the code for you.&amp;quot; Resharper wasn&amp;#39;t even an AI—it was just a really good refactoring tool. But even then, some people worried that relying on it too much would make them &lt;strong&gt;lazy developers&lt;/strong&gt; who didn&amp;#39;t fully understand what their code was doing.&lt;/p&gt;
&lt;p&gt;At the time, I thought that was an overreaction. After all, Resharper was just &lt;strong&gt;making existing workflows more efficient.&lt;/strong&gt; But now, looking at AI-assisted coding, I find myself asking the same questions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If I let AI handle too much, am I still fully in control of what I&amp;#39;m building?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I still believe in AI as a tool, but I started wondering: &lt;strong&gt;at what point does assistance become dependency?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And if AI tools suddenly disappeared… &lt;strong&gt;would I still be as effective as I think I am?&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-ai-trap&quot;&gt;The AI Trap&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/man-hooked-up.B-_F9wfX_Z1NeYax.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;At first, using AI-assisted coding felt like a superpower. Instead of staring at an empty file, I could describe what I needed, and AI would generate a solid starting point. I could explore new technologies without reading pages of documentation. I could refactor code in seconds.&lt;/p&gt;
&lt;p&gt;But over time, I started noticing &lt;strong&gt;small but significant shifts&lt;/strong&gt; in my workflow—shifts that made me question whether I was relying on AI a little &lt;em&gt;too&lt;/em&gt; much.&lt;/p&gt;
&lt;h3 id=&quot;1-ai-tools-can-be-stubborn&quot;&gt;1. AI Tools Can Be… Stubborn 😬&lt;/h3&gt;
&lt;p&gt;One of the first red flags appeared when I started using &lt;strong&gt;Cursor&amp;#39;s Composer feature.&lt;/strong&gt; It&amp;#39;s fantastic at generating multiple files when given a feature description. But as soon as I manually edited one of those files, &lt;strong&gt;things got weird.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If I asked AI to generate something new, it would &lt;strong&gt;re-add the code I had just removed.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;It would assume the file hadn&amp;#39;t been changed and apply &lt;strong&gt;updates based on old logic.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Eventually, I found myself hesitant to make even small manual changes, because I knew AI would &amp;quot;fight back&amp;quot; the next time I used it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I realized that instead of working &lt;em&gt;with&lt;/em&gt; AI, I was &lt;strong&gt;adjusting my workflow around its quirks&lt;/strong&gt;—which seemed backwards.&lt;/p&gt;
&lt;h3 id=&quot;2-the-documentation-black-hole&quot;&gt;2. The Documentation Black Hole&lt;/h3&gt;
&lt;p&gt;Another change? I started reading &lt;strong&gt;less documentation.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At first, this felt like a productivity boost—why sift through docs when I could just ask AI for the answer? But then I ran into &lt;strong&gt;SST&lt;/strong&gt; (a framework for deploying applications). AI kept giving me &lt;strong&gt;incorrect information&lt;/strong&gt;, likely because it wasn&amp;#39;t trained on the latest version. I trusted it &lt;strong&gt;without verifying&lt;/strong&gt;, and it sent me down a rabbit hole of debugging issues that shouldn&amp;#39;t have existed in the first place.&lt;/p&gt;
&lt;p&gt;That was my wake-up call:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI isn&amp;#39;t always right, and skipping documentation is a dangerous habit.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;3-losing-the-problem-solving-muscle&quot;&gt;3. Losing the Problem-Solving Muscle&lt;/h3&gt;
&lt;p&gt;Software engineering is, at its core, &lt;strong&gt;a problem-solving profession.&lt;/strong&gt; When AI tools start handling too much of the thinking, we lose that &lt;strong&gt;muscle memory&lt;/strong&gt;—the ability to work through complex issues ourselves.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a specific &lt;em&gt;euphoria&lt;/em&gt; that comes from struggling with a problem and finally solving it. AI can generate solutions in seconds, but it &lt;strong&gt;robs you of that struggle&lt;/strong&gt;—and with it, the deep understanding that comes from figuring things out on your own.&lt;/p&gt;
&lt;p&gt;I started asking myself:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;If AI generates a solution, do I fully understand why it works?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Am I thinking critically, or just accepting what it gives me?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Would I be able to solve this problem without AI&amp;#39;s help?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;#39;s when it hit me—I wasn&amp;#39;t just using AI as a tool. I was depending on it.&lt;/p&gt;
&lt;p&gt;And that&amp;#39;s a dangerous place to be.&lt;/p&gt;
&lt;h2 id=&quot;when-ai-fails-who-picks-up-the-pieces&quot;&gt;When AI Fails, Who Picks Up the Pieces?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/computer-on-fire-surrounded.C1DL4oc4_2suFbc.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy to praise AI when everything is working. It writes boilerplate, suggests optimizations, and helps you move fast. But what happens when things break?&lt;/p&gt;
&lt;p&gt;Recently, I came across a &lt;a href=&quot;https://www.reddit.com/r/ChatGPTCoding/comments/1ibtjri/my_project_became_so_big_that_claude_cant/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Reddit post&lt;/a&gt; that perfectly captured this dilemma.&lt;/p&gt;
&lt;p&gt;A developer had built an entire platform using AI. At first, everything seemed fine. But as the project grew, &lt;strong&gt;bugs started appearing&lt;/strong&gt;—bugs they didn&amp;#39;t know how to fix.&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;p&gt;Because the developer didn&amp;#39;t know &lt;strong&gt;Python.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;They had relied entirely on AI to generate the code, but when it came time to debug or extend the platform, they were stuck. The AI, which had seemed so helpful before, &lt;strong&gt;couldn&amp;#39;t fully understand its own work.&lt;/strong&gt; No matter what they tried, it kept giving &lt;strong&gt;vague, unhelpful suggestions.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;They were effectively &lt;strong&gt;locked out of their own project.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;OP has 0 knowledge about python, no knowledge = no stress&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;the-rise-of-ai-code-debt&quot;&gt;The Rise of AI Code Debt&lt;/h3&gt;
&lt;p&gt;This story isn&amp;#39;t unique. As AI-generated code becomes more common, we might start seeing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Developers struggling to maintain AI-written projects&lt;/strong&gt; they don&amp;#39;t fully understand.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI-generated &amp;quot;spaghetti code&amp;quot;&lt;/strong&gt;—inconsistent patterns, random abstractions, and no clear design philosophy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A new kind of consulting industry:&lt;/strong&gt; specialists who don&amp;#39;t build software, but &lt;strong&gt;fix what AI has built.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Essentially, we could be looking at &lt;strong&gt;AI debt&lt;/strong&gt;—just like tech debt, but worse, because no one truly understands how the system works.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s one thing to let AI speed up development. It&amp;#39;s another thing entirely to let it build something &lt;strong&gt;we can&amp;#39;t control.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Because when AI fails—and eventually, it will—&lt;strong&gt;who&amp;#39;s going to pick up the pieces?&lt;/strong&gt; 🤷&lt;/p&gt;
&lt;h2 id=&quot;what-am-i-doing-about-it&quot;&gt;What Am I Doing About It?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-developer-sat.CNSVbsLA_wXuWo.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;At this point, I had a choice. I could keep leaning on AI for speed and convenience, accepting the risks that came with it. Or I could make some changes—not to abandon AI entirely, but to make sure I was still in control.&lt;/p&gt;
&lt;p&gt;So, I started making some adjustments.&lt;/p&gt;
&lt;h3 id=&quot;1-switching-to-zed-for-a-fresh-coding-experience&quot;&gt;1. Switching to Zed for a Fresh Coding Experience&lt;/h3&gt;
&lt;p&gt;I recently downloaded &lt;strong&gt;Zed&lt;/strong&gt; (&lt;a href=&quot;https://zed.dev/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;zed.dev&lt;/a&gt;)—not because I needed another editor, but because I wanted to &lt;strong&gt;reset my approach to coding.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Zed &lt;em&gt;does&lt;/em&gt; have AI integration, but I intentionally &lt;strong&gt;did&amp;#39;t turn it on.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;I wanted to see what it felt like to code &lt;strong&gt;without AI assistance&lt;/strong&gt;, to rely on &lt;strong&gt;my own problem-solving skills&lt;/strong&gt; again.&lt;/li&gt;
&lt;li&gt;I also wanted to check it out because I&amp;#39;d heard about it in Rust circles, and I was curious about the experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&amp;#39;s not that I want to abandon AI-assisted coding entirely, but I don&amp;#39;t want my first instinct to be, &lt;em&gt;&amp;quot;Let me ask the AI.&amp;quot;&lt;/em&gt; I want to think first, code second, and only use AI when absolutely necessary.&lt;/p&gt;
&lt;h3 id=&quot;2-planning-features-before-writing-a-single-line-of-code&quot;&gt;2. Planning Features Before Writing a Single Line of Code&lt;/h3&gt;
&lt;p&gt;AI is great for filling in gaps, but I realized I was sometimes skipping an important step:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sitting down,&lt;/li&gt;
&lt;li&gt;Mapping out the feature,&lt;/li&gt;
&lt;li&gt;Thinking through the edge cases,&lt;/li&gt;
&lt;li&gt;And structuring the code &lt;em&gt;before&lt;/em&gt; touching the keyboard.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now, I force myself to plan my implementations on paper or in a markdown file first. This keeps me from blindly generating code before I fully understand what I need to build.&lt;/p&gt;
&lt;h3 id=&quot;3-the-what-if-ai-disappeared-test&quot;&gt;3. The &amp;quot;What If AI Disappeared?&amp;quot; Test&lt;/h3&gt;
&lt;p&gt;Every time I use AI, I ask myself:&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;yellow&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🔨&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Could I build this without AI?&lt;/strong&gt;&lt;/b&gt;&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;purple&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🤔&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Do I fully understand the code it&apos;s generating?&lt;/strong&gt;&lt;/b&gt;&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;📿&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;If AI tools disappeared tomorrow, would I still be confident in my ability to maintain this project?&lt;/strong&gt;&lt;/b&gt;&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;If the answer to any of those questions is &lt;em&gt;no&lt;/em&gt;, I take a step back and rethink how I&amp;#39;m using AI.&lt;/p&gt;
&lt;p&gt;Because at the end of the day, I don&amp;#39;t want to be the person staring at an AI-generated codebase I don&amp;#39;t understand. I want to know that if these tools disappeared tomorrow, I&amp;#39;d still be able to sit down, open a blank file, and just start coding.&lt;/p&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/mans-head-on-left.Bxi5cVzA_2o5ozA.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;AI is &lt;strong&gt;not the enemy.&lt;/strong&gt; It&amp;#39;s a tool—one that, when used well, can make us &lt;strong&gt;faster, more efficient, and more capable developers.&lt;/strong&gt; But like any tool, it &lt;strong&gt;shouldn&amp;#39;t replace fundamental skills.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve come to see AI coding assistants like autocorrect for writing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It speeds things up.&lt;/li&gt;
&lt;li&gt;It helps with structure.&lt;/li&gt;
&lt;li&gt;It can catch mistakes before they become problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But if you &lt;strong&gt;only&lt;/strong&gt; rely on autocorrect, eventually, you stop thinking about how words are spelled—and that&amp;#39;s where the danger lies.&lt;/p&gt;
&lt;p&gt;The empty canvas is an intimidating foe**,** and AI has done a great job of helping us get past that initial hurdle. But once the canvas isn&amp;#39;t empty anymore, we still have to be the ones holding the brush.&lt;/p&gt;
&lt;p&gt;So now, I focus on staying in control of my code.&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🧑‍🔬&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;I still use AI—but I &lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;verify&lt;/strong&gt;&lt;/b&gt; everything it suggests.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✍️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;I let AI &lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;assist&lt;/strong&gt;&lt;/b&gt;, not &lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;dictate&lt;/strong&gt;&lt;/b&gt;.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;💥&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;I make sure I can work &lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;without it&lt;/strong&gt;&lt;/b&gt;, even if I choose to use it.&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;Because if AI tools disappeared tomorrow, I don&amp;#39;t want to be left staring at a codebase I don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;I want to know that, even without AI, I can still solve problems, write great software, and think like an engineer.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>AI</category><category>Productivity</category><category>Self Reflection</category></item><item><title>Estimate or Die</title><link>https://www.mrstebo.co.uk/estimate-or-die/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/estimate-or-die/</guid><description>There’s one thing I can always count on from my old project manager friend: zero context. No &quot;Hey, how&apos;s it going?&quot; No &quot;This reminded me of that one project we worked on.&quot; Just a random Instagram link, dropped into my DMs like a cryptic…</description><pubDate>Mon, 10 Feb 2025 07:30:59 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/estimate-or-die.K0xz0HW7_Z24nl7j.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There’s one thing I can always count on from my old project manager friend: &lt;strong&gt;zero context.&lt;/strong&gt; No &amp;quot;Hey, how&amp;#39;s it going?&amp;quot; No &amp;quot;This reminded me of that one project we worked on.&amp;quot; Just a random Instagram link, dropped into my DMs like a cryptic puzzle.&lt;/p&gt;
&lt;p&gt;Curious (and slightly concerned), I tapped it.&lt;/p&gt;
&lt;figure class=&quot;figure embed embed-instagram&quot;&gt;&lt;iframe src=&quot;https://www.instagram.com/reel/DFQTr-SNUmr/embed/&quot; title=&quot;A post shared by Developer Timeline (@developertimeline)&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot;&gt;&lt;/iframe&gt;&lt;figcaption&gt;&lt;a href=&quot;https://www.instagram.com/reel/DFQTr-SNUmr/&quot; rel=&quot;noopener&quot;&gt;A post shared by Developer Timeline (@developertimeline)&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Static. Flickering lights. A deep, rasping voice filled the room:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Hello, team. I want to play a game.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The video shows Billy the Puppet from the Saw movie...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;We could use T-shirt sizes... but that would be too easy. Instead, we will use numbers in the Fibonacci sequence.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I laughed. Then I winced. Because while this was obviously satire, it was &lt;em&gt;also&lt;/em&gt; painfully accurate.&lt;/p&gt;
&lt;p&gt;See, I’ve always been a &lt;em&gt;&amp;quot;gut estimate&amp;quot;&lt;/em&gt; kind of guy. Just throw out a number, move on, and deal with reality later. But now, I’m deep in a three-month solo dev project, where estimation isn’t about avoiding chaos—&lt;strong&gt;it’s just to give stakeholders a vague idea of how long this will take.&lt;/strong&gt; The chaos is still inevitable.&lt;/p&gt;
&lt;p&gt;And, despite my natural resistance, I’m starting to see the value. &lt;strong&gt;Even bad estimates are better than none.&lt;/strong&gt; Because as much as we love to think Agile means &lt;em&gt;&amp;quot;just start coding and figure it out later,&amp;quot;&lt;/em&gt; the truth is—having some idea of what’s ahead actually helps you move &lt;em&gt;faster&lt;/em&gt;, not slower.&lt;/p&gt;
&lt;p&gt;It’s frustrating. It’s tedious. But, let’s be honest—so is arguing about whether something is a 5 or an 8 when we all know it’s just &lt;em&gt;&amp;quot;more than we want to do right now.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;ouch-i-feel-attacked&quot;&gt;Ouch, I feel attacked!&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/dramatic-horror-movie-style.F6Wr_NLE_Z2aanb2.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now, that Instagram video wasn’t supposed to be a life lesson. It was satire—just a joke. And yet, as I sat there watching Jigsaw talk about Fibonacci-based estimation like it was a form of psychological torture, I couldn’t shake the feeling that I had been personally attacked.&lt;/p&gt;
&lt;p&gt;Because let’s be honest—sometimes, estimation &lt;em&gt;does&lt;/em&gt; feel like a horror movie. You sit in a meeting, trapped with your team, staring at a backlog of tickets, knowing you won’t leave until you’ve assigned a number to each one. The PMs assure you, &lt;em&gt;“There are no wrong answers.”&lt;/em&gt; But the moment you suggest an 8 instead of a 5, the room erupts into chaos.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;“Are you sure this isn’t a 5?”&lt;br&gt;“Feels like a 13 to me.”&lt;br&gt;“Hold on, let’s compare it to that other ticket from last sprint.”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And suddenly, a task that could have been done in the time spent debating is now the subject of a full-blown philosophical discussion.&lt;/p&gt;
&lt;p&gt;The satire in that short worked because it captured a very real frustration: estimation is a weird mix of necessary planning and absolute nonsense. The numbers aren’t &lt;em&gt;real&lt;/em&gt; in any measurable sense—there’s no scientific formula for determining whether something is a 3 or a 5. But somehow, these arbitrary figures are the foundation of sprint planning, project roadmaps, and stakeholder expectations.&lt;/p&gt;
&lt;p&gt;It’s ridiculous. But also, against all logic… it kind of works 🤷.&lt;/p&gt;
&lt;h2 id=&quot;why-do-we-even-bother-estimating&quot;&gt;Why Do We Even Bother Estimating?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/developer-staring-blankly.DMLmhyFD_24dRMG.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;A few weeks ago, I kicked off a &lt;strong&gt;three-month project&lt;/strong&gt;. Just me as the solo developer, a backlog, and the expectation that, at some point, we would be able to tell the stakeholders &lt;strong&gt;roughly&lt;/strong&gt; how long it would take to deliver.&lt;/p&gt;
&lt;p&gt;Now, earlier in my career, this would have been the moment where I thought, &lt;em&gt;&amp;quot;No problem, I’ll just get started and figure it out as I go.&amp;quot;&lt;/em&gt; But experience has taught me that’s the fastest way to &lt;strong&gt;accidentally commit to a six-month project without realizing it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Luckily, this time, I had &lt;strong&gt;a solid backlog to start with.&lt;/strong&gt; Most of the stories were written by Em, our Product Owner, and they were &lt;strong&gt;detailed and clear&lt;/strong&gt; 🤩, making them easy to estimate. I could look at them, trust my gut, and assign numbers without overthinking. It was smooth sailing—until I got to the &lt;strong&gt;technical stories.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That’s when things got messy.&lt;/p&gt;
&lt;p&gt;Because when you’re working in a &lt;strong&gt;legacy codebase&lt;/strong&gt;, even the simplest task can be a &lt;strong&gt;trap.&lt;/strong&gt; A feature that &lt;em&gt;should&lt;/em&gt; be a straightforward 3-pointer can quickly unravel into:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A forgotten dependency buried in an old service,&lt;/li&gt;
&lt;li&gt;A function that &lt;em&gt;technically works&lt;/em&gt; but hasn’t been touched since before COVID,&lt;/li&gt;
&lt;li&gt;An API that does &lt;em&gt;almost&lt;/em&gt; what you need—except for one crucial thing that breaks everything.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And that’s when it hit me: &lt;strong&gt;whether it’s a feature request or a technical task, nothing is ever as simple as it seems.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That’s why we estimate—not because we expect to be 100% accurate, but because &lt;strong&gt;thinking ahead is better than walking in blind.&lt;/strong&gt; And as frustrating as it can be, that little bit of foresight makes all the difference between &lt;strong&gt;a manageable project and a slow-motion train wreck.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-unexpected-side-effect-of-planning&quot;&gt;The Unexpected Side Effect of Planning&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/developer-staring.BqV_Lr_b_ZHygSX.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Earlier in my career, I saw &lt;strong&gt;planning as an obstacle.&lt;/strong&gt; I wanted to &lt;strong&gt;get stuff done&lt;/strong&gt;, not sit in meetings debating whether a ticket was a 3 or a 5. Back then, estimation felt like an unnecessary roadblock—just another step between me and actually writing code.&lt;/p&gt;
&lt;p&gt;But these days? &lt;strong&gt;We have a nice process.&lt;/strong&gt; One that doesn’t feel like a waste of time, because it actually helps me &lt;em&gt;see into the future.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;During backlog refinement, I’m no longer just assigning arbitrary numbers—I’m &lt;strong&gt;mentally stepping through the work.&lt;/strong&gt; I can &lt;strong&gt;picture myself doing the task&lt;/strong&gt;, running into potential issues, and realizing where things might go off the rails. I spot dependencies before they trip me up, recognize hidden complexity, and sometimes, even catch problems before they become full-blown disasters.&lt;/p&gt;
&lt;p&gt;It turns out, estimation isn’t just about setting expectations for others—it’s a tool for &lt;strong&gt;future-proofing my own sanity.&lt;/strong&gt; And now that I see it that way, I can’t imagine working without it.&lt;/p&gt;
&lt;h2 id=&quot;guessing-with-purpose&quot;&gt;Guessing With Purpose&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/split-screen-comparison.NGE4nQ7k_Z1nE0Cg.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;There was a time when I thought &lt;strong&gt;estimating was pointless.&lt;/strong&gt; No matter what number you assign, things always take longer than expected, so why bother?&lt;/p&gt;
&lt;p&gt;But now that I’ve been through enough projects, I’ve realized something: &lt;strong&gt;even an imperfect estimate is valuable.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The real benefit of estimation isn’t the number itself—it’s the process of &lt;strong&gt;thinking through the work before you start.&lt;/strong&gt; And now that we have a solid process, estimation doesn’t feel like a chore—it feels like a &lt;strong&gt;preview of the work ahead.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instead of diving in blind, I get to step back and ask:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;What’s the actual scope of this work?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;What hidden problems might I run into?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;How does this fit into the bigger picture?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It’s like getting a &lt;strong&gt;sneak peek&lt;/strong&gt; of my own workload, and that alone makes it worthwhile 💪.&lt;/p&gt;
&lt;h2 id=&quot;estimating-without-losing-your-mind&quot;&gt;Estimating Without Losing Your Mind&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/dramatic-tug-of-war-between.DLjDzMNe_Z135NaY.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;For the longest time, I thought estimation and agility were at odds with each other. Agile is supposed to be about &lt;em&gt;speed&lt;/em&gt;, about embracing change and iterating quickly. Meanwhile, estimation often feels like the opposite—slowing down to analyze, predict, and preemptively assign numbers to work that might shift at any moment.&lt;/p&gt;
&lt;p&gt;But here’s the twist: &lt;strong&gt;good estimation doesn’t slow you down—it helps you move faster.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Think about it. When you take the time to estimate properly, you:&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;green&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🔍&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;Identify hidden complexity &lt;i&gt;&lt;em class=&quot;italic&quot;&gt;before&lt;/em&gt;&lt;/i&gt; it derails a sprint.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;purple&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🖇️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;Spot dependencies early so you don’t get stuck waiting on someone else.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;yellow&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;⏰&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;Avoid wasting time building something one way, only to realize halfway through that it should’ve been done differently.&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;The trick is not to overdo it. Estimation &lt;strong&gt;shouldn’t&lt;/strong&gt; turn into a bureaucratic nightmare where every task requires a 30-minute philosophical debate. It’s just about getting a rough sense of what’s ahead so you can &lt;strong&gt;adapt more effectively&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Because, let’s be real—Agile never meant &lt;em&gt;“don’t plan.”&lt;/em&gt; It meant &lt;em&gt;“plan just enough so you don’t completely screw yourself over.”&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;estimate-or-die-figuratively-of-course&quot;&gt;Estimate or Die (Figuratively, Of Course)&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/dramatic-mission-complete.WQ4v7ZJ5_28gN5c.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Looking back, I started this project with the same attitude I’ve always had toward estimation: &lt;em&gt;I’ll do it if I have to, but I don’t have to like it.&lt;/em&gt; And while that hasn’t changed entirely, I have to admit—there’s &lt;strong&gt;value&lt;/strong&gt; in this process.&lt;/p&gt;
&lt;p&gt;Estimating work isn’t about predicting the future with perfect accuracy. It’s about getting just enough clarity to avoid walking into unnecessary disasters. It’s about &lt;strong&gt;spatial awareness&lt;/strong&gt;—understanding the shape of the work ahead so you can make better choices. Whether it’s a design decision, an architectural choice, or just figuring out how painful your next sprint will be, having a rough sense of scope makes life easier.&lt;/p&gt;
&lt;p&gt;So, while I may never &lt;em&gt;love&lt;/em&gt; estimation, I no longer see it as pointless. And I guess that’s the real takeaway here: you don’t have to enjoy it—you just have to accept that sometimes, the numbers &lt;em&gt;do&lt;/em&gt; matter.&lt;/p&gt;
&lt;p&gt;Because at the end of the day, whether you like it or not… &lt;strong&gt;estimate, or die.&lt;/strong&gt; &lt;em&gt;(Metaphorically. Hopefully.)&lt;/em&gt;&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Agile Methodology</category><category>Software Engineering</category></item><item><title>Rust - And The Joy Of Learning New Languages</title><link>https://www.mrstebo.co.uk/rust-and-the-joy-of-learning-new-languages/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/rust-and-the-joy-of-learning-new-languages/</guid><description>Learning a new programming language is like stepping into an entirely new world—a world where I know nothing, where everything is unfamiliar, and every discovery brings a sense of accomplishment. It’s a thrilling place to be, full of…</description><pubDate>Mon, 13 Jan 2025 08:00:18 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/rust-and-the-joy-of-learning-new-languages.jHzUBFzb_Qu4bv.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Learning a new programming language is like stepping into an entirely new world—a world where I know nothing, where everything is unfamiliar, and every discovery brings a sense of accomplishment. It’s a thrilling place to be, full of opportunities to explore new paradigms and revisit old concepts from fresh perspectives. Recently, I found myself drawn into the world of Rust, a language that has been gaining attention for its emphasis on memory safety and performance.&lt;/p&gt;
&lt;p&gt;My fascination with Rust feels like coming full circle in many ways. At the very start of my career, I worked with C and C++—building visuals with &lt;a href=&quot;https://openframeworks.cc/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;OpenFrameworks&lt;/a&gt; and experimenting with &lt;a href=&quot;https://en.wikipedia.org/wiki/Open_Sound_Control?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;OSC&lt;/a&gt;, the Open Sound Control protocol. These projects let me combine my love for coding and music, exploring the intersection of art and technology. Later, I delved into programming microcontrollers like AVRs, PICs, and &lt;a href=&quot;https://www.arduino.cc/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Arduinos&lt;/a&gt;, dabbling in C and even some Assembly for small-scale embedded projects. That hands-on experience with low-level programming gave me a deep appreciation for the intricacies of how software interacts with hardware.&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://www.youtube-nocookie.com/embed/-8sDt4_q4D8&quot; title=&quot;ATMEGA328 doing sums! Programmed using the Arduino :)&quot; width=&quot;560&quot; height=&quot;315&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=-8sDt4_q4D8&quot;&gt;▶ ATMEGA328 doing sums! Programmed using the Arduino :)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, years later, Rust has reignited that spark. My journey began with &lt;a href=&quot;https://amzn.to/49SbTRl?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Rust Programming Language - Second Edition&lt;/em&gt;&lt;/a&gt;, a book consistently recommended to me by the Amazon recommendation engine 😂. What strikes me immediately when picking up a new language is how it transports me back to the &amp;quot;beginner&amp;#39;s mindset&amp;quot;—a place where I can embrace the challenge of starting from scratch, peeling back the layers of a language I have never touched before. The book dives deep into low-level concepts, reminiscent of my earlier experiences with C/C++, but with a modern twist: safety and clarity at the forefront.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/rust-and-the-joy-of-learning-new-languages-1.D45YHh7p_4MnoE.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1600&quot;&gt;&lt;/p&gt;
&lt;p&gt;Rust is unique not only because of its features but because of its philosophy. As I’ve worked through the chapters, I’ve come to appreciate why this language exists, the problems it aims to solve, and the way it combines familiar constructs with innovative ideas. In this article, I want to share what I’ve discovered so far—both the familiar and the novel—about Rust, and why this journey has been so rewarding.&lt;/p&gt;
&lt;h2 id=&quot;a-brief-history-of-rust-and-why-it-exists&quot;&gt;A Brief History of Rust and Why It Exists&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/synthwave-inspired-version-of-mozilla-logo.DXECgygC_Z1y6O5u.jpg&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;1024&quot;&gt;&lt;/p&gt;
&lt;p&gt;Rust&amp;#39;s story begins with &lt;a href=&quot;https://www.mozilla.org/en-GB/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Mozilla&lt;/a&gt;, the organization best known for the Firefox web browser. In 2010, Mozilla employee &lt;a href=&quot;https://everipedia.org/wiki/lang_en/graydon-hoare?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Graydon Hoare&lt;/a&gt; created &lt;a href=&quot;https://en.wikipedia.org/wiki/Rust_(programming_language)?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Rust&lt;/a&gt; as a personal project, aiming to address some of the challenges faced by languages like C and C++. These languages, though incredibly powerful and versatile, have long been plagued by issues like memory safety errors and undefined behavior. Hoare’s vision was to create a systems programming language that maintained the low-level control and performance of C/C++, but without compromising on safety and reliability.&lt;/p&gt;
&lt;p&gt;The language gained traction when Mozilla adopted it for internal use, particularly in the development of &lt;a href=&quot;https://servo.org/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Servo&lt;/a&gt;, a new web rendering engine. Servo became a proving ground for Rust, demonstrating how it could handle complex, performance-critical tasks while avoiding common programming pitfalls like null pointer dereferences and data races. By 2015, Rust had matured enough for its first stable release, and it quickly gained a reputation as a modern systems programming language built for safety, concurrency, and performance.&lt;/p&gt;
&lt;p&gt;What makes Rust stand out is its philosophy. At its core, Rust is designed to help developers write code that is not only efficient but also correct. It achieves this through features like its ownership model, which enforces strict rules about how memory is managed, and its strong type system, which eliminates whole classes of bugs at compile time. Rust&amp;#39;s ecosystem is bolstered by tools like Cargo, its package manager and build system, which makes dependency management and project setup a breeze.&lt;/p&gt;
&lt;p&gt;But why does Rust exist in the first place? To understand this, it helps to look at the problems it aims to solve:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Memory Safety&lt;/strong&gt;: Rust prevents issues like buffer overflows and use-after-free errors without relying on garbage collection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;: Rust&amp;#39;s ownership system allows developers to write concurrent programs without worrying about data races.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Rust delivers C/C++-like performance, making it suitable for resource-intensive tasks like game engines, web browsers, and operating systems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Rust isn&amp;#39;t just a tool for experts in low-level programming—it’s a language that encourages good practices and helps developers learn how to write safer, more efficient code. Its growth in popularity is a testament to its ability to bridge the gap between high performance and high reliability.&lt;/p&gt;
&lt;h2 id=&quot;learning-rust-through-the-book&quot;&gt;Learning Rust Through the Book&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/group-of-people.B8T0BPSL_Z2trHiB.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;When I picked up the book, I wasn’t just looking for a tutorial—I was looking for a guide into the mindset behind Rust. The book didn’t disappoint. It feels like it’s written for learners who want to dig deep, offering not just &amp;quot;how-tos&amp;quot; but also the &amp;quot;whys&amp;quot; of the language. The experience reminded me of the time I first worked with C/C++, where every new concept felt like uncovering a fundamental truth about how computers work.&lt;/p&gt;
&lt;p&gt;The book starts by introducing Rust in a way that emphasizes its systems-level nature. Early chapters dive into concepts like ownership, borrowing, and lifetimes—features that make Rust distinct. It’s not just about writing code that works; it’s about writing code that’s safe and predictable at a level that most modern languages abstract away. This isn’t a lightweight &amp;quot;get up and running in an hour&amp;quot; tutorial. Instead, it’s a structured journey that ensures you understand the mechanics of what’s happening under the hood.&lt;/p&gt;
&lt;p&gt;What stood out to me early on was how much the book focuses on &lt;em&gt;why&lt;/em&gt; Rust has its unique approach to memory and safety. Concepts like the ownership model, which I’ll dive into later, are introduced with examples and analogies that make it easier to grasp. At times, it feels like a C or C++ programming guide, particularly when it discusses low-level topics like stack and heap memory, but the tone is approachable and modern, with a focus on avoiding pitfalls rather than just navigating them.&lt;/p&gt;
&lt;p&gt;The book also intersperses practical exercises and projects to reinforce each concept, which is something I found incredibly helpful. For example, creating small programs that manipulate strings, handle collections, or implement simple algorithms made each chapter feel like a step forward, not just a theoretical exercise.&lt;/p&gt;
&lt;p&gt;What I appreciate most is that it doesn’t shy away from Rust’s complexities. Instead, it guides you through them at a deliberate pace, ensuring you understand not just what Rust is doing, but also why it does it that way. As someone who has worked with a variety of languages over the years, I found myself constantly nodding along, thinking, &amp;quot;Ah, that’s clever,&amp;quot; or &amp;quot;That makes so much sense.&amp;quot;&lt;/p&gt;
&lt;p&gt;I’m currently on Chapter 9, where the focus shifts to error handling—a crucial aspect of Rust’s design philosophy. But even at this point, it’s clear that the book’s goal isn’t just to teach Rust syntax. It’s to help you think like a Rust programmer, embracing its focus on safety, performance, and clarity.&lt;/p&gt;
&lt;h2 id=&quot;rusts-approach-to-safety-and-preventing-bugs&quot;&gt;Rust’s Approach to Safety and Preventing Bugs&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/real-bugs-on-computer.Bd4miDRG_13xKe6.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;One of the first things you notice when learning Rust is its relentless focus on safety. Unlike many other languages, Rust doesn’t allow you to ignore potential issues—it forces you to address them upfront. While this might seem frustrating at first, it quickly becomes one of its most empowering features. The language is designed to help you write code that’s not just functional, but fundamentally reliable.&lt;/p&gt;
&lt;p&gt;At the heart of Rust’s safety philosophy is its ownership model. This system governs how memory is allocated, accessed, and released, ensuring that common issues like null pointer dereferences, use-after-free errors, and data races are impossible to write (at least, without unsafe blocks). Rust achieves this without relying on garbage collection, offering both performance and safety—a combination that’s rare in the programming world.&lt;/p&gt;
&lt;p&gt;Another standout feature is Rust’s approach to error handling. Unlike many languages where error states can be ignored or forgotten, Rust makes error management explicit. Functions that can fail return a &lt;code&gt;Result&lt;/code&gt; type, which requires you to handle both success and failure cases. This explicitness eliminates an entire class of bugs caused by unhandled exceptions or ignored error states. For example:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; file&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; File&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;hello.txt&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    match&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; file&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        Ok&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;File opened successfully!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;        Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Failed to open file: {:?}&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Rust also introduces features like lifetimes to ensure references are always valid. At first glance, this might seem overly complex, but it’s a necessary trade-off to ensure that memory safety is guaranteed without sacrificing performance. It’s a bit like having a strict but fair teacher—they might seem demanding at first, but you come to appreciate their rigor when you see the results.&lt;/p&gt;
&lt;p&gt;Another aspect I love is how Rust prevents data races in concurrent programs. Data races—situations where two threads access the same memory location simultaneously, with at least one write—are notoriously difficult to debug. Rust’s ownership model and type system make it impossible to write code with data races, forcing you to handle concurrency in a safe, structured way.&lt;/p&gt;
&lt;p&gt;These safety measures aren’t just about catching bugs—they’re about encouraging a mindset of careful, deliberate programming. They push you to think critically about your code, fostering habits that will carry over into any language you work with. The compiler might feel like a strict guardian at times, but it’s always working in your favor.&lt;/p&gt;
&lt;p&gt;Rust’s safety features go beyond theoretical benefits. They’re the reason the language has been embraced by industries where reliability is non-negotiable, from embedded systems to operating systems and beyond. It’s a language that doesn’t just help you write code—it helps you write &lt;em&gt;good&lt;/em&gt; code.&lt;/p&gt;
&lt;h2 id=&quot;familiar-features-in-rust&quot;&gt;Familiar Features in Rust&lt;/h2&gt;
&lt;p&gt;One of the joys of learning Rust has been spotting familiar concepts—features I’ve encountered in other languages, now appearing with a Rust twist. It’s fascinating to see how ideas travel across languages, evolve, and reappear in new contexts. Rust feels like a crossroads, where many of these ideas converge in a way that feels both comfortable and intriguing.&lt;/p&gt;
&lt;p&gt;Take &lt;strong&gt;pattern matching&lt;/strong&gt;, for example. Rust’s &lt;code&gt;match&lt;/code&gt; expression provides a way to evaluate a value against patterns and handle different cases concisely. Here’s a simple example:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;    1&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;One!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;    2&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;..=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Between two and five!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    _&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Something else!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This reminded me immediately of PHP&amp;#39;s &lt;code&gt;match&lt;/code&gt; expression, which simplifies conditional logic in a similar way:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;php&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$number&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; match&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;$number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;    1&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;One!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;    2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Between two and five!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    default&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Something else!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; $result&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ruby’s &lt;code&gt;case&lt;/code&gt; statement also came to mind. Although not identical, it achieves a similar result using ranges and patterns:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; case&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; number&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;when&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; then&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;One!&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;when&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; then&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Between two and five!&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Something else!&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;puts&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; result&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Another feature that stood out was Rust’s &lt;strong&gt;module system&lt;/strong&gt;, which felt very familiar from working with Ruby and Python. Modules allow you to group related functionality and control what’s exposed to the outside world. In Rust, you might organize your code like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;mod&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; utilities&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    pub&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Hello, {}!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    utilities&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;greet&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Alice&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This brought back memories of how I’d write similar code in Python, using a separate file for utilities:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;python&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# utilities.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    print&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Hello, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;!&quot;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt; utilities&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;utilities.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;greet&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Alice&quot;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDBFF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Rust also supports &lt;strong&gt;implicit returns&lt;/strong&gt;, where the last expression in a function is returned without the &lt;code&gt;return&lt;/code&gt; keyword. This felt intuitive, as it mirrors the behavior in Ruby:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; i32&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; i32&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; i32&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    a&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt; // Implicit return&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  a &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; b &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;# Implicit return&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Other familiar features include &lt;strong&gt;slices&lt;/strong&gt;, which are a way to work with subsets of collections. In Rust, slices look like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; array&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; slice&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// [2, 3]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Seeing this reminded me of similar functionality in JavaScript:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; array&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; slice&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// [2, 3]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What fascinates me is not which language does it better, but the shared vocabulary across programming. Features like pattern matching, modules, implicit returns, and slices are like recurring motifs in a piece of music—each language offering its interpretation. Rust’s familiarity, combined with its unique touches, makes learning it a delightful journey of recognition and discovery.&lt;/p&gt;
&lt;h2 id=&quot;discovering-rusts-unique-features&quot;&gt;Discovering Rust’s Unique Features&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/famous-five-looking.BaGxkHAQ_2riiKG.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;While Rust offers many familiar constructs, it also introduces concepts that feel entirely new, at least to me. These unique features often push you to think differently about programming, particularly when it comes to safety, memory management, and clarity. They’re some of the reasons Rust stands out as a language and why learning it has been so rewarding.&lt;/p&gt;
&lt;p&gt;One of the first things that caught my attention was Rust’s approach to &lt;strong&gt;mutability&lt;/strong&gt;. In Rust, variables are &lt;strong&gt;immutable by default&lt;/strong&gt;, meaning once a value is assigned, it cannot be changed. To allow mutation, you must explicitly declare the variable as mutable using the &lt;code&gt;mut&lt;/code&gt; keyword:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; mut&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Allowed because x is mutable&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This feels like a small change, but it has a big impact. It encourages you to think carefully about when and why a variable should change, leading to code that’s easier to reason about.&lt;/p&gt;
&lt;p&gt;Another fascinating concept is &lt;strong&gt;variable shadowing&lt;/strong&gt;. Shadowing allows you to reuse a variable name within the same scope, effectively overwriting the previous value. However, rather than mutating the original variable, shadowing creates a new one, letting you safely transform data without unintended side effects:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Shadowing the previous x&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;The value of x is: {}&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Output: 12&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Rust’s &lt;strong&gt;ownership model&lt;/strong&gt; is perhaps its most talked-about feature—and for good reason. Ownership governs how memory is allocated, accessed, and freed in Rust. Each value in Rust has a single owner, and when the owner goes out of scope, the value is automatically cleaned up. Ownership, combined with borrowing and lifetimes, ensures memory safety without the need for a garbage collector. For example:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; s1&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; String&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; s2&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; s1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Ownership is moved to s2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;    // println!(&quot;{}&quot;, s1); // This would cause a compile-time error&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;At first, the ownership model feels strict, but as you work with it, you begin to appreciate how it eliminates whole classes of bugs like use-after-free errors.&lt;/p&gt;
&lt;p&gt;Rust also introduced me to &lt;strong&gt;vectors&lt;/strong&gt;, which are like dynamic arrays. Unlike arrays, vectors allow their size to grow or shrink as needed, and their values are stored contiguously in memory, making them efficient. Here’s an example of a vector in action:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; mut&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; vec&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Vec&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;vec&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;vec&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;vec&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; num&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;vec&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;num&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Another unique feature is Rust’s emphasis on safety through type inference and detailed compile-time checks. For instance, lifetimes might initially feel complex, but they ensure references are always valid, eliminating dangling pointers or memory corruption. Although I’m still getting used to lifetimes, I can already see how they contribute to Rust’s goal of safe and predictable programming.&lt;/p&gt;
&lt;p&gt;These features, while new to me, have quickly become some of my favorite aspects of Rust. They encourage a mindset where safety, clarity, and intent take precedence, shaping not just how you write Rust, but how you think about programming in general.&lt;/p&gt;
&lt;h2 id=&quot;error-handling&quot;&gt;Error Handling&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/computer-screen.DtXgl-QZ_Z1DDyWI.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;As of now, I’ve made my way to Chapter 9, where the focus shifts to error handling. It’s fascinating to see how Rust tackles this fundamental aspect of programming, emphasizing clarity and safety even in the face of unexpected outcomes. Functions in Rust return a &lt;code&gt;Result&lt;/code&gt; type for operations that can fail, making error handling an explicit part of the code. This approach ensures that you can’t just “forget” to deal with potential issues—a habit that I’ve seen lead to trouble in other languages.&lt;/p&gt;
&lt;p&gt;For example, imagine a scenario where a restaurant booking system needs to handle various cases: tables being fully booked, invalid table numbers, or incorrect booking times. Rust’s &lt;code&gt;Result&lt;/code&gt; type makes it straightforward to deal with these possibilities explicitly:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;rust&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;use&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; std&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;collections&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;HashMap&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;#[derive(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;Debug&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;enum&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; BookingError&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    FullyBooked&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    InvalidTable&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    InvalidTime&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; book_table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; u8&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; u8&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Result&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; mut&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; tables&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; HashMap&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;u8&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; HashMap&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    tables&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Available&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    tables&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);  &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Fully booked&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    tables&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Available&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;tables&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;contains_key&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;InvalidTable&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; time&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 18&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; time&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 22&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;InvalidTime&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; tables&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;FullyBooked&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    Ok&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;format!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Table {} booked at {}:00!&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking1&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; book_table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;19&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Valid booking&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking2&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; book_table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Fully booked&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking3&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; book_table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;21&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Invalid table&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking4&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; book_table&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;17&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Invalid time&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;booking1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;booking2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;booking3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;booking4&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;iter&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        match&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; booking&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;            Ok&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;success&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;success&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;            Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;FullyBooked&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Booking failed: Fully booked.&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;            Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;InvalidTable&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Booking failed: Invalid table.&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;            Err&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;BookingError&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;InvalidTime&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; println!&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Booking failed: Invalid time.&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The output of this program would look like this:&lt;/p&gt;
&lt;div class=&quot;code-block&quot;&gt;&lt;pre class=&quot;shiki&quot;&gt;&lt;code&gt;Table 1 booked at 19:00!
Booking failed: Fully booked.
Booking failed: Invalid table.
Booking failed: Invalid time.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, the &lt;code&gt;book_table&lt;/code&gt; function returns a &lt;code&gt;Result&amp;lt;String, BookingError&amp;gt;&lt;/code&gt;, where the success case provides a confirmation message and the failure cases specify why the booking couldn’t be completed. Using the &lt;code&gt;match&lt;/code&gt; construct, each error is handled explicitly, making it clear what went wrong and why. This explicitness fosters a sense of responsibility for handling every possible outcome—a principle Rust enforces consistently.&lt;/p&gt;
&lt;p&gt;Looking back at what I’ve learned so far, it’s clear that Rust doesn’t shy away from its complexities. Concepts like ownership, borrowing, and lifetimes required me to pause, reread, and experiment more than I anticipated—but the payoff has been worth it. The strictness of the compiler, which initially felt like a barrier, is now something I appreciate deeply. It’s like having a skilled mentor constantly watching over your shoulder, catching mistakes before they can cause problems.&lt;/p&gt;
&lt;p&gt;At this point, I’m starting to see the bigger picture of why Rust exists and how its features work together. The language’s focus on safety and performance isn’t just about preventing bugs; it’s about encouraging a disciplined and thoughtful approach to programming. I’m excited to dive deeper into error handling and uncover more of Rust’s philosophy as I progress through the book.&lt;/p&gt;
&lt;h2 id=&quot;closing-thoughts&quot;&gt;Closing Thoughts&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.Cg6v_JuD_2dGdCD.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Learning Rust has been a journey unlike any other language I’ve explored. It’s not just about the syntax or the tools—it’s about embracing a philosophy that prioritizes safety, clarity, and performance. Rust challenges you to be deliberate in your choices, to think deeply about ownership, and to handle errors as a natural part of coding. It’s a mindset that has influenced not just how I write Rust code, but how I approach programming as a whole.&lt;/p&gt;
&lt;p&gt;What stands out most about Rust is how it brings together ideas from so many places. Whether it’s pattern matching, slices, or modules, there’s a sense of familiarity that bridges the gap between Rust and other languages I’ve worked with. At the same time, Rust’s unique features—its ownership model, explicit mutability, and compile-time checks—feel like a glimpse into the future of programming. It’s rare to find a language that balances familiarity and innovation so seamlessly.&lt;/p&gt;
&lt;p&gt;For me, learning Rust has been about rediscovering the joy of not knowing. Starting from scratch, fumbling through errors, and celebrating small victories has been an exhilarating experience. There’s a unique satisfaction in wrestling with a problem, understanding why the compiler refuses to budge, and finally arriving at a solution that feels solid and well-considered.&lt;/p&gt;
&lt;p&gt;Rust matters because it’s reshaping how we think about software. It’s proving that we don’t have to compromise between performance and safety, or between expressiveness and control. It’s a language designed for the long term, one that helps developers write code that’s not only functional but also correct and maintainable.&lt;/p&gt;
&lt;p&gt;As I continue this journey, I find myself not just learning Rust, but growing as a programmer. I believe that Rust will challenge me to write better code, to plan more carefully, and to think critically about the trade-offs I make. It’s not just a tool—it’s a teacher. And that, to me, is what makes it worth learning.&lt;/p&gt;
&lt;p&gt;If you’ve ever considered diving into Rust, I encourage you to give it a try. Whether you’re drawn by its safety features, its performance, or simply the thrill of learning something new, you’ll find that Rust has a way of leaving a lasting impression—not just on your code, but on how you think about programming itself.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Rust</category><category>Software Engineering</category><category>Software Development</category><category>Programming Languages</category></item><item><title>Books I Enjoyed in 2024</title><link>https://www.mrstebo.co.uk/books-i-enjoyed-in-2024/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/books-i-enjoyed-in-2024/</guid><description>At the start of each year, I love reflecting on the books that have shaped my thoughts and experiences over the past twelve months. Last year, I shared my favorite reads in Books I Enjoyed in 2023, where I delved into topics like personal…</description><pubDate>Mon, 06 Jan 2025 08:00:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/books-i-enjoyed-in-2024.E65o9N6D_FlrFf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;730&quot;&gt;&lt;/p&gt;
&lt;p&gt;At the start of each year, I love reflecting on the books that have shaped my thoughts and experiences over the past twelve months. Last year, I shared my favorite reads in &lt;a href=&quot;https://www.mrstebo.co.uk/books-i-enjoyed-in-2023/&quot;&gt;Books I Enjoyed in 2023&lt;/a&gt;, where I delved into topics like personal growth, business strategies, and storytelling. This year, my reading has been just as diverse, spanning everything from career development to mythology, psychology, and even military history.&lt;/p&gt;
&lt;p&gt;If there’s one lesson my reading habits reaffirm, it’s that variety truly is the spice of life. I’ve explored books that helped me professionally, inspired personal introspection, and even sparked creative connections in unexpected places. Whether it was learning how to navigate the complexities of a Staff Engineer role or understanding the whimsical pettiness of Greek Gods, each book offered something unique and valuable.&lt;/p&gt;
&lt;p&gt;Interestingly, my reading habits have quietly influenced my family, especially my two daughters. Sitting in the living room with a physical book in hand, I’ve noticed them start to take a greater interest in reading themselves. I’ve always told them they can buy any toys they want with their own money, but when it comes to books, I’m happy to foot the bill. This small encouragement has made reading feel like a shared adventure in our household, one that I hope will inspire a lifelong love of learning in them.&lt;/p&gt;
&lt;p&gt;As I recount the books I’ve read this year, I’ll share not just the ideas they’ve sparked but also the way they’ve shaped my perspective, both personally and professionally.&lt;/p&gt;
&lt;h2 id=&quot;staff-engineering-leadership-beyond-the-management-track-by-will-larson-and-tanya-reilly&quot;&gt;&lt;a href=&quot;https://amzn.to/41WEra4?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Staff Engineering: Leadership Beyond the Management Track&lt;/a&gt; by Will Larson and Tanya Reilly&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/staff-engineering-leadership-beyond-the-management-track.Bl6b0ScV_Z1KLcNR.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/41WEra4?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Staff Engineering: Leadership Beyond the Management Track&lt;/a&gt; by Will Larson and Tanya Reilly&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Earlier this year, while exploring job opportunities, I stumbled across a Staff Engineer role at &lt;a href=&quot;https://github.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;GitHub&lt;/a&gt;. At the time, I had no idea what a Staff Engineer was. Was it a technical guru? A strategic leader? Or perhaps something entirely different? To satisfy my curiosity—and prepare myself when I decided to apply—I picked this up.&lt;/p&gt;
&lt;p&gt;What I discovered was fascinating: the Staff Engineer role isn’t a singular concept but rather a spectrum. The book outlines different specialties within this track, such as Technical Lead, Technical Architect, and Solver of Really Hard Problems. This diversity of roles allows engineers to advance in their careers without needing to transition into traditional management, which often feels like the only option for career growth.&lt;/p&gt;
&lt;p&gt;One of the book’s most valuable insights was its practical advice on how to manage yourself effectively in such a role. It emphasizes balancing technical expertise with communication and leadership skills to maximize both personal and organizational impact. The authors also delve into the idea of “skill trees” for career progression, which resonated with me. Much like leveling up in a video game, you can choose to focus on areas like mentorship, system design, or operational excellence, depending on your interests and the needs of your team.&lt;/p&gt;
&lt;p&gt;This book was a revelation, not just for understanding the Staff Engineer role but also for broader career planning. It helped me realize that technical leadership can be as fulfilling and impactful as managing people—if not more so.&lt;/p&gt;
&lt;h2 id=&quot;oversubscribed-by-daniel-priestley&quot;&gt;&lt;a href=&quot;https://amzn.to/3DHGTaI?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Oversubscribed&lt;/a&gt; by Daniel Priestley&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/oversubscribed.DXV_5B9W_1MzAYo.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/3DHGTaI?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Oversubscribed&lt;/a&gt; by Daniel Priestley&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;When it comes to business and marketing, I’ve always believed that there’s a lot to learn from those who’ve mastered the art. Oversubscribed by Daniel Priestley is one of those books that offers not just theories but also actionable insights into creating demand for your product or service.&lt;/p&gt;
&lt;p&gt;The central idea of the book is simple yet profound: to succeed, you need to bring genuine value to your audience and, in doing so, create a buzz that leaves them wanting more. He provides a range of strategies to achieve this, all supported by real-world examples that bring his points to life. From exclusive offers to well-timed launches, the methods he describes are designed to position your business as something people can’t wait to be part of.&lt;/p&gt;
&lt;p&gt;One of my biggest takeaways was the importance of building relationships with your customers by consistently delivering value. Whether it’s through thoughtful engagement, high-quality products, or exceptional service, the focus should always be on exceeding expectations. For me, this translated directly into how I approach my work—ensuring that customers feel both valued and excited about what we offer.&lt;/p&gt;
&lt;p&gt;The book also made me reflect on how to apply these principles beyond business. Creating meaningful connections and delivering value is a philosophy that works in all areas of life, whether it’s in professional relationships or personal ones.&lt;/p&gt;
&lt;p&gt;Overall, Oversubscribed wasn’t just about business strategies—it was a reminder of the importance of understanding and serving the people around you.&lt;/p&gt;
&lt;h2 id=&quot;saving-social-care-by-neil-eastwood&quot;&gt;&lt;a href=&quot;https://amzn.to/3W1sAUH?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Saving Social Care&lt;/a&gt; by Neil Eastwood&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/saving-social-care.Cdointni_hFSwM.jpg&quot; alt=&quot;&quot; width=&quot;880&quot; height=&quot;1360&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/3W1sAUH?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Saving Social Care&lt;/a&gt; by Neil Eastwood&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;This year marked a significant milestone for me as I started working full-time at &lt;a href=&quot;https://carefriends.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Care Friends&lt;/a&gt;. Naturally, I wanted to understand the company&amp;#39;s mission and the industry it serves, so I picked up Saving Social Care by Neil Eastwood, the company&amp;#39;s founder.&lt;/p&gt;
&lt;p&gt;The book offers a candid look into the current challenges facing the social care sector. From workforce shortages to the growing demands of an aging population, it paints a vivid picture of why the industry is under immense pressure. What I appreciated most was how Neil didn’t just highlight the problems but also proposed actionable solutions.&lt;/p&gt;
&lt;p&gt;One of the standout insights for me was how much untapped potential exists within the social care workforce. Neil emphasizes the importance of recruitment and retention strategies that focus on the human element—identifying the right people, understanding their motivations, and ensuring they feel valued. It’s a refreshing perspective in an industry often constrained by rigid systems and limited resources.&lt;/p&gt;
&lt;p&gt;Reading this book before fully immersing myself in my role was invaluable. It gave me a deeper appreciation for the work we do at Care Friends and the impact we can have on both the industry and the individuals we support. It also reinforced the importance of technology as a tool to address some of these systemic challenges.&lt;/p&gt;
&lt;p&gt;If you’re curious about the social care sector or simply want to understand how businesses can navigate complex challenges, Saving Social Care is a compelling read. For me, it was not just educational but also deeply inspiring.&lt;/p&gt;
&lt;h2 id=&quot;isnt-it-obvious-by-eliyahu-m-goldratt&quot;&gt;&lt;a href=&quot;https://amzn.to/3W1sAUH?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Isn’t It Obvious&lt;/a&gt; by Eliyahu M. Goldratt&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/isnt-it-obvious.VsCYa2K8_Z1bMltD.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/3W1sAUH?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Isn’t It Obvious&lt;/a&gt; by Eliyahu M. Goldratt&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I’ve always been drawn to books that use storytelling to illustrate big ideas, and Isn’t It Obvious by Eliyahu M. Goldratt was no exception. Much like his classic &lt;a href=&quot;https://amzn.to/4gDHKro?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Goal&lt;/em&gt;&lt;/a&gt;, this book combines a fictional narrative with profound insights into problem-solving and business management.&lt;/p&gt;
&lt;p&gt;The story revolves around a retail business facing significant challenges. From inventory management issues to communication breakdowns, the characters work through a series of problems that will feel familiar to anyone navigating complex systems. What made this book stand out for me was how it captured the emotional and personal struggles that come with trying to enact meaningful change—both at work and at home.&lt;/p&gt;
&lt;p&gt;A recurring theme in the book is the need to challenge assumptions and habits that no longer serve us. Change isn’t easy, especially when it requires convincing others to adopt new ways of thinking. Yet, as the characters in the story demonstrate, persistence and clear communication can lead to transformative outcomes.&lt;/p&gt;
&lt;p&gt;I found myself reflecting on how this applies to my own work. Whether it’s improving processes or introducing new ideas, the lessons from this book remind me that progress often starts with asking, “Isn’t it obvious?” and then digging deeper to uncover the real solutions.&lt;/p&gt;
&lt;p&gt;Goldratt’s storytelling once again delivered not just practical lessons but also a reminder of the importance of empathy, patience, and a willingness to embrace change. This book was as much about personal growth as it was about professional improvement, making it an incredibly rewarding read.&lt;/p&gt;
&lt;h2 id=&quot;mythos-by-stephen-fry&quot;&gt;&lt;a href=&quot;https://amzn.to/3W4aAZD?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Mythos&lt;/a&gt; by Stephen Fry&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/mythos.BLGQngQL_Zxyckn.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/3W4aAZD?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Mythos&lt;/a&gt; by Stephen Fry&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I’ve always been fascinated by mythology, particularly Greek mythology, and Stephen Fry’s Mythos was an absolute delight. The book takes you through the origins of the Greek Gods, the creation of humanity, and the intricate web of stories that shaped ancient beliefs. What I loved most was how Fry brought these tales to life with his trademark wit and charm, making them feel both timeless and refreshingly modern.&lt;/p&gt;
&lt;p&gt;The stories themselves were captivating. From the drama and spitefulness of the Gods to the fascinating origins of everyday words, each chapter left me more intrigued than the last. For example, learning about the creation of man and Prometheus’s defiance against Zeus was both awe-inspiring and oddly relatable 😅. It was also fascinating to see how the quirks and flaws of the Gods reflected human nature, often in exaggerated but humorous ways.&lt;/p&gt;
&lt;p&gt;One of the things that struck me was how many of these myths have left a lasting legacy on modern language and culture. Words and expressions we use without a second thought often have their roots in these ancient stories, which added an extra layer of richness to the book.&lt;/p&gt;
&lt;p&gt;On a personal note, the playful antics of the Gods reminded me of my own tendency to take things literally for a laugh—a small but amusing connection that made the book even more enjoyable. In fact, I enjoyed Mythos so much that I immediately picked up Fry’s follow-up, &lt;a href=&quot;https://amzn.to/4j1NEUL?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;Heroes&lt;/em&gt;&lt;/a&gt;, to continue the journey through Greek mythology.&lt;/p&gt;
&lt;p&gt;Whether you’re a long-time fan of mythology or just curious about the stories that have shaped so much of Western culture, Mythos is an engaging and insightful read.&lt;/p&gt;
&lt;h2 id=&quot;the-genetic-book-of-the-dead-by-richard-dawkins&quot;&gt;&lt;a href=&quot;https://amzn.to/4a17mvI?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Genetic Book of the Dead&lt;/a&gt; by Richard Dawkins&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-genetic-book-of-the-dead.CldduYjy_Z1MD0SK.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/4a17mvI?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Genetic Book of the Dead&lt;/a&gt; by Richard Dawkins&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;As someone who enjoys diving into Richard Dawkins’ thought-provoking works, The Genetic Book of the Dead was another fascinating addition to my reading list this year. Dawkins has an incredible ability to distill complex concepts into something understandable, and this book was no exception.&lt;/p&gt;
&lt;p&gt;One of the key themes of the book is the evolutionary process and how it essentially acts as a trial-and-error mechanism. Dawkins explains how small mutations occur randomly, akin to taking a shot in the dark, and how natural selection then determines which of those mutations will persist. Reading this brought back memories of his earlier work, &lt;a href=&quot;https://amzn.to/41ZKFX4?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Blind Watchmaker&lt;/em&gt;&lt;/a&gt;, which also explored the beauty of evolution as an iterative process.&lt;/p&gt;
&lt;p&gt;What I find most compelling about Dawkins’ work is how it parallels problem-solving in other domains, particularly in technology. Just as evolution tests countless mutations to find those that thrive in a given environment, we often take an iterative approach in software development or business strategies, experimenting with different solutions until we find the one that works. This connection between biology and human systems is something I’ve always found fascinating.&lt;/p&gt;
&lt;p&gt;The book also delves into the concept of DNA as a repository of ancestral experiences—essentially a record of what has worked in the past. It’s a humbling reminder of the resilience and adaptability of life, and it made me reflect on how we, too, carry lessons from our experiences forward into our work and personal lives.&lt;/p&gt;
&lt;p&gt;Overall, this book wasn’t just a lesson in biology but a source of inspiration for thinking about innovation and adaptation in everyday life. Dawkins continues to challenge and expand my understanding of the world, and this book was no exception.&lt;/p&gt;
&lt;h2 id=&quot;the-bomber-mafia-by-malcolm-gladwell&quot;&gt;&lt;a href=&quot;https://amzn.to/41SEO5G?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Bomber Mafia&lt;/a&gt; by Malcolm Gladwell&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-bomber-mafia.aritbWhy_pSXLT.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1200&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/41SEO5G?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Bomber Mafia&lt;/a&gt; by Malcolm Gladwell&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I’m a big fan of Malcolm Gladwell’s storytelling, and The Bomber Mafia was another captivating read from him this year. While it’s easy to think of military history as a dry topic, Gladwell’s ability to weave narrative and insight together brought the story to life in a way that was both engaging and thought-provoking.&lt;/p&gt;
&lt;p&gt;The book explores the evolution of bombing strategies during the 20th century, focusing on the contrasting cultures within different branches of the military—primarily the Air Force. What stood out to me was how the story began with the development of precision bombing technology, such as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Norden_bombsight?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Norden Bombsight&lt;/a&gt;, which promised to make bombing more accurate and humane. Yet, as Gladwell explains, reality often fell short of these idealistic visions, particularly in the chaos of war.&lt;/p&gt;
&lt;p&gt;One of the most compelling parts of the book was its examination of how and why the Air Force shifted from precision bombing to “area bombing.” This strategy, which focused on creating widespread chaos and demoralization, starkly contrasted with the early dreams of technological precision. Gladwell doesn’t shy away from the ethical dilemmas this shift presented, leaving readers to grapple with questions about morality, practicality, and the human cost of war.&lt;/p&gt;
&lt;p&gt;Beyond the historical insights, the book also prompted me to think about how different organizational cultures—whether in the military or in business—can lead to vastly different approaches to solving problems. It’s a reminder of how much the values and goals of a group shape its decisions, for better or worse.&lt;/p&gt;
&lt;p&gt;The Bomber Mafia was more than a history lesson; it was a reflection on innovation, ambition, and the unintended consequences of even the best-laid plans. Gladwell continues to be a trusted guide for exploring complex topics through compelling stories.&lt;/p&gt;
&lt;h2 id=&quot;the-man-who-mistook-his-wife-for-a-hat-by-oliver-sacks&quot;&gt;&lt;a href=&quot;https://amzn.to/4iWK12q?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Man Who Mistook His Wife for a Hat&lt;/a&gt; by Oliver Sacks&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-man-who-mistook-his-wife-for-a-hat-1.UG65gG3w_Z1qMGPy.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;675&quot;&gt;&lt;figcaption&gt;&lt;a href=&quot;https://amzn.to/4iWK12q?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Man Who Mistook His Wife for a Hat&lt;/a&gt; by Oliver Sacks&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Every so often, a book takes you completely by surprise. For me, that book this year was Oliver Sacks’ The Man Who Mistook His Wife for a Hat. I picked it up primarily because of its intriguing title, but it ended up being my favorite read of the year.&lt;/p&gt;
&lt;p&gt;The book is a collection of case studies detailing some of the most unusual and perplexing neurological disorders Sacks encountered during his career as a neurologist. Each story is both fascinating and deeply human, shedding light on the incredible diversity of ways in which the brain can process—and misinterpret—the world.&lt;/p&gt;
&lt;p&gt;What struck me most was the balance between scientific insight and empathy in Sacks’ writing. He doesn’t just describe the disorders clinically; he delves into the lives of the patients, exploring how these conditions affect their identities, relationships, and ability to navigate everyday life. It reminded me of &lt;a href=&quot;https://amzn.to/4gVsKov?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;Neurotribes&lt;/em&gt;&lt;/a&gt;, another favorite of mine, which also emphasized the importance of understanding neurodiversity.&lt;/p&gt;
&lt;p&gt;One particularly poignant theme in the book is the rigidity of medical practices and how they sometimes fail to accommodate unique or unconventional cases. Sacks highlights moments where creativity and open-mindedness could have significantly improved outcomes for patients who had otherwise been dismissed by standard protocols. This resonated with me as a reminder of the importance of tailoring solutions to individual needs, whether in healthcare, work, or life.&lt;/p&gt;
&lt;p&gt;The stories in this book are not just intellectually stimulating but also deeply moving. They illustrate how remarkable—and vulnerable—the human mind is, and how people find ways to adapt to even the most challenging circumstances. It’s a celebration of human resilience, but also a call to approach differences with curiosity and compassion.&lt;/p&gt;
&lt;p&gt;Without question, this one I’ll be recommending to anyone who’ll listen. It left me with a deeper appreciation for the complexity of the human experience and the value of truly seeing and understanding others.&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping Up&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/me-2-1.BAToVILe_2c8f7u.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;841&quot;&gt;&lt;figcaption&gt;I finally got to sit in my favorite yellow chair! Thanks Tom! 😏&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;As I look back on my reading journey this year, I’m reminded once again of the power of books to broaden our horizons and deepen our understanding of the world. From learning how to navigate the complexities of technical leadership to exploring the whimsical world of Greek mythology, each book brought something unique to the table.&lt;/p&gt;
&lt;p&gt;This year’s selection has been a mix of professional growth, personal introspection, and pure curiosity. Books like &lt;em&gt;Staff Engineering&lt;/em&gt; and &lt;em&gt;Oversubscribed&lt;/em&gt; provided actionable insights that I’ve already started applying in my work. Others, like &lt;em&gt;Mythos&lt;/em&gt; and &lt;em&gt;The Man Who Mistook His Wife for a Hat&lt;/em&gt;, offered windows into worlds far removed from my own, sparking new ideas and perspectives.&lt;/p&gt;
&lt;p&gt;Reading has also been a shared experience in my household, with my daughters showing more interest in books simply by seeing me enjoy them. Encouraging their love of reading—by offering to buy them any book they want—has been one of the unexpected joys of the year. It’s a small reminder that the impact of reading extends beyond the individual.&lt;/p&gt;
&lt;p&gt;Looking ahead, I’m excited to see where next year’s reading journey will take me. I already have a few books on my list, but I’m always open to recommendations. If you’ve read something this year that you think I’d enjoy, let me know—I’d love to hear about it.&lt;/p&gt;
&lt;h2 id=&quot;honorable-mention-ghost-in-the-wires&quot;&gt;Honorable Mention: &lt;a href=&quot;https://amzn.to/3PmKCwW?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Ghost in the Wires&lt;/a&gt;&lt;/h2&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/ghost-in-the-wires.KE9fUq17_Z2eFdjj.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1600&quot;&gt;&lt;figcaption&gt;Ghost in the Wires by Kevin Mitnick&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Although it didn’t quite make the main list, I’d be remiss if I didn’t mention Ghost in the Wires by Kevin Mitnick. Reading this book felt particularly poignant this year, following Mitnick’s passing in 2023. His story—a blend of technical brilliance, audacity, and an almost cinematic level of intrigue—has truly immortalized him in my memory.&lt;/p&gt;
&lt;p&gt;The book offers a firsthand account of Mitnick’s life as one of the most infamous hackers in history, detailing the incredible lengths he went to in order to breach systems, evade capture, and stay one step ahead of law enforcement. What stood out to me the most was his ability to combine technical expertise with social engineering, creating a level of surveillance and manipulation that was both impressive and unsettling.&lt;/p&gt;
&lt;p&gt;Reading about the techniques he employed made me reflect on how much has changed in the way we communicate—and what might still be possible. It also raised questions about how law enforcement (or perhaps less scrupulous individuals) could adapt these methods in the modern era. While some of the strategies Mitnick described may now be outdated, the principles behind them remain relevant, serving as both a warning and a lesson.&lt;/p&gt;
&lt;p&gt;Ghost in the Wires was a thrilling, thought-provoking read and a fitting tribute to a man whose impact on the cybersecurity world will not be forgotten. It’s a book I’d recommend to anyone curious about the history of hacking or the human ingenuity that can both create and exploit vulnerabilities in the systems we rely on.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Books</category></item><item><title>Weaponizing Astrology</title><link>https://www.mrstebo.co.uk/weaponizing-astrology/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/weaponizing-astrology/</guid><description>“I don&apos;t believe in astrology; I&apos;m a Sagittarius and we&apos;re skeptical.” — Arthur C. Clarke I’ve always found astrology fascinating—not because I believe the planets dictate our fate, but because of its sheer persistence in human culture…</description><pubDate>Mon, 30 Dec 2024 08:00:52 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/weaponizing-astrology.0f6cI7BV_Z190JbA.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;672&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“I don&amp;#39;t believe in astrology; I&amp;#39;m a Sagittarius and we&amp;#39;re skeptical.”&lt;/strong&gt;&lt;br&gt;— Arthur C. Clarke&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I’ve always found astrology fascinating—not because I believe the planets dictate our fate, but because of its sheer persistence in human culture. From ancient civilizations mapping the stars to modern-day memes about Mercury retrograde, astrology has managed to stay relevant for thousands of years. It’s a belief system that offers comfort, identity, and meaning, even to those who engage with it casually.&lt;/p&gt;
&lt;p&gt;But lately, I’ve been thinking about astrology in a different way. Could it be weaponized? Could the same horoscopes that guide romantic choices or career moves be used to manipulate decisions in high-stakes environments?&lt;/p&gt;
&lt;p&gt;This isn’t my usual tech-focused article, but it touches on something I’ve always found intriguing: social engineering. If you know how to exploit someone’s beliefs—especially one as ingrained and widespread as astrology—you can wield an incredible amount of influence. And when you combine that with technology, the possibilities become both fascinating and unsettling.&lt;/p&gt;
&lt;p&gt;In this article, I want to explore what astrology is, why people are drawn to it, and how it can shape decision-making. I’ll also dive into a hypothetical scenario of how someone could exploit astrology for strategic gain—a thought experiment that, to me, highlights the power of belief and its potential vulnerabilities.&lt;/p&gt;
&lt;h2 id=&quot;what-is-astrology&quot;&gt;What is Astrology?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/different-constellations.ChEjqmvE_Xw2lH.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Astrology is one of humanity’s oldest systems of belief, and I’ve always been fascinated by its evolution. Written references to astrology appear to have originated thousands of years ago in Mesopotamia, where ancient stargazers looked to the heavens for guidance. Back then, astrology wasn’t just about personality traits or daily horoscopes—it was a serious attempt to understand the relationship between celestial events and earthly happenings.&lt;/p&gt;
&lt;p&gt;The Greeks took it further, developing the zodiac system we recognize today, dividing the sky into twelve sections named after constellations like Aries, Taurus, and Gemini. Each sign was thought to influence personality and life events in unique ways. The Romans spread these ideas across their empire, embedding astrology deeply into Western culture. By the Middle Ages, astrology was studied alongside astronomy, straddling the line between science and mysticism.&lt;/p&gt;
&lt;p&gt;What I find most interesting is how astrology has reinvented itself in the modern era. In the 20th century, horoscopes became a pop culture phenomenon, appearing in magazines and newspapers. Suddenly, the stars weren’t just for scholars—they were for everyone. Today, astrology is even more accessible, thanks to apps, social media, and a constant stream of memes. Whether it’s Mercury retrograde wreaking havoc on your life or a tweet about “typical Leo behavior,” astrology feels more like a shared cultural language than a niche belief system.&lt;/p&gt;
&lt;p&gt;Even if I don’t personally believe the planets dictate our lives, I can see why astrology appeals to so many people. It’s not just about what’s written in the stars—it’s about how those stars help us tell our stories.&lt;/p&gt;
&lt;h2 id=&quot;why-do-people-believe-in-astrology&quot;&gt;Why Do People Believe in Astrology?&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/group-of-people-looking.B3mkZYHH_2wE5As.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Let’s face it—life can feel like a chaotic swirl of randomness. Enter astrology, stage left, offering what seems like a cosmic decoder ring to make sense of it all. For thousands of years, people have turned to the stars not only for guidance but for a sense of connection to something bigger.&lt;/p&gt;
&lt;p&gt;One key reason astrology persists is that it taps into a psychological phenomenon known as the &lt;a href=&quot;https://www.britannica.com/science/Barnum-Effect?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Barnum Effect&lt;/strong&gt;&lt;/a&gt;—our tendency to find meaning in vague, generalized statements. When you read that your star sign makes you “ambitious but occasionally indecisive,” it feels eerily accurate. After all, who hasn’t wrestled with ambition and indecision?&lt;/p&gt;
&lt;p&gt;Astrology also scratches a deeper itch: the desire for control in an unpredictable world. By telling us that the planets are pulling the strings, it offers an explanation for life’s highs and lows. Bad day at work? Mercury is retrograde. Feeling a surge of creative energy? Jupiter must be doing its thing. It’s oddly comforting to think the cosmos has a plan, even if it’s one we can’t quite see.&lt;/p&gt;
&lt;p&gt;Then there’s the social element. Astrology has gone from mysticism to meme culture, particularly in the digital age. Zodiac memes, horoscope apps, and star-sign compatibility quizzes are shared as light-hearted icebreakers or ways to connect with friends. It’s a fun, low-stakes way to bond, even if you don’t entirely believe in it.&lt;/p&gt;
&lt;p&gt;Finally, there’s identity. For some, astrology provides a framework to better understand themselves and others. Being labeled a Capricorn or Pisces adds an extra layer to how we perceive our quirks and motivations. It’s not about whether it’s “true” or “false”—it’s about the stories we tell ourselves to make sense of who we are.&lt;/p&gt;
&lt;p&gt;In a world that often feels out of our hands, astrology offers a narrative of connection, identity, and meaning. And that’s a pull even the most skeptical among us can understand.&lt;/p&gt;
&lt;h2 id=&quot;the-role-of-astrology-in-decision-making&quot;&gt;The Role of Astrology in Decision-Making&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/greek-council-looking-at-stars-and-writing.C4xJdIC-_1wv7sA.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;For many, astrology is a casual pastime—a way to plan their week or poke fun at friends’ “classic Sagittarius” behavior. But for others, astrology carries more weight, influencing decisions that ripple through their personal and professional lives.&lt;/p&gt;
&lt;p&gt;This is nothing new. Throughout history, rulers, warriors, and empires have turned to the stars for guidance. The ancient Babylonians, who laid the groundwork for modern astrology, believed celestial movements were divine messages about earthly events. Eclipses were seen as omens of change, often signaling the downfall of kings. In Rome, emperors consulted astrologers before waging wars, seeking reassurance that the cosmos favored their campaigns.&lt;/p&gt;
&lt;p&gt;Even one of the most pivotal events in Western history—the birth of Jesus—was intertwined with astrology. The Star of Bethlehem, followed by the Magi, is often interpreted as an astrological sign. It shows how celestial phenomena have long been seen as guides to pivotal decisions.&lt;/p&gt;
&lt;p&gt;Fast forward to the 20th century, and astrology’s role may seem less dramatic but no less influential. Nancy Reagan famously consulted astrologers to help plan President Reagan’s schedule during his time in the White House. Critics called it absurd, but it illustrates astrology’s ability to infiltrate even the most high-stakes environments when belief meets power.&lt;/p&gt;
&lt;p&gt;In business, the influence of astrology can be subtler but no less significant. Imagine a CEO delaying a major investment because they read their horoscope in a glossy magazine, warning against bold moves this week. Or an executive rescheduling a product launch to align with a supposedly auspicious planetary transit. Even when astrology isn’t explicitly cited, belief systems shape how we interpret risk, timing, and opportunity.&lt;/p&gt;
&lt;p&gt;Astrology’s appeal lies in its promise to decode the unknown. It offers the illusion of certainty in uncertain situations, which is especially enticing in high-pressure environments. Decisions grounded in astrology may seem irrational to outsiders, but to the believer, they feel perfectly logical—an alignment of the personal with the cosmic.&lt;/p&gt;
&lt;p&gt;In an interconnected world where split-second decisions can affect entire industries, the idea that the stars might quietly influence someone’s choices is both fascinating and a little unsettling.&lt;/p&gt;
&lt;h2 id=&quot;how-astrology-can-be-weaponised&quot;&gt;How Astrology Can Be Weaponised&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/mystic-spy-whispering-to-roman-senator-f7da8ab6.1xXuu6G1_ZsyutE.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The more I thought about astrology, the more I started to wonder: what happens when this ancient belief system becomes a tool for manipulation? If you know someone places their trust in the stars, it’s surprisingly easy to exploit that belief to steer their decisions—and not just on a personal level, but in high-stakes situations like business or politics.&lt;/p&gt;
&lt;h3 id=&quot;fabricated-forecasts&quot;&gt;Fabricated Forecasts&lt;/h3&gt;
&lt;p&gt;Imagine knowing that a high-level executive deeply trusts their horoscope for decision-making. By carefully crafting a fake astrological reading, you could nudge them toward choices that benefit your agenda. For example, a rival company might plant a fabricated forecast warning against bold financial moves, causing a delay in a competitor’s merger or investment.&lt;/p&gt;
&lt;p&gt;The genius of this tactic lies in its subtlety. The decision-maker feels in control, believing they’re acting on cosmic advice, when in reality, they’re being steered by someone with ulterior motives.&lt;/p&gt;
&lt;h3 id=&quot;building-a-luxury-astrology-brand&quot;&gt;Building a Luxury Astrology Brand&lt;/h3&gt;
&lt;p&gt;Another strategy is more elaborate but just as effective: creating an exclusive astrology service targeting high-net-worth individuals. The brand might offer bespoke readings, claiming to use advanced techniques or ancient knowledge accessible only to an elite few. Over time, these clients could become dependent on your guidance, seeking your advice on major decisions.&lt;/p&gt;
&lt;p&gt;Once trust is established, this relationship could be leveraged during negotiations or business dealings. Timing suggestions, “auspicious” dates, or compatibility warnings could subtly tip the scales in your favor without the client ever realizing.&lt;/p&gt;
&lt;h3 id=&quot;astrology-as-a-social-engineering-tool&quot;&gt;Astrology as a Social Engineering Tool&lt;/h3&gt;
&lt;p&gt;Astrology works so well for manipulation because it’s deeply personal yet universally accessible. Unlike more obscure belief systems, it’s familiar to nearly everyone, making it easier to weave into conversation or decision-making frameworks. Its inherent vagueness allows for broad interpretations, giving manipulators room to craft narratives that align with their goals while feeling specific to the target.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“Man prefers to believe what he prefers to be true.”&lt;/strong&gt;&lt;br&gt;— Francis Bacon&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Astrology, when weaponized, isn’t about believing in the stars—it’s about understanding how belief shapes behavior. By exploiting trust in the zodiac, you can influence decisions without raising suspicion, making it one of the most subtle and effective tools in the social engineer’s arsenal.&lt;/p&gt;
&lt;h2 id=&quot;the-power-of-collective-belief&quot;&gt;The Power of Collective Belief&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/people-in-robes-chanting.SiG_rx4y_Z1G6xOr.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;One thing that’s always struck me about astrology is how much its strength lies in collective belief. It’s not just about individuals reading their horoscopes—it’s about millions of people engaging with the same ideas at the same time. That shared experience reinforces its credibility and creates an echo chamber where skepticism has a hard time breaking through.&lt;/p&gt;
&lt;p&gt;Astrology’s strength doesn’t just come from individual conviction—it thrives on collective belief. When large groups of people share a worldview, their consensus reinforces it, making it resistant to challenge or change. In this way, astrology functions much like other belief systems: it’s not just about the stars; it’s about the community that surrounds them.&lt;/p&gt;
&lt;p&gt;Take, for instance, the phenomenon of Mercury retrograde. What might have been a niche astrological event has become a pop-culture staple. Now, every time Mercury appears to move backward in its orbit, millions collectively brace for technological glitches, communication breakdowns, and general chaos. Even skeptics can’t fully escape its pull—how many times have you joked about blaming a bad day on Mercury retrograde, even if you don’t believe in it?&lt;/p&gt;
&lt;p&gt;This shared belief creates an echo chamber, where skepticism is drowned out by repetition and reinforcement. The more people around you believe in something, the harder it is to dismiss. Astrology memes, horoscope apps, and social media posts amplify this effect, turning personal belief into a communal experience.&lt;/p&gt;
&lt;p&gt;For manipulators, this is fertile ground. &lt;strong&gt;When a belief system is normalized at a cultural level, it’s easier to exploit because it doesn’t trigger immediate suspicion.&lt;/strong&gt; If a high-level executive adjusts their business strategy based on an astrological insight, they’re less likely to question it when millions of others are doing the same.&lt;/p&gt;
&lt;p&gt;Collective belief also provides a shield against criticism. Questioning astrology often feels like questioning someone’s identity or social group, which can provoke defensiveness. This makes it harder to challenge even when the stakes are high, allowing manipulations to slip under the radar.&lt;/p&gt;
&lt;p&gt;The power of astrology lies not just in the stars but in the shared human need for connection, identity, and meaning. And when belief becomes a group activity, it’s almost impossible to disentangle personal conviction from social momentum.&lt;/p&gt;
&lt;h2 id=&quot;hypothetical-case-study&quot;&gt;Hypothetical Case Study&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/female-ceo-reading.D0wrcWpO_UFb61.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Picture this: a powerful CEO, known for their reliance on astrology, is about to finalize a billion-dollar merger. Weeks of planning and negotiations have brought the deal to the brink of completion. But just before signing, the CEO hesitates—they’ve read their horoscope for the week, and it warns against taking bold financial risks under Mercury retrograde.&lt;/p&gt;
&lt;p&gt;Unbeknownst to the CEO, this horoscope wasn’t written by chance. Instead, it was carefully planted on the astrology website they frequent—part of a calculated ploy by a competitor with everything to gain from the deal’s delay.&lt;/p&gt;
&lt;h3 id=&quot;how-it-happens&quot;&gt;How It Happens&lt;/h3&gt;
&lt;p&gt;The competitor, aware of the CEO’s belief in astrology, hires a hacker to breach the website hosting the CEO’s go-to horoscope page. Using basic reconnaissance and publicly available information about the CEO’s zodiac sign, the hacker modifies the weekly forecast for that star sign to include a warning:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“The planets advise extreme caution in financial matters this week. Avoid major commitments or risky investments under Mercury retrograde.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The message is subtle but potent, aligning perfectly with the CEO’s concerns. By the time the CEO reads it, it feels like a cosmic confirmation of their own gut instinct. The merger is postponed, just as the competitor intended.&lt;/p&gt;
&lt;h3 id=&quot;technical-espionage&quot;&gt;Technical Espionage&lt;/h3&gt;
&lt;p&gt;This plan combines traditional social engineering with technical precision:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Reconnaissance:&lt;/strong&gt; The competitor identifies the CEO’s belief in astrology and pinpoints the exact website they trust for daily horoscopes. This information might come from casual conversations, browser histories, or even a social media post where the CEO mentions their favorite astrology resource.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exploitation:&lt;/strong&gt; A hacker gains access to the horoscope site—either through vulnerabilities in the site’s security or via phishing schemes targeting its administrators.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Targeted Manipulation:&lt;/strong&gt; The hacker alters the content for the specific zodiac sign, ensuring the message aligns with the CEO’s decision-making context. The change is subtle enough to avoid detection by other users.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Impact:&lt;/strong&gt; The manipulated horoscope triggers doubt or hesitation in the CEO, allowing the competitor to exploit the delay to their advantage.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;the-ripple-effect&quot;&gt;The Ripple Effect&lt;/h3&gt;
&lt;p&gt;This isn’t just a one-off tactic. Similar methods could be used to manipulate political leaders, influence public opinion, or sabotage product launches. By blending technical expertise with psychological insight, the attacker gains a level of precision that’s hard to counter.&lt;/p&gt;
&lt;h3 id=&quot;the-ethical-dilemma&quot;&gt;The Ethical Dilemma&lt;/h3&gt;
&lt;p&gt;The brilliance of this scheme lies in its plausibility. Astrology isn’t the source of power here—it’s the CEO’s trust in the system that’s being exploited. And while the technical breach may eventually come to light, the connection between the fabricated horoscope and the delayed decision is almost impossible to prove.&lt;/p&gt;
&lt;p&gt;In a world where belief shapes behavior, the ability to rewrite the narrative—even digitally—becomes the ultimate weapon.&lt;/p&gt;
&lt;h2 id=&quot;ethics-and-reflection&quot;&gt;Ethics and Reflection&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/room-full-of-mirrors.dxRXTpXy_1nhJ1W.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The idea of weaponizing astrology might seem like a clever thought experiment, but it raises significant ethical concerns. At its core, this concept isn’t about whether astrology is real or fake—it’s about exploiting belief systems for manipulation, and that crosses a moral line.&lt;/p&gt;
&lt;h3 id=&quot;the-thin-line-between-influence-and-exploitation&quot;&gt;The Thin Line Between Influence and Exploitation&lt;/h3&gt;
&lt;p&gt;Persuasion is a natural part of human interaction. We shape opinions and negotiate outcomes daily. But when persuasion relies on deception or preys on deeply held beliefs, it veers into exploitation. Tailoring a horoscope to manipulate a decision isn’t just underhanded—it undermines trust in both the individual and the system they rely on.&lt;/p&gt;
&lt;p&gt;What makes this tactic particularly insidious is its subtlety. The person being manipulated often feels like they’re acting independently, unaware that their decision has been engineered. This level of deception isn’t just unethical—it’s corrosive to relationships, industries, and the social fabric as a whole.&lt;/p&gt;
&lt;h3 id=&quot;the-role-of-technology-in-modern-manipulation&quot;&gt;The Role of Technology in Modern Manipulation&lt;/h3&gt;
&lt;p&gt;The addition of technology, such as hacking an astrology website, complicates the ethical landscape further. While traditional social engineering might rely on face-to-face persuasion or cultural familiarity, digital tools allow for precise, large-scale manipulation. The anonymity and reach of technology make these tactics harder to trace and easier to replicate.&lt;/p&gt;
&lt;p&gt;Even beyond astrology, the idea of leveraging personal belief systems through technical espionage raises questions about the boundaries of ethical behavior in business, politics, and beyond. Where do we draw the line between strategic advantage and outright deceit?&lt;/p&gt;
&lt;h3 id=&quot;challenging-belief-systems-with-respect&quot;&gt;Challenging Belief Systems with Respect&lt;/h3&gt;
&lt;p&gt;One of the most difficult aspects of confronting manipulative tactics is how to address the belief systems they exploit. Astrology, like many other systems, provides comfort, identity, and connection. Criticizing or dismissing these beliefs can feel disrespectful or even counterproductive.&lt;/p&gt;
&lt;p&gt;The challenge lies in creating awareness without alienation—encouraging critical thinking while respecting personal values. This requires not just better education around manipulation tactics but also empathy for why people hold the beliefs they do.&lt;/p&gt;
&lt;h3 id=&quot;a-world-of-vulnerabilities&quot;&gt;A World of Vulnerabilities&lt;/h3&gt;
&lt;p&gt;Astrology is just one example of how belief can be weaponized. Any widely accepted system—be it cultural, religious, or ideological—has the potential to become a tool for exploitation. Recognizing this vulnerability is the first step toward protecting individuals and organizations from undue influence.&lt;/p&gt;
&lt;p&gt;As we navigate an increasingly interconnected and belief-driven world, the ethics of influence deserve more scrutiny than ever. The line between persuasion and manipulation isn’t always clear, but the consequences of crossing it can be profound.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/computer-hacker.C1NYyNSv_1jvq3z.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Astrology has always been fascinating to me—not because I think it holds the answers to life’s mysteries, but because of how deeply it resonates with people across time and cultures. Whether it’s guiding relationships, shaping decisions, or sparking memes, astrology taps into something fundamental about our need for meaning and connection.&lt;/p&gt;
&lt;p&gt;But as I explored this topic, I couldn’t help but wonder: is astrology just harmless fun, or does it tiptoe into the realm of misinformation—or even disinformation? Its predictions are vague enough to feel true for almost anyone, and that ambiguity is both its charm and its vulnerability. Who’s to say if a horoscope is genuinely guiding someone or subtly nudging them toward a decision that benefits someone else?&lt;/p&gt;
&lt;p&gt;What stands out to me is the power of belief itself. It doesn’t really matter whether astrology is “real.” What matters is that people trust it, and that trust shapes their actions. And when belief shapes behavior, it becomes a tool—one that can be used for connection, comfort, or, in the wrong hands, manipulation.&lt;/p&gt;
&lt;p&gt;The more I think about it, the more I see astrology as a reflection of ourselves. It’s not the stars guiding us; it’s our interpretation of them. And while that can be empowering, it’s also a reminder to be cautious about how much power we give to the systems we believe in—whether they’re ancient or modern, cosmic or digital.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“When it comes to controlling human beings, there is no better instrument than lies. Because, you see, humans live by beliefs. And beliefs can be manipulated.”&lt;/strong&gt;&lt;br&gt;— Michael Ende, The Neverending Story&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the end, astrology reminds us of the delicate interplay between belief and behavior. The stars may not dictate our fate, but our interpretation of them certainly can. And as we move further into an era where belief systems intersect with technology, the responsibility lies with all of us to question how and why we let those beliefs shape our lives.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Random Thoughts</category><category>Astrology</category><category>Social Engineering</category></item><item><title>The Funny Truth About Why You’re Always Behind Schedule</title><link>https://www.mrstebo.co.uk/the-funny-truth-about-why-youre-always-behind-schedule/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/the-funny-truth-about-why-youre-always-behind-schedule/</guid><description>Yak Shaving. The phrase alone is odd enough to make you pause, but once you’ve experienced it—and trust me, you have—you’ll never forget it. I first encountered the term while watching a talk by Aaron Patterson (a.k.a. tenderlove), who…</description><pubDate>Mon, 23 Dec 2024 08:00:20 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-funny-truth-about-why-youre-always-behind-schedule.DKjtI-A5_Z1XwGlF.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Yak Shaving. The phrase alone is odd enough to make you pause, but once you’ve experienced it—and trust me, you have—you’ll never forget it. I first encountered the term while watching a &lt;a href=&quot;https://www.youtube.com/watch?v=zIlYLZO2aRU&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;talk&lt;/a&gt; by Aaron Patterson (a.k.a. &lt;a href=&quot;https://x.com/tenderlove?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;tenderlove&lt;/a&gt;), who had the audience in stitches describing how a simple task can spiral into an elaborate, time-consuming tangent. It was both hilarious and unsettling because it hit so close to home.&lt;/p&gt;
&lt;p&gt;If you’ve ever sat down to tackle a straightforward problem, only to find yourself chasing down entirely unrelated tasks hours later, congratulations—you’ve been shaving the yak. Maybe you started fixing a small bug, but by the end of the day, you were knee-deep in configuring a new build system because you thought it would “help.” It’s a phenomenon that’s as maddening as it is universal, especially for programmers.&lt;/p&gt;
&lt;p&gt;I’ll be the first to admit that I’ve been a victim of this more times than I’d like. But over the years, I’ve learned to spot when I am wandering too far from the “primary directive” 😏. More importantly, I’ve started using meta-cognitive programming techniques to catch myself in the act and refocus before things spiral out of control.&lt;/p&gt;
&lt;p&gt;For today&amp;#39;s adventure, we will dive into Yak Shaving—what it is, how to recognize it, and how to navigate it without losing your sanity. Along the way, I’ll share insights from personal experience and brilliant examples from others, like &lt;a href=&quot;https://youtu.be/927W6zzvV-c?si=a4IafC1snt9IU4ae&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Primeagen’s&lt;/a&gt; most recent hilarious mission to push &lt;a href=&quot;https://devin.ai/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Devin AI&lt;/a&gt; into chaos. Whether you’re a programmer or just someone trying to stay productive, I hope this helps you wrangle those yaks and stay on track.&lt;/p&gt;
&lt;h3 id=&quot;what-is-yak-shaving&quot;&gt;What is Yak Shaving?&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/developer-attempting-to-shave-yak.45ddpJKQ_2vBFkk.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The term “Yak Shaving” has an odd charm to it—quirky enough to stick in your mind, yet abstract enough to make you wonder what it actually means. At its core, Yak Shaving describes those moments when a seemingly simple task snowballs into a series of increasingly unrelated sub-tasks. You set out to achieve one thing, but hours later, you find yourself tangled in a web of tasks that feel necessary in the moment but have taken you far from your original goal.&lt;/p&gt;
&lt;p&gt;The term itself was coined by Carlin Vieri during his time at MIT’s AI Lab in the 1990s. It was inspired by a segment from &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Ren_&amp;#38;_Stimpy_Show?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;The Ren &amp;amp; Stimpy Show&lt;/em&gt;&lt;/a&gt; that depicted a fictional holiday called “Yak Shaving Day.” The holiday involved absurd rituals, like hanging diapers instead of stockings and watching for a shaved yak to float by in an enchanted canoe. Vieri used this imagery to humorously capture the absurdity of getting sidetracked by unrelated tasks in pursuit of a larger goal.&lt;/p&gt;
&lt;p&gt;In programming, Yak Shaving often refers to the seemingly trivial or tangential tasks you end up doing because they’re prerequisites for solving a larger problem.&lt;/p&gt;
&lt;h4 id=&quot;a-couple-of-examples-to-set-the-scene&quot;&gt;A Couple of Examples to Set the Scene&lt;/h4&gt;
&lt;p&gt;Let’s ground this with a couple of examples, because if you’re anything like me, this abstract concept really hits home when paired with real-life scenarios.&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;💡&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;The Light Bulb Dilemma&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;There’s an &lt;a href=&quot;https://www.youtube.com/watch?v=AbSehcT19u0&amp;amp;ref=mrstebo.co.uk&quot; rel=&quot;noreferrer&quot;&gt;iconic moment&lt;/a&gt; from Malcolm in the Middle where Hal is attempting to change a light bulb. A straightforward task, right? But as he goes to find a new light bulb, he realizes the shelf in the cupboard is broken. So, he sets off to fix the shelf, only to discover that the drawer containing his tools is squeaking. Off he goes to fix the squeak… and hours later, Hal is nowhere near finishing the light bulb. That’s Yak Shaving.&lt;/div&gt;&lt;/aside&gt;&lt;figure class=&quot;figure&quot; data-width=&quot;regular&quot;&gt;&lt;img src=&quot;https://media.tenor.com/ENgHABC0E60AAAAC/bryan-cranston-replace-the-bulb.gif&quot; alt=&quot;&quot; width=&quot;350&quot; height=&quot;262&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/figure&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;pink&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🤖&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Primeagen’s AI Bot Chaos&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;Recently, I watched a &lt;a href=&quot;https://youtu.be/927W6zzvV-c?si=UewcjLiCxbbSN7Oc&amp;amp;ref=mrstebo.co.uk&quot; rel=&quot;noreferrer&quot;&gt;video&lt;/a&gt; where &lt;a href=&quot;https://x.com/ThePrimeagen?ref=mrstebo.co.uk&quot; rel=&quot;noreferrer&quot;&gt;Primeagen&lt;/a&gt; set out on a mission: to make Devin (an “AI employee”) push directly to the master branch (already a controversial move for anyone using Git). Devin, however, wasn’t having it and effectively stalled the process. Instead of pivoting to something productive, Primeagen doubled down, diving deeper into trying to brute-force the bot into compliance. By the end, the actual task of coding was a distant memory, replaced by a Yak Shaving showcase in all its glory.&lt;/div&gt;&lt;/aside&gt;&lt;h4 id=&quot;why-does-yak-shaving-happen&quot;&gt;Why Does Yak Shaving Happen?&lt;/h4&gt;
&lt;p&gt;At its heart, Yak Shaving is rooted in a desire for perfection and efficiency. You convince yourself that fixing all these tangential issues will make the original task easier, smoother, or better. But often, you end up creating more problems than you solve—or at the very least, spending far more time than you intended.&lt;/p&gt;
&lt;p&gt;For software engineers, Yak Shaving is almost a rite of passage. You think, “If I just tweak this configuration,” or “If I rewrite this function, it’ll make everything better.” Hours later, you’re deep in documentation for a library you didn’t even know existed this morning.&lt;/p&gt;
&lt;h4 id=&quot;the-bottom-line&quot;&gt;The Bottom Line&lt;/h4&gt;
&lt;p&gt;Yak Shaving isn’t inherently bad—it’s part of the creative problem-solving process. But left unchecked, it can derail your day and leave you with nothing tangible to show for your effort. Recognizing it when it starts is key, and that’s what we’ll explore next: how to spot Yak Shaving in real-time.&lt;/p&gt;
&lt;h3 id=&quot;how-to-recognize-yak-shaving&quot;&gt;How to Recognize Yak Shaving&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-that-is-slowing.RmAQqTUV_1F4rHl.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The challenge with Yak Shaving is that it often feels justified while it’s happening. You’re busy, you’re solving problems, and everything you’re doing seems important—until you step back and realize you’re miles away from your original goal. Learning to spot Yak Shaving as it’s happening is critical to staying focused and productive.&lt;/p&gt;
&lt;p&gt;Here are some telltale signs that you’re in the middle of a Yak Shaving spiral:&lt;/p&gt;
&lt;h4 id=&quot;youre-working-on-something-that-feels-urgent-but-isnt-actually-necessary&quot;&gt;You’re Working on Something That Feels Urgent but Isn’t Actually Necessary&lt;/h4&gt;
&lt;p&gt;One of the easiest ways to identify Yak Shaving is to pause and ask yourself, &lt;em&gt;Does this task directly serve my current goal?&lt;/em&gt; If the answer is no, you’re likely shaving the yak.&lt;/p&gt;
&lt;p&gt;For example, let’s say you’re trying to debug a piece of code, and along the way, you notice some messy formatting. Instead of staying on task, you decide to clean up the formatting “real quick.” Three hours later, you’ve refactored half the codebase, but the original bug is still sitting there, untouched.&lt;/p&gt;
&lt;h4 id=&quot;youre-solving-hypothetical-problems&quot;&gt;You’re Solving Hypothetical Problems&lt;/h4&gt;
&lt;p&gt;This is a classic trap. You spot something that might become an issue in the future and decide to address it now, even though it isn’t blocking your current progress. I’ve lost count of how many times I’ve gone down this rabbit hole, thinking I’m being proactive, only to end up wasting time on something that never materialized.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Am I solving a problem that doesn’t exist yet?&lt;/em&gt; is a question I now ask myself regularly. If the answer is yes, it’s a good sign to stop and refocus.&lt;/p&gt;
&lt;h4 id=&quot;your-tasks-are-multiplying&quot;&gt;Your Tasks Are Multiplying&lt;/h4&gt;
&lt;p&gt;Yak Shaving often follows a snowball effect. You start with one small detour, which leads to another, and then another. If your to-do list is growing instead of shrinking, it’s time to pause and reassess.&lt;/p&gt;
&lt;p&gt;For instance, in the Primeagen video, his goal was simple: make the AI bot push to master. But as the bot resisted, he kept chasing new solutions to “fix” it, each more elaborate than the last. The task multiplied into a series of unrelated challenges, none of which advanced his original goal.&lt;/p&gt;
&lt;h4 id=&quot;you-feel-like-youre-in-a-trance&quot;&gt;You Feel Like You’re in a Trance&lt;/h4&gt;
&lt;p&gt;This one is a bit harder to pinpoint, but it’s something I’ve noticed in myself. When I’m deep into Yak Shaving, I lose track of time and get hyper-focused on the immediate task at hand, completely forgetting why I started it in the first place. It’s a productive-feeling, flow-like state, but it’s misleading because it’s not tied to your true objective.&lt;/p&gt;
&lt;p&gt;When this happens, I’ve learned to step back and ask: &lt;em&gt;Why am I doing this right now? Is this helping me accomplish my main goal?&lt;/em&gt; If I can’t answer those questions clearly, I know it’s time to recalibrate.&lt;/p&gt;
&lt;h4 id=&quot;youre-stuck-in-a-loop-of-perfectionism&quot;&gt;You’re Stuck in a Loop of Perfectionism&lt;/h4&gt;
&lt;p&gt;Ah, this one gets me every time—guilty as charged. I’ve caught myself endlessly tweaking and polishing things that, in hindsight, didn’t actually add value. Perfectionism can be a sneaky driver of Yak Shaving because it convinces you that you’re improving things. But in reality, you’re often just delaying progress.&lt;/p&gt;
&lt;p&gt;The key question I’ve learned to ask myself here is: &lt;em&gt;Is this “good enough” for now?&lt;/em&gt; Often, the answer is yes.&lt;/p&gt;
&lt;h4 id=&quot;practical-ways-to-catch-yourself&quot;&gt;Practical Ways to Catch Yourself&lt;/h4&gt;
&lt;p&gt;Here are some simple strategies I use to spot Yak Shaving before it derails my day:&lt;/p&gt;
&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;✋&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Pause and Reflect&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;Sometimes, when I realize I’m getting carried away, I’ll plan out an idea and then deliberately put it down to work on something else. This “pause” lets the idea simmer in the back of my mind, giving me a chance to evaluate whether it’s truly worth pursuing. If it still feels relevant after I’ve had some time away, then I’ll commit to it.&lt;br&gt;&lt;br&gt;Setting a timer to check in with yourself during work can also help. Every hour or so, I ask myself, &lt;i&gt;&lt;em class=&quot;italic&quot; style=&quot;white-space: pre-wrap;&quot;&gt;Am I still working on my primary objective?&lt;/em&gt;&lt;/i&gt; If not, I know it’s time to course-correct.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;📒&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Keep a “Defer Until Later” List&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;I always keep a notepad next to me. It’s become a habit that my colleagues have noticed, especially during meetings. Sometimes I’ll have a lightbulb moment (or, more than likely, just a crazy idea) and rush to jot it down before it gets “lost in the ether.”&lt;br&gt;&lt;br&gt;This habit has saved me countless times because it lets me capture those tangential ideas without letting them derail my current focus. Once they’re on the list, I can revisit them later with a clearer perspective.&lt;/div&gt;&lt;/aside&gt;&lt;aside class=&quot;callout&quot; data-color=&quot;blue&quot;&gt;&lt;span class=&quot;callout-emoji&quot; aria-hidden=&quot;true&quot;&gt;🗣️&lt;/span&gt;&lt;div class=&quot;callout-text&quot;&gt;&lt;b&gt;&lt;strong style=&quot;white-space: pre-wrap;&quot;&gt;Ask a Trusted Colleague&lt;/strong&gt;&lt;/b&gt;&lt;br&gt;Yak Shaving often happens in isolation, where there’s no one to question whether what you’re doing actually makes sense. To avoid this, I like to demonstrate where I’m up to with a piece of work early on, even if it’s just a rough draft or prototype.&lt;br&gt;&lt;br&gt;This helps me ensure I haven’t started “making up requirements” or adding unnecessary “nice-to-haves” before they’ve been recognized as valuable. A fresh perspective from a trusted colleague can help you get back on track and keep the scope realistic.&lt;/div&gt;&lt;/aside&gt;&lt;p&gt;Once you start recognizing Yak Shaving in real-time, you’ll be able to address it more effectively. Next, we’ll explore the downsides of Yak Shaving—how it disrupts flow and why it can leave you feeling frustrated.&lt;/p&gt;
&lt;h3 id=&quot;the-downsides-of-yak-shaving&quot;&gt;The Downsides of Yak Shaving&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-in-happy.DfamI-ua_2qifx4.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;For all its quirky charm, Yak Shaving can be a real productivity killer. What starts as a well-meaning attempt to solve a problem can quickly spiral into hours—or even days—spent on tasks that were never part of the plan. The consequences aren’t just about wasted time; Yak Shaving can also derail your flow, leave you frustrated, and make it hard to get back on track.&lt;/p&gt;
&lt;h4 id=&quot;it-disrupts-your-flow&quot;&gt;It Disrupts Your Flow 😵&lt;/h4&gt;
&lt;p&gt;There’s nothing quite like the feeling of being in the zone—when your mind is laser-focused, and everything seems to click. But Yak Shaving has a way of pulling you out of that state.&lt;/p&gt;
&lt;p&gt;When you shift your attention to tangential tasks, you break the mental momentum that makes flow possible. Even if the detour feels justified in the moment, it can take significant effort to return to the original problem, and the quality of your work often suffers as a result.&lt;/p&gt;
&lt;p&gt;I’ve had days where I’ve started out in a great rhythm, only to let one small distraction snowball into hours of off-track busywork. By the time I realized what was happening, the flow was gone, and my productivity had plummeted.&lt;/p&gt;
&lt;h4 id=&quot;its-emotionally-draining&quot;&gt;It’s Emotionally Draining 😩&lt;/h4&gt;
&lt;p&gt;Yak Shaving doesn’t just waste time—it can leave you feeling exhausted and demoralized. There’s something uniquely frustrating about spending hours working hard, only to realize you haven’t made meaningful progress on your original goal.&lt;/p&gt;
&lt;p&gt;For me, this often comes with a mix of guilt and regret. I think, &lt;em&gt;I could’ve spent this time solving the actual problem, but instead, I got caught up in tasks that didn’t matter.&lt;/em&gt; That kind of self-criticism can make it even harder to refocus and move forward.&lt;/p&gt;
&lt;h4 id=&quot;it-creates-a-false-sense-of-productivity&quot;&gt;It Creates a False Sense of Productivity 🏃&lt;/h4&gt;
&lt;p&gt;One of the sneakiest things about Yak Shaving is that it &lt;em&gt;feels&lt;/em&gt; productive. You’re busy, you’re solving problems, and you’re ticking items off your list—but none of it actually moves the needle.&lt;/p&gt;
&lt;p&gt;This false sense of accomplishment can be particularly dangerous because it masks the inefficiency. By the time you realize that your “progress” hasn’t brought you any closer to your goal, you’ve already lost valuable time.&lt;/p&gt;
&lt;h4 id=&quot;it-can-spiral-out-of-control&quot;&gt;It Can Spiral Out of Control 💫&lt;/h4&gt;
&lt;p&gt;Yak Shaving often follows a snowball effect. You start with one small task, which leads to another, and before you know it, you’re buried under a mountain of unrelated work. The more you invest in these tangents, the harder it becomes to pull yourself out.&lt;/p&gt;
&lt;p&gt;For example, I once set out to fix a simple bug in a web app. Along the way, I decided to update a library. That update caused some unexpected errors, so I had to dive into the documentation to troubleshoot. In the process, I discovered a related feature that “could use improvement.” By the end of the day, I hadn’t touched the original bug, and my to-do list had grown substantially 😭!&lt;/p&gt;
&lt;h3 id=&quot;the-big-picture&quot;&gt;The Big Picture&lt;/h3&gt;
&lt;p&gt;The real danger of Yak Shaving is that it distracts you from what matters most. It’s not just about the time lost—it’s about the opportunity cost. Every minute spent shaving the yak is a minute you could have spent making meaningful progress on your primary objective.&lt;/p&gt;
&lt;p&gt;That said, Yak Shaving isn’t inherently bad. Sometimes, those tangents can lead to unexpected breakthroughs or valuable insights. The key is learning when to let yourself wander and when to rein it in.&lt;/p&gt;
&lt;p&gt;Next, we’ll explore the flip side of when Yak Shaving can be beneficial and how to recognize those moments.&lt;/p&gt;
&lt;h3 id=&quot;when-yak-shaving-can-be-beneficial&quot;&gt;When Yak Shaving Can Be Beneficial&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/yak-that-has-godly-aura.BfaKWRpP_Z2guv9j.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Here’s the twist: Yak Shaving isn’t always the enemy. While it often feels like a detour, there are times when those tangents turn into productive rabbit holes that yield unexpected rewards. The trick is knowing when to embrace the Yak and when to step back.&lt;/p&gt;
&lt;p&gt;Let’s explore how Yak Shaving can sometimes work in your favour:&lt;/p&gt;
&lt;h4 id=&quot;it-can-lead-to-valuable-discoveries&quot;&gt;It Can Lead to Valuable Discoveries&lt;/h4&gt;
&lt;p&gt;One of the best things about Yak Shaving is its potential to uncover hidden opportunities. When you dive into those tangential tasks, you might stumble upon a solution, a tool, or an insight you didn’t even know you needed.&lt;/p&gt;
&lt;p&gt;For example, I once got sidetracked refactoring a piece of old code while working on a new feature. It felt like classic Yak Shaving at the time, but the cleanup ended up streamlining the entire project. Not only did it make the feature easier to implement, but it also improved the maintainability of the codebase as a whole.&lt;/p&gt;
&lt;p&gt;Sometimes, chasing down that yak means breaking through walls you didn’t even realize were there.&lt;/p&gt;
&lt;h4 id=&quot;it-encourages-learning-and-skill-development&quot;&gt;It Encourages Learning and Skill Development&lt;/h4&gt;
&lt;p&gt;Yak Shaving often involves diving deep into unfamiliar territory—exploring a new tool, troubleshooting a weird bug, or experimenting with an approach you haven’t tried before. While this might not help you finish your immediate task, it can expand your skill set and make you more effective in the long run.&lt;/p&gt;
&lt;p&gt;I’ll admit, that there have been times when I’ve gone down a Yak Shaving spiral purely out of curiosity. I’d think, &lt;em&gt;I wonder how this library actually works under the hood?&lt;/em&gt; Hours later, I’d emerge with a deeper understanding of something I didn’t plan to study that day. It wasn’t part of the original plan, but it added value nonetheless.&lt;/p&gt;
&lt;h4 id=&quot;it-can-improve-the-quality-of-your-work&quot;&gt;It Can Improve the Quality of Your Work&lt;/h4&gt;
&lt;p&gt;Sometimes, the yak you’re shaving is a symptom of something deeper—a structural issue, a process inefficiency, or an outdated practice that’s been slowing you down. Addressing these issues in the moment can save you from bigger headaches down the road.&lt;/p&gt;
&lt;p&gt;For instance, during a debugging session, I noticed a recurring pattern in how certain errors were being handled. Instead of patching the immediate issue, I created a reusable error-handling function that not only fixed the bug but also prevented similar problems in the future. What started as Yak Shaving turned into a real productivity boost.&lt;/p&gt;
&lt;h4 id=&quot;it-can-be-a-creative-outlet&quot;&gt;It Can Be a Creative Outlet&lt;/h4&gt;
&lt;p&gt;Let’s face it: some Yak Shaving detours are just plain fun. They let you tinker, explore, and try things without the pressure of sticking rigidly to the plan. While this isn’t always productive in the traditional sense, it can recharge your creative energy and help you approach your main task with fresh eyes.&lt;/p&gt;
&lt;p&gt;There’s a fine line between productive exploration and pure procrastination, but I’ve learned that allowing myself the &lt;em&gt;&lt;strong&gt;occasional indulgence&lt;/strong&gt;&lt;/em&gt; keeps me &lt;strong&gt;engaged and motivated.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;how-to-recognize-beneficial-yak-shaving&quot;&gt;How to Recognize Beneficial Yak Shaving&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/female-software-engineer-deep.3lvnf8CL_Z1mNVDT.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The key to embracing Yak Shaving when it’s helpful is to evaluate its potential impact in real-time. Here are a few guiding principles:&lt;/p&gt;
&lt;h4 id=&quot;ask-will-this-create-long-term-value&quot;&gt;Ask, “Will this create long-term value?” 🤔&lt;/h4&gt;
&lt;p&gt;If the tangent solves a recurring problem or significantly improves your workflow, it’s likely worth pursuing. For example, creating a reusable function to handle a pattern you’ve noticed might take extra time now but save you hours in the future. When a task has the potential to deliver lasting benefits, it’s more than just a distraction—it’s an investment.&lt;/p&gt;
&lt;h4 id=&quot;set-a-time-limit&quot;&gt;Set a Time Limit ⏰&lt;/h4&gt;
&lt;p&gt;Whenever I feel tempted to dive into something tangential, I give myself a fixed amount of time to explore it—usually 30 minutes to an hour. If I haven’t made meaningful progress by then, I defer the task and return to my primary objective. Timeboxing like this ensures that I don’t lose an entire day chasing a single yak.&lt;/p&gt;
&lt;h4 id=&quot;consider-the-big-picture&quot;&gt;Consider the Big Picture 🖼️&lt;/h4&gt;
&lt;p&gt;Step back and ask yourself: &lt;em&gt;Will this detour help me achieve my broader goals, or is it just satisfying my curiosity?&lt;/em&gt; If the tangent aligns with a long-term goal or addresses a persistent pain point, it might be worth the effort. But if it’s purely an intellectual distraction, it’s better to let it go and come back later, if at all.&lt;/p&gt;
&lt;p&gt;Yak Shaving isn’t inherently good or bad—it’s all about context. By recognizing when a tangent has the potential to add value, you can turn it into a tool rather than a trap.&lt;/p&gt;
&lt;p&gt;Next, we’ll dive into strategies for managing Yak Shaving so you can strike the right balance between exploration and focus.&lt;/p&gt;
&lt;h3 id=&quot;strategies-to-manage-yak-shaving&quot;&gt;Strategies to Manage Yak Shaving&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/the-funny-truth-about-why-youre-always-behind-schedule-1.BnGCHQF0_Z1diaFH.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Managing Yak Shaving isn’t about eliminating it entirely—that’s both unrealistic and potentially counterproductive. Instead, the goal is to strike a balance: staying focused on your primary task while leaving room for productive exploration when it truly adds value. Over the years, I’ve developed a few strategies that help me keep Yak Shaving under control without stifling my curiosity.&lt;/p&gt;
&lt;h4 id=&quot;practice-meta-cognitive-awareness&quot;&gt;Practice Meta-Cognitive Awareness&lt;/h4&gt;
&lt;p&gt;Meta-cognitive programming—essentially observing your own thought process in real time—has been a game-changer for me. When I notice myself drifting away from my primary task, I pause and ask: &lt;em&gt;Is this helping me accomplish my goal, or am I chasing a yak?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This self-awareness doesn’t come naturally; it’s a skill I’ve had to develop. At first, I only realized I was shaving the yak after hours had already been lost. But over time, these check-ins became second nature, and now I can catch myself before I veer too far off track.&lt;/p&gt;
&lt;h4 id=&quot;keep-a-notepad-handy&quot;&gt;Keep a Notepad Handy&lt;/h4&gt;
&lt;p&gt;I always have a notepad next to me, especially during meetings. When an idea strikes—whether it’s a lightbulb moment or a completely off-the-wall tangent—I jot it down immediately. My colleagues have seen this happen often: I’ll suddenly grab my pen and scribble something down, knowing full well that if I don’t capture it, it might disappear into the ether.&lt;/p&gt;
&lt;p&gt;This simple habit allows me to acknowledge those ideas without letting them interrupt my current focus. Once they’re written down, they’re safe, and I can revisit them later with a clearer perspective.&lt;/p&gt;
&lt;h4 id=&quot;set-clear-priorities-and-boundaries&quot;&gt;Set Clear Priorities and Boundaries&lt;/h4&gt;
&lt;p&gt;One of the most effective ways to avoid Yak Shaving is to start with a clear plan for what you want to achieve. I try to define my primary objective at the beginning of each session and write it down somewhere visible—on a sticky note or at the top of my to-do list.&lt;/p&gt;
&lt;p&gt;When I feel the pull of a tangent, I remind myself of the goal I set and ask, &lt;em&gt;Does this serve the primary objective?&lt;/em&gt; If not, it goes on the “defer until later” list. By setting these boundaries, I’m better able to stay on track without feeling like I’m stifling my creativity.&lt;/p&gt;
&lt;h4 id=&quot;demonstrate-early-and-often&quot;&gt;Demonstrate Early and Often&lt;/h4&gt;
&lt;p&gt;When working on a project, I make it a point to share my progress with a trusted colleague early on, even if it’s still rough. This helps me validate that I’m on the right track and, more importantly, ensures I haven’t started “making up requirements” or adding unnecessary extras.&lt;/p&gt;
&lt;p&gt;I’ve found that this kind of feedback loop keeps me grounded. Instead of spending hours perfecting something that might not even be needed, I get clarity on what’s valuable and what’s not. Plus, it’s a great way to catch any potential Yak Shaving before it spirals out of control.&lt;/p&gt;
&lt;h4 id=&quot;timebox-exploration&quot;&gt;Timebox Exploration&lt;/h4&gt;
&lt;p&gt;Exploration is important, but it needs limits. Whenever I feel compelled to chase down a yak, I give myself a set amount of time—usually 30 minutes to an hour. If the tangent proves fruitful within that window, great. If not, I defer it to a later time.&lt;/p&gt;
&lt;p&gt;This approach satisfies my curiosity without letting it consume the day. It also forces me to focus on results: if the tangent isn’t yielding clear benefits quickly, it’s probably not worth pursuing right now.&lt;/p&gt;
&lt;h4 id=&quot;keep-your-eye-on-the-big-picture&quot;&gt;Keep Your Eye on the Big Picture&lt;/h4&gt;
&lt;p&gt;At the end of the day, Yak Shaving becomes a problem when it distracts you from your broader goals. I’ve learned to step back periodically and ask, &lt;em&gt;Am I making progress toward what really matters, or am I just busy?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;By maintaining this perspective, I can better evaluate whether a task is worth pursuing or whether it’s time to let the yak roam free.&lt;/p&gt;
&lt;h4 id=&quot;the-balance-between-focus-and-curiosity&quot;&gt;The Balance Between Focus and Curiosity&lt;/h4&gt;
&lt;p&gt;Managing Yak Shaving isn’t about rigidly sticking to your plan at all costs. Some of the best ideas and breakthroughs come from unexpected detours. The key is knowing when to indulge those moments and when to rein them in.&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-shaking-yak.CyOzJ3sC_ZyQCUl.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Yak Shaving is a concept that I’ve come to both dread and appreciate. It’s like that friend who always shows up unannounced: sometimes they bring chaos, but other times they spark a brilliant idea. Over the years, I’ve learned to navigate these moments more mindfully, and in doing so, I’ve found ways to embrace the occasional detour without losing sight of the bigger picture.&lt;/p&gt;
&lt;p&gt;I’ll admit—there was a time when Yak Shaving dominated my days. I’d start with a simple goal, like fixing a bug, and end up debugging someone else’s library or researching the history of a completely unrelated feature. It was frustrating because, while I felt busy, I didn’t feel productive. That’s when I started leaning into meta-cognitive programming, asking myself hard questions about whether what I was doing truly mattered.&lt;/p&gt;
&lt;p&gt;But here’s the thing: Yak Shaving isn’t always bad. Some of my best work has come from unexpected detours. I’ve learned new tools, uncovered hidden bugs, and even reimagined workflows because I let myself follow a tangent. The trick, I’ve found, is being intentional about when to let it happen. If a tangent aligns with a broader goal or addresses a recurring issue, it’s worth the effort. If not, it’s time to write it down, defer it, and move on.&lt;/p&gt;
&lt;p&gt;Another lesson I’ve learned is the importance of collaboration. Sharing early drafts or discussing progress with a trusted colleague has saved me countless times from going down unnecessary rabbit holes. It’s a way to keep myself honest and ensure that I’m solving the right problems rather than inventing new ones. Plus, those discussions often spark fresh ideas that make the work even better.&lt;/p&gt;
&lt;p&gt;At the end of the day, Yak Shaving is part of the creative process. It’s messy, it’s unpredictable, and yes, it can be maddening. But it’s also human. We’re wired to explore, to tinker, to fix things that don’t seem quite right. The goal isn’t to eliminate Yak Shaving but to approach it with mindfulness and humor.&lt;/p&gt;
&lt;p&gt;So the next time you catch yourself chasing a yak, take a moment to step back. Ask yourself if it’s truly worth pursuing. And if it is, embrace the chaos—but do it with intention. After all, sometimes the most unexpected paths lead to the best destinations.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://en.wiktionary.org/wiki/yak_shaving?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;yak shaving - Wiktionary, the free dictionary&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;Wiktionary&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://projects.csail.mit.edu/gsb/old-archive/gsb-archive/gsb2000-02-11.html?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;Yak Shaving&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;projects.csail.mit.edu&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://www.hanselman.com/blog/yak-shaving-defined-ill-get-that-done-as-soon-as-i-shave-this-yak?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;Yak Shaving Defined - I’ll get that done, as soon as I shave this yak.&lt;/span&gt;&lt;span class=&quot;bookmark-description&quot;&gt;I’ve used the term Yak Shaving for years. You’re probably shaving yaks at work…&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;Scott Hanselman&apos;s Blog&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Productivity</category><category>Yak Shaving</category><category>Software Engineering</category><category>Software Development</category><category>Efficiency</category></item><item><title>Why Every Developer Should Read Alex Xu&apos;s Guide to System Design</title><link>https://www.mrstebo.co.uk/why-every-developer-should-read-alex-xus-guide-to-system-design/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/why-every-developer-should-read-alex-xus-guide-to-system-design/</guid><description>A few years ago, my daily work revolved around writing clean, functional code and occasionally dipping into discussions about deployment pipelines or minor infrastructure tweaks. It was a comfortable, predictable routine. But as my career…</description><pubDate>Mon, 09 Dec 2024 06:00:02 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/why-every-developer-should-read-alex-xus-guide-to-system-design.Xa-FILh-_ZVeV7D.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;A few years ago, my daily work revolved around writing clean, functional code and occasionally dipping into discussions about deployment pipelines or minor infrastructure tweaks. It was a comfortable, predictable routine. But as my career advanced and the platforms I worked on began to grow in complexity and scale, I found myself at a crossroads. Suddenly, I wasn’t just thinking about how a feature would work—I had to think about how it would work for thousands, even millions, of users. Questions about scalability, fault tolerance, and distributed systems became part of my daily vocabulary. And honestly, it was overwhelming at first.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/why-every-developer-should-read-alex-xus-guide-to-system-design-1.D2O5smvI_1iuhmz.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;900&quot;&gt;&lt;/p&gt;
&lt;p&gt;That’s when I stumbled upon Alex Xu’s &lt;a href=&quot;https://amzn.to/41m1pXQ?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;em&gt;System Design Interview – An Insider&amp;#39;s Guide&lt;/em&gt;&lt;/a&gt;. This book felt like a flashlight in a dark cave, illuminating paths I didn’t even know existed. It offered clarity on concepts I had only vaguely encountered in the past, from building resilient systems to managing large-scale data workflows. More importantly, it filled in the gaps I didn’t know I had, particularly around understanding cloud infrastructure and the trade-offs involved in designing for scale.&lt;/p&gt;
&lt;p&gt;For developers making the leap from writing code to thinking about architecture, Xu’s book is a goldmine. It bridges the gap between the &amp;quot;here&amp;#39;s how to write it&amp;quot; mindset of coding and the &amp;quot;here&amp;#39;s how to make it scalable, reliable, and performant&amp;quot; mindset of system design. As I work to optimize the platform at my current job—preparing it to handle the demands of larger organizations—I’ve found myself returning to the book again and again for insights and inspiration.&lt;/p&gt;
&lt;p&gt;In this post, I’ll share some of the key lessons from the book, along with the “oh yeah” moments I experienced as I read through it. If you’ve ever wondered how Google Maps tiles its maps, how booking systems stay resilient under load, or why message queues aren’t one-size-fits-all, this is for you.&lt;/p&gt;
&lt;h2 id=&quot;why-system-design-matters-for-developers&quot;&gt;Why System Design Matters for Developers&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer.5XH9WqZ4_ZwL19m.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;As developers, we’re often focused on solving immediate problems—writing features, squashing bugs, and ensuring the codebase is healthy. But as I’ve learned in my role as Head of Engineering at &lt;a href=&quot;https://carefriends.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;CareFriends&lt;/a&gt;, when you start thinking about systems holistically, it’s a whole new ball game. Scaling an application isn’t just about adding more resources; it’s about designing systems that can gracefully handle growth, remain resilient under pressure, and adapt to evolving requirements.&lt;/p&gt;
&lt;p&gt;This transition from coder to system thinker isn’t just a shift in mindset—it’s a fundamental change in the types of challenges you face. And it’s one that many developers, myself included, find both exciting and daunting. That’s why resources like this book are invaluable. They help bridge the knowledge gap and provide a solid foundation for tackling architectural problems, even if you haven’t yet had the chance to build a massive-scale system yourself.&lt;/p&gt;
&lt;p&gt;For me, this hasn’t just been a personal learning tool; it’s also become a key resource as I prepare to grow my team at CareFriends and guide them through the challenges of scaling. As we continue to onboard larger clients, the need to ensure our platform scales efficiently without compromising on performance or reliability has become more pressing. This means not just understanding system design concepts myself but also thinking about how to instill these principles in a team as it forms and grows.&lt;/p&gt;
&lt;p&gt;One of the challenges I anticipate in this process is helping future team members move beyond, “How do I implement this feature?” to, “How do I ensure this feature works at scale?” The scenarios and principles in the book have been instrumental in shaping the kinds of problems and questions I want to communicate as part of this transition. It’s helped me think critically about how to approach fault tolerance in our scheduling systems, design message queues that can handle spikes in activity, and ensure our systems can remain robust as demand grows.&lt;/p&gt;
&lt;p&gt;System design isn’t just for architects or cloud specialists—it’s for anyone who wants to build software that lasts. As a leader preparing for growth, my goal isn’t just to design systems but to foster a mindset where my future team thinks systemically, anticipates edge cases, and weighs the trade-offs of their decisions. This resource has been a game-changer in helping me lay that foundation.&lt;/p&gt;
&lt;p&gt;In the next section, I’ll dive into a few specific lessons that stood out to me, including the fascinating mechanics of map tiling at Google scale, designing resilient booking systems, and why choosing the right message queue can make or break your architecture. These lessons don’t just live in the theoretical—they’ve already started influencing how I approach challenges in my role.&lt;/p&gt;
&lt;h2 id=&quot;key-lessons-and-oh-yeah-moments&quot;&gt;Key Lessons and &amp;quot;Oh Yeah&amp;quot; Moments&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-2.BrMKO3Te_QvQ7V.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;As I worked through the book, I found myself having several “oh yeah” moments—those satisfying flashes of recognition where abstract concepts suddenly clicked into place. These lessons felt particularly relevant as I focus on preparing CareFriends to scale for larger organizations. While the book covers a wide range of system design topics, three examples stood out to me for their practical relevance and depth: map tiling, resilient booking systems, and message queue architectures. Each of these lessons highlighted critical design principles that I’m now applying—or planning to apply—as part of our platform’s evolution.&lt;/p&gt;
&lt;h3 id=&quot;map-tiling-at-google-scale&quot;&gt;Map Tiling at Google Scale&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/surface-of-earth.C_hW2qm9_Z1vcBXa.jpg&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;1024&quot;&gt;&lt;/p&gt;
&lt;p&gt;Understanding how Google Maps serves billions of tiles to users across the globe was an eye-opening experience. The concept itself—dividing maps into tiles for efficient rendering—sounds straightforward at first. But when you consider the scale at which Google operates, with millions of simultaneous users, the complexity becomes staggering.&lt;/p&gt;
&lt;p&gt;The key takeaway for me wasn’t just about the mechanics of tiling; it was about the broader principles of partitioning and caching. By breaking a massive problem into manageable chunks (in this case, tiles) and intelligently caching commonly accessed data, Google ensures both performance and reliability.&lt;/p&gt;
&lt;p&gt;For CareFriends, while we don’t deal with map tiling, the principles of efficient partitioning and caching resonate deeply. As we look to scale our scheduling and engagement features, the challenge is similar: how do we divide and distribute workloads so that no single component becomes a bottleneck? This lesson reinforced the importance of designing for locality and caching frequently accessed data closer to the user, which can dramatically improve performance under heavy load.&lt;/p&gt;
&lt;h3 id=&quot;building-resilient-architectures-for-booking-systems&quot;&gt;Building Resilient Architectures for Booking Systems&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/circuit-breaker.CEJehlsm_NRfrN.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Another standout moment was the section on booking systems, which revealed how high-demand applications like airline or hotel booking platforms stay resilient under load. The architecture behind these systems needs to balance consistency, availability, and fault tolerance, often requiring trade-offs depending on business needs.&lt;/p&gt;
&lt;p&gt;What struck me was the use of strategies like &lt;strong&gt;retry mechanisms&lt;/strong&gt;, &lt;strong&gt;circuit breakers&lt;/strong&gt;, and &lt;strong&gt;eventual consistency&lt;/strong&gt;. These approaches ensure that even if part of the system fails—whether due to network issues, database overload, or sudden traffic spikes—users experience minimal disruption.&lt;/p&gt;
&lt;p&gt;This example got me thinking about our scheduling and notification services at CareFriends. While not a direct parallel, the principles of retry logic and graceful degradation are crucial as we scale. For example, if a notification fails to send on the first attempt, a retry mechanism could automatically handle it without requiring manual intervention. Similarly, incorporating circuit breakers could help prevent cascading failures in our system when certain components are under strain.&lt;/p&gt;
&lt;h3 id=&quot;picking-the-right-message-queue&quot;&gt;Picking the Right Message Queue&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/line-of-people-passing.Cs2HQKFO_ZezEwq.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The section on message queues was another lightbulb moment. The book breaks down the different types of queues—point-to-point (e.g., RabbitMQ), pub-sub (e.g., Kafka), and managed services (e.g., AWS SQS)—and explains how each one excels under specific conditions.&lt;/p&gt;
&lt;p&gt;What I found particularly useful was the discussion of trade-offs. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;RabbitMQ&lt;/strong&gt; offers fine-grained control but requires more maintenance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kafka&lt;/strong&gt; shines with high-throughput use cases but introduces complexity with its setup and partitioning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS SQS&lt;/strong&gt; provides simplicity and scalability but lacks the same level of customization as self-managed options.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For CareFriends, this lesson hit home as I think about how we handle asynchronous processes like sending out rewards or processing user activity data. While we’ve been using simpler solutions to date, scaling might require rethinking our approach to message handling. This insight has given me a clearer framework for evaluating our options and choosing the right queue for specific scenarios, balancing throughput, latency, and reliability as our needs evolve.&lt;/p&gt;
&lt;p&gt;These lessons reminded me that scaling isn’t about brute force or throwing resources at a problem—it’s about designing smarter, more resilient systems. Each of these examples ties directly to challenges I’ve encountered or anticipate facing as CareFriends grows. More importantly, they’ve helped me think through the trade-offs and considerations that come with designing for scale.&lt;/p&gt;
&lt;h2 id=&quot;applying-system-design-principles-to-real-world-challenges&quot;&gt;Applying System Design Principles to Real-World Challenges&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/complex-system.WjECsyJb_1XUgy9.jpg&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;1024&quot;&gt;&lt;/p&gt;
&lt;p&gt;One of the most valuable aspects of diving into system design is how it changes your perspective. It pushes you to think beyond immediate solutions and instead consider how systems behave under stress, at scale, or in failure scenarios. While the book presents its lessons in a structured, interview-focused format, the underlying principles apply to a broad range of real-world challenges. Here are a few overarching themes that I’ve found especially impactful:&lt;/p&gt;
&lt;h3 id=&quot;designing-for-failure-is-non-negotiable&quot;&gt;Designing for Failure Is Non-Negotiable&lt;/h3&gt;
&lt;p&gt;One of the recurring themes in the book is the importance of building systems that can fail gracefully. No system is perfect—hardware fails, networks get congested, and unexpected spikes happen. What matters is how the system responds.&lt;/p&gt;
&lt;p&gt;Strategies like redundancy, failover mechanisms, and retry logic aren’t just theoretical exercises; they’re essential. For example, introducing &lt;strong&gt;circuit breakers&lt;/strong&gt; can prevent one failing component from cascading into a full system outage. Similarly, leveraging &lt;strong&gt;distributed architectures&lt;/strong&gt; ensures that workloads can shift dynamically if a single node goes offline.&lt;/p&gt;
&lt;p&gt;Thinking this way has reshaped how I approach system design. It’s not just about ensuring everything works when conditions are ideal—it’s about ensuring the system can survive when they’re not.&lt;/p&gt;
&lt;h3 id=&quot;trade-offs-are-everywhere&quot;&gt;Trade-Offs Are Everywhere&lt;/h3&gt;
&lt;p&gt;Another key takeaway is that every system design decision involves trade-offs. Whether it’s between consistency and availability in a distributed database, or latency versus throughput in a messaging system, understanding these trade-offs is crucial for making informed choices.&lt;/p&gt;
&lt;p&gt;For instance, when designing APIs, should you prioritize a fast, synchronous response for the user, or opt for asynchronous processing to improve scalability? Neither answer is universally right; it depends on your use case, business needs, and constraints.&lt;/p&gt;
&lt;p&gt;This idea of deliberate trade-offs has been one of the most useful frameworks I’ve learned. It’s a reminder that every design choice should be grounded in clear goals and an understanding of what you’re optimizing for—and what you’re willing to sacrifice.&lt;/p&gt;
&lt;h3 id=&quot;simplicity-often-wins&quot;&gt;Simplicity Often Wins&lt;/h3&gt;
&lt;p&gt;It’s easy to get caught up in complex architectures and cutting-edge technologies, but the book emphasizes that simplicity often leads to more robust systems. The simpler the system, the fewer moving parts there are to break.&lt;/p&gt;
&lt;p&gt;This doesn’t mean avoiding complexity at all costs—some problems demand sophisticated solutions—but it does mean questioning whether a given design is as simple as it can be while still meeting requirements. I’ve found this principle invaluable when evaluating solutions, particularly for deciding whether to build in-house or adopt a managed service.&lt;/p&gt;
&lt;h3 id=&quot;scalability-starts-with-efficient-workloads&quot;&gt;Scalability Starts with Efficient Workloads&lt;/h3&gt;
&lt;p&gt;Scaling isn’t just about adding more servers or increasing database capacity. It’s about optimizing how workloads are distributed and processed. The book’s lessons on partitioning and sharding, as well as its emphasis on caching, highlight how crucial it is to design systems that minimize bottlenecks from the start.&lt;/p&gt;
&lt;p&gt;This might involve splitting a database into smaller, independent partitions to handle high write volumes or using a content delivery network (CDN) to serve static assets closer to users. Whatever the method, the goal is the same: reduce contention, improve efficiency, and ensure smooth growth.&lt;/p&gt;
&lt;h2 id=&quot;laying-the-foundation-for-the-future&quot;&gt;Laying the Foundation for the Future&lt;/h2&gt;
&lt;p&gt;These principles aren’t just theoretical—they’re practical tools for building systems that can handle real-world demands. Whether you’re working on a small application today or preparing for massive growth tomorrow, understanding these ideas equips you to design smarter, more resilient systems.&lt;/p&gt;
&lt;p&gt;In my own experience, the most valuable lesson has been recognizing that system design isn’t about perfection—it’s about continuous improvement. By anticipating failure, embracing trade-offs, and simplifying where possible, you can build systems that not only work but thrive under pressure.&lt;/p&gt;
&lt;p&gt;Next, I’ll share some thoughts on how developers can start applying these principles, even if they’re new to system design, and some tips for bridging the gap between theory and practice.&lt;/p&gt;
&lt;h2 id=&quot;from-theory-to-practice&quot;&gt;From Theory to Practice&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/man-entering-building.BcsSUFEA_Z1pDxMC.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Understanding system design concepts is one thing—applying them effectively is another. For many developers, the challenge lies not in grasping the ideas but in translating them into actionable decisions in real-world projects. It’s a shift that requires both a mindset change and a willingness to experiment. Here’s how I’ve been working to bridge that gap, along with some tips for anyone starting on this journey.&lt;/p&gt;
&lt;h3 id=&quot;start-small-and-build-incrementally&quot;&gt;Start Small and Build Incrementally&lt;/h3&gt;
&lt;p&gt;One of the most practical ways to apply system design principles is to start small. You don’t need to redesign your entire system in one go. Instead, identify areas where a small improvement could make a big difference.&lt;/p&gt;
&lt;p&gt;For example, if you’re struggling with slow response times, look into introducing caching for frequently accessed data. Or, if you’re worried about reliability, experiment with adding retry logic or basic failover mechanisms. These incremental changes not only improve your system but also help you build confidence in applying system design concepts.&lt;/p&gt;
&lt;h3 id=&quot;leverage-cloud-platforms-and-managed-services&quot;&gt;Leverage Cloud Platforms and Managed Services&lt;/h3&gt;
&lt;p&gt;Modern cloud platforms like AWS, Azure, and GCP make it easier than ever to experiment with system design. Many of the complex building blocks—load balancers, message queues, distributed databases—are available as managed services.&lt;/p&gt;
&lt;p&gt;For example, if you’re exploring message queues, tools like Amazon SQS or Google Pub/Sub let you get hands-on experience without the overhead of setting up and maintaining the infrastructure yourself. Using these tools gives you a deeper understanding of how different systems work and what trade-offs they involve, all while keeping the focus on solving your specific problems.&lt;/p&gt;
&lt;h3 id=&quot;embrace-failure-as-a-learning-opportunity&quot;&gt;Embrace Failure as a Learning Opportunity&lt;/h3&gt;
&lt;p&gt;One of the most valuable lessons I’ve learned is that failure isn’t just inevitable—it’s instructive. When a system doesn’t behave as expected, it’s an opportunity to uncover gaps in your design and improve.&lt;/p&gt;
&lt;p&gt;A practical way to embrace this is by simulating failure. Chaos engineering tools like Chaos Monkey can help you intentionally break parts of your system to see how it handles unexpected disruptions. Even on a smaller scale, introducing controlled failure—like throttling database requests or killing a service—can reveal weaknesses and help you build more resilient systems.&lt;/p&gt;
&lt;h3 id=&quot;collaborate-and-discuss-design-decisions&quot;&gt;Collaborate and Discuss Design Decisions&lt;/h3&gt;
&lt;p&gt;System design is rarely a solo activity. The best designs often emerge from collaboration and discussion. Whether it’s brainstorming with colleagues, participating in design reviews, or even practicing mock interviews, sharing ideas and getting feedback sharpens your thinking.&lt;/p&gt;
&lt;p&gt;If you’re working solo or in a small team, online communities can be a great resource. Platforms like GitHub, forums, or even Slack groups focused on system design provide opportunities to learn from others’ experiences and get feedback on your ideas.&lt;/p&gt;
&lt;h3 id=&quot;dont-be-afraid-to-iterate&quot;&gt;Don’t Be Afraid to Iterate&lt;/h3&gt;
&lt;p&gt;It’s tempting to aim for the “perfect” system design, but in reality, perfection doesn’t exist. Systems evolve as requirements change, and what works today might not work tomorrow. The key is to design with flexibility in mind, iterating as you go.&lt;/p&gt;
&lt;p&gt;For example, if you’re unsure about which database to use, start with a general-purpose option and monitor its performance as your system grows. As you learn more about your specific workload, you can make more informed decisions about whether to stick with it or migrate to a specialized solution. Iteration ensures that your system adapts as new challenges arise.&lt;/p&gt;
&lt;h3 id=&quot;make-learning-an-ongoing-habit&quot;&gt;Make Learning an Ongoing Habit&lt;/h3&gt;
&lt;p&gt;Finally, treat system design as a skill you’re continually refining. Books, blogs, courses, and open-source projects are all great resources, but nothing beats hands-on experience. The more you experiment and apply these principles, the more confident you’ll become.&lt;/p&gt;
&lt;p&gt;If you’re just starting, consider tackling small side projects that mimic real-world problems. Build a simple notification system with retry logic, or create a basic event-driven architecture using a message queue. These exercises give you practical experience and help solidify the concepts in your mind.&lt;/p&gt;
&lt;p&gt;Bridging the gap between theory and practice takes time, but every step you take adds to your confidence and understanding. By starting small, leveraging modern tools, and learning from both successes and failures, you can steadily build the skills to design systems that scale and thrive.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/different-systems.n9uWq8qw_2an3yY.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;System design is a journey, not a destination. It’s one of those fields where the more you learn, the more you realize how much there is left to explore. But that’s also what makes it so rewarding. Every concept mastered, every problem solved, and every system improved adds to your confidence and capability—not just as a developer but as someone who can think strategically about how technology serves a greater purpose.&lt;/p&gt;
&lt;p&gt;What I’ve found most exciting about diving deeper into system design is how it reshapes the way you see challenges. Problems that once felt daunting, like scaling an application or designing for reliability, become opportunities to apply creative solutions. The more you immerse yourself in the principles and trade-offs, the more you begin to appreciate the elegance of a well-designed system.&lt;/p&gt;
&lt;p&gt;If there’s one piece of advice I’d offer to anyone starting this journey, it’s to stay curious. Experiment with the concepts, apply them wherever you can, and don’t shy away from asking questions or making mistakes. System design isn’t about knowing all the answers upfront—it’s about understanding the problem space deeply enough to make informed decisions and adapt as you learn.&lt;/p&gt;
&lt;p&gt;For developers transitioning into roles where system design plays a bigger part, resources like Alex Xu’s guide, hands-on experimentation with cloud platforms, and real-world problem-solving are invaluable. But above all, it’s the mindset that matters most: being willing to think holistically, anticipate failure, and iterate relentlessly.&lt;/p&gt;
&lt;p&gt;The journey to mastering system design might be challenging, but it’s one of the most fulfilling paths in tech. It’s not just about building systems that scale—it’s about building systems that last. And in doing so, you’re not just solving problems; you’re creating foundations for the future.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>System Design</category><category>Interviewing</category><category>Smart Thinking</category><category>Software Architecture</category><category>Software Development</category><category>Software Engineering</category><category>Cloud Services</category><category>Message Queues</category><category>Kafka</category></item><item><title>Adversity to Innovation - The Three-Body Problem</title><link>https://www.mrstebo.co.uk/adversity-to-innovation-the-three-body-problem/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/adversity-to-innovation-the-three-body-problem/</guid><description>Diving into The Three-Body Problem series by Cixin Liu opened my eyes to a riveting narrative oscillating between speculative fiction and stark realism. At its heart, the series isn&apos;t just a tale of extraterrestrial contact; it&apos;s a…</description><pubDate>Mon, 08 Apr 2024 05:00:02 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/adversity-to-innovation-the-three-body-problem.B_N0wqID_Z2wAkDu.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Diving into &lt;a href=&quot;https://www.amazon.co.uk/Three-Body-Problem-Boxset-Cixin-Liu/dp/1035905876/?tag=mrstebo-21&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;The Three-Body Problem&lt;/a&gt; series by &lt;a href=&quot;https://cixinliu.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Cixin Liu&lt;/a&gt; opened my eyes to a riveting narrative oscillating between speculative fiction and stark realism. At its heart, the series isn&amp;#39;t just a tale of extraterrestrial contact; it&amp;#39;s a profound commentary on human resilience and innovation in the face of existential threats. This theme struck a chord with me, particularly the idea that our most significant technological leaps often emerge from our darkest times. It&amp;#39;s a paradox that history illustrates repeatedly: adversity, especially during wars, accelerates innovation.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/adversity-to-innovation-the-three-body-problem-1.CpMFzLd5_MPBoO.jpg&quot; alt=&quot;&quot; width=&quot;977&quot; height=&quot;1500&quot;&gt;&lt;/p&gt;
&lt;p&gt;Reflecting on this, I can&amp;#39;t help but draw parallels to our current technological landscape. Just as the characters in Liu&amp;#39;s series navigate their crises with ingenuity, so have we, historically, turned our own crises into opportunities for advancement. Yet, there&amp;#39;s a lesson here that extends beyond the battlefield or the silent wars waged in cyberspace. It&amp;#39;s about the human capacity to innovate under pressure and how, perhaps, we can channel this capability towards overcoming today&amp;#39;s challenges without the spectre of conflict hanging over us.&lt;/p&gt;
&lt;p&gt;Today, I aim to explore the intricate dance between adversity and technological progress, drawing from historical examples and my own reflections. While Liu&amp;#39;s work provides a fictional backdrop, the real-world implications of this dynamic are both immediate and profound. Let&amp;#39;s delve into how, even in times of peace, we might harness the innovative spirit that has historically emerged from our most challenging moments.&lt;/p&gt;
&lt;h2 id=&quot;a-global-and-historical-perspective&quot;&gt;A Global and Historical Perspective&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/design-for-da-vinci.BUVPVJ00_lQPw7.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;History shows that adversity often leads to significant technological advancements. This pattern is evident across different cultures and periods, not confined to any specific region or era.&lt;/p&gt;
&lt;p&gt;In ancient China, the invention of gunpowder was initially for &lt;a href=&quot;https://www.thevintagenews.com/2019/05/08/gunpowder/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;medicinal purposes&lt;/a&gt; but eventually revolutionized warfare worldwide. This early innovation demonstrates how solutions for one problem can unexpectedly transform other aspects of society.&lt;/p&gt;
&lt;p&gt;During the Islamic Golden Age, advancements in mathematics and physics, such as &lt;a href=&quot;https://www.britannica.com/biography/al-Khwarizmi?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Al-Khwarizmi&lt;/a&gt;&amp;#39;s introduction of algorithms and &lt;a href=&quot;https://www.britannica.com/biography/Ibn-al-Haytham?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Ibn al-Haytham&lt;/a&gt;&amp;#39;s studies in optics, laid foundational stones for modern sciences and technologies. Their work, driven by the era&amp;#39;s intellectual curiosity, contributed significantly to fields beyond their immediate applications.&lt;/p&gt;
&lt;p&gt;The Renaissance, marked by exploration and the rediscovery of classical knowledge, also saw technological leaps. &lt;a href=&quot;https://www.britannica.com/biography/Leonardo-da-Vinci?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Leonardo da Vinci&lt;/a&gt;&amp;#39;s conceptual inventions, including designs for flying machines and armoured vehicles, showcase the era&amp;#39;s blend of creativity and practical problem-solving, even if many of his ideas were ahead of their time.&lt;/p&gt;
&lt;p&gt;The World Wars, particularly the second, are stark examples of how conflict can accelerate innovation. The development and widespread use of penicillin and advances in surgical techniques saved countless lives, demonstrating how urgent needs can push forward medical technology rapidly. Similarly, &lt;a href=&quot;https://www.britannica.com/biography/Alan-Turing?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Alan Turing&lt;/a&gt;’s contributions to computing during World War II not only helped in the war effort but also set the stage for the digital revolution.&lt;/p&gt;
&lt;p&gt;From the agricultural innovations of the Maya and Inca civilizations, which allowed for the support of large populations in challenging environments, to the sophisticated &lt;a href=&quot;https://hess.copernicus.org/preprints/hess-2021-173/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;water management systems&lt;/a&gt; of the Islamic Golden Age, these adaptations to environmental challenges highlight human ingenuity in overcoming obstacles to survival and improving life.&lt;/p&gt;
&lt;p&gt;This survey of human innovation in response to adversity underscores a common thread: challenges, whether from environmental pressures or the urgencies of conflict, have historically spurred progress. These examples from across cultures and ages reflect a consistent drive to find solutions, improve conditions, and push the boundaries of what is possible.&lt;/p&gt;
&lt;h2 id=&quot;weaponry-and-defense&quot;&gt;Weaponry and Defense&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/chinese-battlefield.Cjq6-igg_SWLgl.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Technological innovation, particularly in weaponry and defence, embodies a paradox: the same ingenuity that gives rise to protection mechanisms can also fuel the development of more efficient means of aggression. This dual-edged nature is a theme as ancient as the invention of gunpowder in China.&lt;/p&gt;
&lt;p&gt;Initially discovered by alchemists searching for the elixir of life, gunpowder&amp;#39;s potential for weaponry soon became apparent. Its introduction revolutionized military strategy and combat, setting the stage for centuries of warfare evolution. This example underscores a recurring pattern in technological advancement: innovations arising from benign intentions can, and often do, find applications in conflict.&lt;/p&gt;
&lt;p&gt;In more recent history, the development of nuclear technology during the 20th century further exemplifies this paradox. The pursuit of atomic energy for both civilian and military purposes has left an indelible mark on the world, demonstrating the immense power and peril of human innovation. While nuclear energy presents a significant source of clean power, the spectre of nuclear weaponry continues to pose one of the greatest threats to global security.&lt;/p&gt;
&lt;p&gt;The realm of cybersecurity offers a contemporary perspective on this theme. The internet, conceived initially as a tool for communication and knowledge sharing, has become a battleground for state and non-state actors seeking to assert power or disrupt the social order. Cybersecurity measures, constantly evolving to defend against these threats, highlight the ongoing race between protective and offensive technologies.&lt;/p&gt;
&lt;p&gt;This duality is not without its lessons. The development of defensive technologies such as armour, whether in ancient times or modern bulletproof vests, shows a continuous effort to protect life and property. Similarly, advancements in medical technology during conflicts aimed at saving lives illustrate humanity&amp;#39;s capacity to find hope and progress amid adversity.&lt;/p&gt;
&lt;p&gt;The challenge, then, is to navigate this paradoxical landscape to minimize harm while maximizing the benefits of our technological capabilities. The history of gunpowder, from its origins to its role in warfare, serves as a reminder of the responsibility accompanying innovation. As we develop new technologies, considering their potential impacts on defence and offence becomes increasingly critical.&lt;/p&gt;
&lt;h2 id=&quot;the-invisible-war&quot;&gt;The Invisible War&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/hackers-in-underground.nVUYt4rA_Z2aEePb.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In the contemporary landscape, the battleground has extended far beyond the physical realms of land, sea, and air, venturing into the vast and nebulous territory of cyberspace. This new frontier of warfare and espionage is characterized not by the clash of armies but by the silent skirmishes of data breaches, espionage, and the manipulation of digital infrastructures. It&amp;#39;s a realm where information is both a weapon and a prize and where the keystrokes of a skilled hacker can have as much impact as the bullets of a soldier.&lt;/p&gt;
&lt;p&gt;This shift towards digital dominance represents a profound transformation in how conflicts are waged, and security is maintained. From the strategic deployment of cyberweapons to the construction of vast surveillance networks, the tools and tactics of digital warfare are evolving at an unprecedented pace, often outstripping the legal and ethical frameworks that govern them.&lt;/p&gt;
&lt;h3 id=&quot;the-enigma-machine-and-cryptographys-double-edged-sword&quot;&gt;The Enigma Machine and Cryptography&amp;#39;s Double-Edged Sword&lt;/h3&gt;
&lt;p&gt;The breaking of the &lt;a href=&quot;https://www.iwm.org.uk/history/how-alan-turing-cracked-the-enigma-code?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Enigma code&lt;/a&gt; by Alan Turing and his team during World War II is a landmark in the history of cryptography. Positively, it significantly shortened the war, saving countless lives by enabling the Allies to intercept and decipher Axis communications. This breakthrough in cryptography also laid the groundwork for modern computing and information security, fields that underpin the digital economy and protect sensitive data worldwide.&lt;/p&gt;
&lt;p&gt;However, the Enigma episode also illustrates the perpetual arms race in encryption and decryption, a precursor to today&amp;#39;s cybersecurity battles. It raises enduring questions about privacy and the extent to which governments and other entities should be able to intercept communications for national security purposes. This theme resonates with the global surveillance networks described in The Three-Body Problem.&lt;/p&gt;
&lt;h3 id=&quot;edward-snowden-and-the-surveillance-state&quot;&gt;Edward Snowden and the Surveillance State&lt;/h3&gt;
&lt;p&gt;The revelations by &lt;a href=&quot;https://www.amazon.co.uk/Permanent-Record-Edward-Snowden-ebook/dp/B07VWQCK4K?tag=mrstebo-21&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Edward Snowden&lt;/a&gt; had the positive effect of igniting a global debate on privacy, surveillance, and the balance between national security and individual liberties. They spurred reforms in surveillance practices and policies in various countries, promoting greater transparency and oversight of intelligence activities.&lt;/p&gt;
&lt;p&gt;On the downside, Snowden&amp;#39;s disclosures also revealed how technology can be utilized to create pervasive surveillance systems, echoing the sophisticated monitoring used by extraterrestrial forces in The Three-Body Problem to manipulate and control human society. The negative impact on trust—between governments, among nations, and between citizens and their leaders—has been profound, highlighting the fragile nature of privacy in the digital age.&lt;/p&gt;
&lt;h3 id=&quot;the-stuxnet-worm-and-the-ambiguity-of-cyber-warfare&quot;&gt;The Stuxnet Worm and the Ambiguity of Cyber Warfare&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Stuxnet?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Stuxnet&lt;/a&gt; marked a significant moment in the history of cyber warfare, demonstrating the potential to cause physical damage via digital means. Its success in hindering Iran&amp;#39;s nuclear program is viewed positively by some as a means of averting a potential military conflict. Yet, the use of such a powerful cyber weapon also set a precedent for state-sponsored attacks on industrial and infrastructure systems, raising ethical concerns about the normalization of digital sabotage and the potential for escalation into broader conflicts.&lt;/p&gt;
&lt;p&gt;While not involving extraterrestrial technology, the deployment of Stuxnet mirrors the covert and technologically sophisticated methods of warfare depicted in The Three-Body Problem. The worm&amp;#39;s capability to infiltrate and manipulate systems without detection parallels the advanced surveillance and control tactics employed by the Trisolarans, underscoring the vulnerabilities inherent in our reliance on technology.&lt;/p&gt;
&lt;h3 id=&quot;reflections-from-the-three-body-problem&quot;&gt;Reflections from The Three-Body Problem&lt;/h3&gt;
&lt;p&gt;In the book, the Trisolarans&amp;#39; ability to monitor and influence Earth through advanced technology serves as a cautionary tale about the potential for technology to be used for both benevolent and malevolent ends. The novel prompts readers to consider the ethical implications of surveillance, the potential for weaponising technology, and the need for responsible stewardship of technological power.&lt;/p&gt;
&lt;p&gt;As we navigate the complexities of the invisible war in our own world, these examples from history and contemporary issues, alongside the fictional scenarios in the book, offer valuable insights. They remind us of the need for vigilance, ethical consideration, and international cooperation in the face of technological advancements that have the power to both protect and harm humanity.&lt;/p&gt;
&lt;h2 id=&quot;applying-lessons-to-todays-challenges&quot;&gt;Applying Lessons to Today’s Challenges&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/city-sky.BDO_2e3F_up2wk.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The book&amp;#39;s characters navigate a universe fraught with existential threats, leveraging their unique strengths to confront these challenges. Their stories, rich with lessons of resilience, innovation, and ethical complexity, can guide us in addressing some of the most pressing issues of our time: renewable energy, disease prevention, and digital privacy.&lt;/p&gt;
&lt;h3 id=&quot;the-ingenuity-of-wang-miao&quot;&gt;The Ingenuity of Wang Miao&lt;/h3&gt;
&lt;p&gt;Wang Miao&amp;#39;s scientific curiosity and problem-solving skills highlight the importance of innovation in the face of seemingly insurmountable challenges. Applying Wang&amp;#39;s approach to renewable energy involves fostering a culture of continuous research and development, pushing the boundaries of current technologies to harness the power of the sun, wind, and other sustainable resources more efficiently. It encourages a multidisciplinary perspective, combining insights from physics, engineering, and environmental science to discover breakthroughs in energy storage, transmission, and utilization.&lt;/p&gt;
&lt;h3 id=&quot;the-resilience-of-ye-wenjie&quot;&gt;The Resilience of Ye Wenjie&lt;/h3&gt;
&lt;p&gt;Ye Wenjie&amp;#39;s resilience in the face of personal and global crises underscores the critical role of perseverance in disease prevention. Inspired by her character, efforts in disease prevention could focus on long-term strategies and investments in public health infrastructure, including developing vaccines, antimicrobial resistance research, and global surveillance systems to detect and contain outbreaks before they spread. Wenjie&amp;#39;s story reminds us of the importance of sustaining hope and effort, even when progress seems slow or the challenges overwhelming.&lt;/p&gt;
&lt;h3 id=&quot;the-ethical-dilemmas-of-luo-ji&quot;&gt;The Ethical Dilemmas of Luo Ji&lt;/h3&gt;
&lt;p&gt;Luo Ji&amp;#39;s navigation of ethical dilemmas, especially concerning the manipulation and control of information, speaks directly to the contemporary issue of digital privacy. His strategies invite us to think critically about the balance between surveillance for security purposes and the protection of individual rights. In the context of digital privacy, adopting Luo&amp;#39;s perspective means advocating for robust encryption standards, transparent data practices, and policies that prioritize user consent and control over personal information. It also involves educating the public about digital rights and fostering a global dialogue on the ethical use of technology.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/small-spacecraft.BHrJYLuU_Z1m2sa.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The characters in The Three-Body Problem show that facing global challenges requires a combination of technical innovation, perseverance, and ethical consideration. In the realms of renewable energy, disease prevention, and digital privacy, their stories inspire us to pursue solutions that are effective but also equitable and sustainable.&lt;/p&gt;
&lt;p&gt;Emulating the series’ protagonists, we can approach these issues with a blend of creativity and critical thinking, leveraging technology to improve lives while also navigating the moral complexities inherent in such advancements. Their trials and tribulations encourage us to envision a future where humanity rises to meet its challenges through a collective commitment to innovation, resilience, and integrity.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/clean-blossoming-city.Co8UIrIc_ZUFu7J.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Reflecting on the journey through The Three-Body Problem series and its vivid portrayal of humanity&amp;#39;s struggle and resilience, I find myself inspired and sobered by the parallels between the fictional challenges faced by its characters and the real-world issues confronting us today. From the realms of renewable energy and disease prevention to the intricate dance of digital privacy, the series offers more than just a narrative; it presents a blueprint for innovation in the face of adversity.&lt;/p&gt;
&lt;p&gt;The resilience of Ye Wenjie, the ingenuity of Wang Miao, and the ethical navigation of Luo Ji provide not just lessons in character but a call to action for all of us. Their stories remind us that the greatest innovations often arise from the most daunting challenges, pushing us to think beyond the confines of our current capabilities and circumstances.&lt;/p&gt;
&lt;p&gt;As I look at the world, marked by rapid technological advancement and complex global challenges, I am reminded that the spirit of innovation is not confined to the crises of war or the threats of extraterrestrial manipulation. It lies within our daily struggles to make the world a better, more sustainable, and equitable place for future generations.&lt;/p&gt;
&lt;p&gt;The path forward, illuminated by the trials and tribulations of The Three-Body Problem characters, is one of perseverance, creativity, and ethical consideration. It urges us to leverage our collective talents and insights to overcome the challenges of our time, just as the characters sought to navigate the uncertainties of their own.&lt;/p&gt;
&lt;p&gt;In conclusion, the series not only entertains and provokes thought but also serves as a reminder of our potential to enact positive change. As we face our current and future challenges, let us draw inspiration from these narratives to break through the barriers before us, innovating for a better world with the determination, creativity, and integrity that define the best of our shared humanity.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Books</category><category>Ramblings</category><category>Innovation</category></item><item><title>Getting Familiar with Big O Notation</title><link>https://www.mrstebo.co.uk/getting-familiar-with-big-o-notation/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/getting-familiar-with-big-o-notation/</guid><description>I&apos;ve been watching quite a few mock code interviews lately (and reading Cracking the Coding Interview), and one topic that always comes up is Big O notation. Realizing its importance in discussions about algorithm efficiency—specifically…</description><pubDate>Mon, 18 Mar 2024 06:00:59 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/getting-familiar-with-big-o-notation.C5FgEApY_ZSS98U.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been watching quite a few mock code interviews lately (and reading &lt;a href=&quot;https://www.amazon.co.uk/Cracking-Coding-Interview-6th-Programming/dp/0984782850/?tag=mrstebo-21&amp;#38;ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;Cracking the Coding Interview&lt;/strong&gt;&lt;/a&gt;), and one topic that always comes up is &lt;strong&gt;Big O notation&lt;/strong&gt;. Realizing its importance in discussions about algorithm efficiency—specifically regarding time and space complexity—I decided it was high time I gained a deeper understanding of what Big O notation means and how I can apply it to evaluate solutions more effectively.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/61miq2ijuxl-sl1360.B_XKuIF1_2hMQvJ.jpg&quot; alt=&quot;&quot; width=&quot;952&quot; height=&quot;1360&quot;&gt;&lt;figcaption&gt;A great resource for learning about Big O Notation and interview techniques&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Big O notation seemed like a daunting concept, a mathematical way of describing how algorithms perform under different conditions. But as I&amp;#39;ve started to peel back the layers, I&amp;#39;m beginning to see its value in helping me write more efficient code and make smarter choices when reviewing my work or that of others. It&amp;#39;s not just about the code running correctly; it&amp;#39;s about it running optimally, especially as the size of the input data grows.&lt;/p&gt;
&lt;p&gt;In this exploration, I aim to share what I&amp;#39;m learning about Big O notation. From understanding its basic principles to applying it through TypeScript examples, I&amp;#39;ll dive into the nuances of time and space complexity. I&amp;#39;ll also touch on the trade-offs that sometimes need to be made between speed and memory usage. It&amp;#39;s a journey of discovery, one that I&amp;#39;m still on, but I&amp;#39;m eager to share the insights I&amp;#39;ve gathered so far.&lt;/p&gt;
&lt;h2 id=&quot;understanding-big-o-notation&quot;&gt;Understanding Big O Notation&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer.BPYMJmKQ_KAfT.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;After spending some time observing mock code interviews, I noticed Big O notation coming up frequently. Initially, I thought it was mainly a tool for impressing interviewers, but I&amp;#39;ve since realized it&amp;#39;s much more. Big O notation isn&amp;#39;t just for interviews; it&amp;#39;s a crucial aspect of writing efficient code. It&amp;#39;s about ensuring we don&amp;#39;t create software that performs poorly or consumes more resources than necessary, like writing overly slow loops or using more memory than needed for simple tasks.&lt;/p&gt;
&lt;p&gt;Big O notation serves as a mathematical representation to describe the efficiency of algorithms, particularly in terms of time and space complexity. It assesses how the execution time or space requirements of an algorithm grow with the size of the input data, denoted as &lt;code&gt;n&lt;/code&gt;. This concept has reshaped my understanding of code scalability and efficiency.&lt;/p&gt;
&lt;p&gt;By focusing on the worst-case scenario, Big O notation provides a lens through which we can evaluate the potential impact of our coding decisions. This insight is invaluable because it pushes us to consider how our code will perform as data sizes increase, ensuring our solutions are both scalable and resource-efficient.&lt;/p&gt;
&lt;p&gt;Moreover, understanding Big O notation has underscored the importance of considering both time and space complexity from the get-go. It&amp;#39;s not just about making code work; it&amp;#39;s about making it work efficiently and responsibly. This realization has been a turning point, encouraging me to scrutinize my code for efficiency at every step of the development process.&lt;/p&gt;
&lt;p&gt;With this newfound understanding of Big O notation&amp;#39;s importance, I&amp;#39;ve started to see time complexity in a new light. Before, I might have been optimizing code based on gut feelings or general best practices without a structured framework. Knowing about Big O notation gives a name to those intuitions, turning them into something I can actively analyze and improve upon.&lt;/p&gt;
&lt;h2 id=&quot;time-complexity&quot;&gt;Time Complexity&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/code-surrounding-pocket.CWc1aYNZ_Z1xo0IF.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Time complexity is all about measuring how the execution time of an algorithm changes with the size of the input data, denoted as &lt;code&gt;n&lt;/code&gt;. Before diving into Big O notation, I knew that some algorithms were faster than others, but I didn&amp;#39;t have a precise way to describe or quantify that difference. Now, with Big O, I can.&lt;/p&gt;
&lt;h3 id=&quot;constant-time-o1&quot;&gt;Constant Time: &lt;code&gt;O(1)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;In exploring algorithmic efficiencies, constant time complexity, denoted as &lt;code&gt;O(1)&lt;/code&gt;, stands out for its independence from the size of the input data. This means that an operation takes the same amount of time to complete, regardless of how much data you&amp;#39;re working with. Understanding &lt;code&gt;O(1)&lt;/code&gt; is crucial for designing algorithms where performance is paramount, as it ensures consistent execution times even as datasets grow. It&amp;#39;s particularly useful in scenarios where frequent data access is required, such as database operations or caching mechanisms.&lt;/p&gt;
&lt;p&gt;An illustrative example of &lt;code&gt;O(1)&lt;/code&gt; complexity in action is the task of checking for the presence of an element within a &lt;code&gt;Set&lt;/code&gt; in TypeScript. The &lt;code&gt;Set&lt;/code&gt; data structure is optimized for unique value storage and fast access, making operations like the &lt;code&gt;.has()&lt;/code&gt; method execute in constant time. Here&amp;#39;s how it might look:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; checkPresence&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Set&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; set&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;has&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this function, &lt;code&gt;checkPresence&lt;/code&gt;, checking whether a specific value exists in the set is an &lt;code&gt;O(1)&lt;/code&gt; operation, showcasing the efficiency and predictability of constant time complexity.&lt;/p&gt;
&lt;h3 id=&quot;logarithmic-time-olog-n&quot;&gt;Logarithmic Time: &lt;code&gt;O(log n)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Logarithmic time complexity, symbolized as &lt;code&gt;O(log n)&lt;/code&gt;, characterizes algorithms that divide the problem space in half with each step. This approach significantly reduces the number of operations required as the dataset size increases, making it a highly efficient strategy for dealing with large amounts of data. Understanding and applying &lt;code&gt;O(log n)&lt;/code&gt; algorithms is key to enhancing performance in search and sorting tasks, where they can dramatically decrease execution times compared to linear approaches.&lt;/p&gt;
&lt;p&gt;A prime example of logarithmic time complexity is the binary search algorithm, which efficiently locates a target value within a sorted array. By comparing the target with the middle element of the array and discarding half of the search space in each step, binary search minimizes the number of comparisons needed to find the target or determine its absence.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; binarySearch&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;sortedArr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; low&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; high&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; sortedArr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  while&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;low&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; high&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; mid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;floor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;low&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; high&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;sortedArr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;mid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;===&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; target&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      return&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;sortedArr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;mid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; target&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      low&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; mid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      high&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; mid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Binary search exemplifies the power of &lt;code&gt;O(log n)&lt;/code&gt; complexity by demonstrating how a methodical halving of the search space leads to rapid location of elements, highlighting the utility of logarithmic time in optimizing algorithmic solutions.&lt;/p&gt;
&lt;h3 id=&quot;linear-time-on&quot;&gt;Linear Time: &lt;code&gt;O(n)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Linear time complexity, &lt;code&gt;O(n)&lt;/code&gt;, describes situations where the time it takes to complete an operation increases linearly with the size of the input data. This direct relationship between input size and execution time is common in algorithms that need to process each element individually. Knowing an algorithm runs in linear time is vital for assessing its scalability and performance, especially with large datasets where execution time becomes a critical consideration.&lt;/p&gt;
&lt;p&gt;A straightforward example of linear time complexity is the task of summing all elements in an array. This operation requires iterating through each element once, adding its value to a cumulative total.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; sumArray&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; sum&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    sum&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; +=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; sum&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;sumArray&lt;/code&gt; function clearly operates in &lt;code&gt;O(n)&lt;/code&gt; time, with the execution time scaling directly with the array&amp;#39;s length. It underscores the importance of linear time complexity in understanding and managing the performance implications of processing individual data elements.&lt;/p&gt;
&lt;h3 id=&quot;quadratic-time-on2&quot;&gt;Quadratic Time: &lt;code&gt;O(n^2)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Quadratic time complexity, represented by &lt;code&gt;O(n^2)&lt;/code&gt;, occurs in algorithms where the execution time increases quadratically as the input size grows. This is typically seen in algorithms that perform nested iterations over the dataset. Identifying &lt;code&gt;O(n^2)&lt;/code&gt; complexity is crucial for recognizing potentially inefficient algorithms that may not scale well with larger data volumes, prompting a search for more efficient alternatives.&lt;/p&gt;
&lt;p&gt;An illustrative case of quadratic time complexity involves generating all possible pairs from an array&amp;#39;s elements, necessitating a nested loop to combine each element with every other.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; generatePairs&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; pairs&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; j&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;j&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;j&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      pairs&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;j&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; pairs&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This &lt;code&gt;generatePairs&lt;/code&gt; function demonstrates &lt;code&gt;O(n^2)&lt;/code&gt; complexity through its use of nested loops to create pairs, showing how the operation count grows quadratically with the input size. It serves as a clear example of the challenges posed by quadratic time complexity and the importance of striving for more efficient solutions in algorithm design.&lt;/p&gt;
&lt;h3 id=&quot;factorial-time-on&quot;&gt;Factorial Time: &lt;code&gt;O(n!)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Following the exploration of quadratic time complexity, we encounter factorial time complexity, denoted as &lt;code&gt;O(n!)&lt;/code&gt;, which represents an even more significant computational challenge. Factorial time complexity arises in scenarios where the number of operations increases factorially with the size of the input data. This means for an input of size &lt;code&gt;n&lt;/code&gt;, the algorithm performs &lt;code&gt;n!&lt;/code&gt; (n factorial) operations. The factorial growth rate is so rapid that algorithms with this complexity become impractical for inputs of even modest size.&lt;/p&gt;
&lt;p&gt;A vivid illustration of factorial time complexity is the task of generating all possible permutations of an array. This operation&amp;#39;s complexity is &lt;code&gt;O(n!)&lt;/code&gt; because the number of possible permutations of &lt;code&gt;n&lt;/code&gt; items is exactly &lt;code&gt;n!&lt;/code&gt;. Such an algorithm must consider every possible arrangement of the array&amp;#39;s elements, leading to an explosion of operations as the array size increases.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how such a function might be implemented:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; generatePermutations&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; permutations&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; currentNum&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; remaining&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;_&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;index&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; index&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !==&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; remainingPermutations&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; generatePermutations&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;remaining&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; perm&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; remainingPermutations&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      permutations&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;currentNum&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;perm&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; permutations&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This recursive function showcases &lt;code&gt;O(n!)&lt;/code&gt; complexity through its process of generating permutations. By selecting each element as the starting point and then recursively generating permutations of the remaining elements, the function embodies the factorial growth of its computational demands.&lt;/p&gt;
&lt;p&gt;Understanding the implications of factorial time complexity is crucial for recognizing the limitations of certain algorithms. While generating all permutations might be feasible for small arrays, the &lt;code&gt;O(n!)&lt;/code&gt; complexity quickly renders the algorithm impractical for larger datasets. This highlights the importance of seeking more efficient approaches or employing heuristics and approximations for complex problems, ensuring that solutions remain viable as input sizes grow.&lt;/p&gt;
&lt;p&gt;Diving into time complexity with a clear framework has fundamentally changed how I view algorithm efficiency. Now, when I encounter a piece of code, I see more than just the logic it executes; I see a landscape of efficiency shaped by Big O notation. Each pattern, from &lt;code&gt;O(1)&lt;/code&gt; to &lt;code&gt;O(n^2)&lt;/code&gt;, tells a story of performance, guiding me in choosing the right approach for the task at hand.&lt;/p&gt;
&lt;p&gt;Understanding these time complexity classes has given me a powerful lens for scrutinizing my coding decisions. It&amp;#39;s not just about whether the code runs but how well it scales with increasing inputs. This perspective is invaluable, pushing me to refine my solutions not only to meet the immediate requirements but also to ensure they stand the test of scalability and efficiency.&lt;/p&gt;
&lt;p&gt;With this foundation in time complexity, I&amp;#39;m ready to explore space complexity and how it complements time efficiency to shape truly optimized solutions.&lt;/p&gt;
&lt;h2 id=&quot;space-complexity&quot;&gt;Space Complexity&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/code-surrounding-galaxy.Da2A3uKc_Z2tbnGC.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The realization that every piece of code not only takes time to execute but also occupies memory was a pivotal moment in my journey. Space complexity became a new lens through which I could evaluate my code, understanding that optimizing for memory usage is as critical as optimizing for execution time.&lt;/p&gt;
&lt;h3 id=&quot;constant-space-o1&quot;&gt;Constant Space: &lt;code&gt;O(1)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Learning about constant space complexity, &lt;code&gt;O(1)&lt;/code&gt;, was an eye-opener. This means that memory usage does not increase with the size of the input. For instance, performing a calculation on numbers or swapping two elements in an array requires a fixed amount of memory, regardless of the array&amp;#39;s size. This understanding is crucial because it highlights operations that are highly efficient from a memory usage standpoint.&lt;/p&gt;
&lt;p&gt;Consider the simple operation of swapping two elements within an array:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; swapElements&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;index1&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;index2&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; temp&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;index1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;index1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;index2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;index2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; temp&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This &lt;code&gt;swapElements&lt;/code&gt; function embodies the &lt;code&gt;O(1)&lt;/code&gt; space complexity principle. The amount of memory required for the swap (using a temporary variable) remains constant, demonstrating that some operations maintain their memory efficiency, regardless of input size. This principle encouraged me to think more judiciously about how I use variables and store data, aiming for solutions that don&amp;#39;t unnecessarily inflate memory usage as the data grows.&lt;/p&gt;
&lt;h3 id=&quot;linear-space-on&quot;&gt;Linear Space: &lt;code&gt;O(n)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Then, there&amp;#39;s linear space complexity, &lt;code&gt;O(n)&lt;/code&gt;, where the memory usage grows linearly with the input size. Understanding this was pivotal because it shed light on how certain data manipulations impact memory. A straightforward example is creating a new array that&amp;#39;s a copy of an existing array. As the original array grows, so does the amount of memory needed to hold the copy.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a simple demonstration:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; cloneArray&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; newArr&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    newArr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;arr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; newArr&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this &lt;code&gt;cloneArray&lt;/code&gt; function, a new array (&lt;code&gt;newArr&lt;/code&gt;) is constructed by iterating over and copying elements from the input array (&lt;code&gt;arr&lt;/code&gt;). The memory required for &lt;code&gt;newArr&lt;/code&gt; scales linearly with the size of &lt;code&gt;arr&lt;/code&gt;, encapsulating the essence of linear space complexity, &lt;code&gt;O(n)&lt;/code&gt;. This example reinforced the idea that efficiency isn&amp;#39;t just about reducing computational steps but also involves minimizing the data footprint of those steps.&lt;/p&gt;
&lt;p&gt;Grasping the nuances of space complexity has taught me the art of balance. In some scenarios, I&amp;#39;ve found that optimizing for time efficiency can increase space complexity and vice versa. This trade-off is a crucial consideration in algorithm design, where the optimal solution often lies in finding the right equilibrium between time and space efficiency.&lt;/p&gt;
&lt;p&gt;Understanding space complexity has fundamentally changed how I approach coding tasks. It&amp;#39;s not merely about the speed of execution but about crafting solutions that are mindful of memory constraints. This awareness is crucial for building applications that are not only fast but also lightweight and scalable, ensuring they perform well even as the dataset or user base grows.&lt;/p&gt;
&lt;h2 id=&quot;balancing-time-and-space-complexity&quot;&gt;Balancing Time and Space Complexity&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/pocket-watch-orbiting.BcjzEaji_Z1AHqkd.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In my journey of understanding Big O notation, one of the most challenging aspects has been navigating the trade-offs between time and space complexity. It&amp;#39;s a delicate balance, where optimizing for one can often lead to increased consumption of the other. This realization was pivotal, as it shifted my approach from seeking to optimize solely for speed or memory usage to striving for an optimal balance that suits the specific needs of each application.&lt;/p&gt;
&lt;h4 id=&quot;when-to-optimize-for-time&quot;&gt;When to Optimize for Time&lt;/h4&gt;
&lt;p&gt;There are scenarios where optimizing for time makes the most sense. For instance, in real-time systems or applications where speed is paramount, reducing the execution time may be the primary goal. In such cases, I&amp;#39;m willing to use more memory if it means significantly faster response times. An example might involve caching results of expensive computations to speed up future requests, accepting the increased space complexity for the sake of time efficiency.&lt;/p&gt;
&lt;h4 id=&quot;when-to-optimize-for-space&quot;&gt;When to Optimize for Space&lt;/h4&gt;
&lt;p&gt;Conversely, there are situations where minimizing memory usage is critical, especially in environments with limited resources, such as embedded systems or mobile applications. Here, optimizing for space, even at the cost of additional computation time, is necessary. For example, using algorithms that process data in smaller chunks can help manage memory usage more effectively, even if it means the overall execution time might be longer.&lt;/p&gt;
&lt;h4 id=&quot;finding-the-right-balance&quot;&gt;Finding the Right Balance&lt;/h4&gt;
&lt;p&gt;The key to balancing time and space complexity lies in understanding the constraints and requirements of the specific problem or system you&amp;#39;re working with. It involves making informed decisions about where to make trade-offs, guided by the insights gained from Big O notation. Through this lens, I&amp;#39;ve learned to evaluate both the immediate and long-term implications of these trade-offs, ensuring that the solutions I develop are not only efficient but also scalable and adaptable to varying conditions.&lt;/p&gt;
&lt;p&gt;In practice, this means constantly assessing the impact of algorithmic choices on both execution time and memory usage, striving to find a harmonious balance that delivers optimal performance. It&amp;#39;s a nuanced process, one that requires a deep understanding of the algorithms in use and the context in which they operate.&lt;/p&gt;
&lt;h2 id=&quot;practical-applications-and-considerations&quot;&gt;Practical Applications and Considerations&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/pocket-watch-orbiting-2.1SLzJBu-_Zbx6hh.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;code-optimization&quot;&gt;Code Optimization&lt;/h4&gt;
&lt;p&gt;One of the most immediate applications of Big O notation I&amp;#39;ve encountered is in code optimization. Armed with a clearer understanding of algorithmic efficiency, I now look at my own code through a new lens. For instance, I can recognize when a loop could lead to quadratic time complexity and refactor it to a more efficient solution, perhaps leveraging data structures that offer better performance characteristics.&lt;/p&gt;
&lt;h4 id=&quot;scalability&quot;&gt;Scalability&lt;/h4&gt;
&lt;p&gt;As someone who&amp;#39;s keen on building software that stands the test of time and scale, Big O notation has become an indispensable tool in my arsenal. It&amp;#39;s one thing to write code that works; it&amp;#39;s another to ensure that code remains efficient as user base or data grows. Big O notation provides a framework to anticipate and mitigate potential performance bottlenecks before they become critical issues.&lt;/p&gt;
&lt;h4 id=&quot;technical-interviews&quot;&gt;Technical Interviews&lt;/h4&gt;
&lt;p&gt;Beyond its application in day-to-day coding and optimization, my exploration of Big O notation has also prepared me for technical interviews. Understanding and being able to discuss the time and space complexity of algorithms is a common requirement. Now, I can approach these discussions with confidence, equipped with the terminology and understanding to articulate how and why certain solutions are more efficient.&lt;/p&gt;
&lt;h4 id=&quot;reviewing-and-evaluating-code&quot;&gt;Reviewing and Evaluating Code&lt;/h4&gt;
&lt;p&gt;Finally, my journey into Big O notation has enhanced my ability to review and evaluate the code of others. Whether it&amp;#39;s in a peer review context or assessing potential library and framework choices for a project, understanding the underlying algorithmic efficiency is crucial. This knowledge enables me to make more informed decisions, advocating for solutions that are not only effective but also efficient.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/letter-o-on-side.qMta0sxe_Z2f0BU1.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve learned that Big O notation is much more than a tool for acing technical interviews; it&amp;#39;s a fundamental concept that influences every line of code I write. It has equipped me with a framework for evaluating time and space complexity, guiding me to write more efficient, scalable software. Through practical examples and a deep dive into the theoretical underpinnings, I&amp;#39;ve gained insights into the delicate balance between computational time and memory usage, understanding when to optimize for one over the other based on the application&amp;#39;s specific needs.&lt;/p&gt;
&lt;p&gt;More importantly, this knowledge has not only enhanced my coding practices but has also prepared me to share these insights with others. Whether it&amp;#39;s through peer code reviews, mentoring sessions, or guiding fellow developers during the interview process, I feel equipped to explain the significance of Big O notation in everyday coding decisions. I can now illustrate, with clear examples, how a seemingly small decision can significantly impact an application&amp;#39;s performance and scalability.&lt;/p&gt;
&lt;p&gt;Moreover, understanding Big O notation has enabled me to approach technical interviews with a new perspective. Instead of merely solving coding challenges, I can discuss the efficiency of my solutions, articulating the reasoning behind my choices. This ability to think and communicate algorithmic efficiency is invaluable, not just for interviews but for collaborative software development.&lt;/p&gt;
&lt;p&gt;In teaching others, I aim to demystify Big O notation, making it accessible and understandable. By integrating these concepts into code reviews and development discussions, I hope to foster a culture of efficiency and performance mindfulness among my peers. It&amp;#39;s about elevating the conversation from simply making code work to ensuring it works well under all conditions.&lt;/p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;
&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Big_O_notation?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;Big O notation - Wikipedia&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;Contributors to Wikimedia projects · Wikimedia Foundation, Inc.&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;bookmark&quot;&gt;&lt;a href=&quot;https://www.crackingthecodinginterview.com/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;&lt;span class=&quot;bookmark-title&quot;&gt;CRACKING the&amp;nbsp;CODING INTERVIEW&lt;/span&gt;&lt;span class=&quot;bookmark-description&quot;&gt;Help software engineers interview at their best. The best-selling book in computer science for 4 years running. Written by a former member of Google’s hiring committee, and the consultant on engineering hiring for many of the top tech companies.&lt;/span&gt;&lt;span class=&quot;bookmark-meta&quot;&gt;CRACKING the&amp;nbsp;CODING INTERVIEW&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Software Engineering</category><category>Knowledge Sharing</category></item><item><title>Whoops - When Did My Image Links Start Breaking?! - Technical Post-Mortem</title><link>https://www.mrstebo.co.uk/whoops-when-did-my-image-links-start-breaking-technical-post-mortem/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/whoops-when-did-my-image-links-start-breaking-technical-post-mortem/</guid><description>Last week, a routine visit to my blog, intended to retrieve information for a work project, unveiled a series of broken image links that sparked a comprehensive review and rectification process. This post-mortem report outlines the…</description><pubDate>Wed, 06 Mar 2024 08:00:51 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/whoops-when-did-my-image-links-start-breaking-technical-post-mortem.CavrJ5F7_2cpNP8.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Last week, a routine visit to my blog, intended to retrieve information for a work project, unveiled a series of broken image links that sparked a comprehensive review and rectification process. This post-mortem report outlines the discovery, analysis, and resolution of the issue, highlighting the steps taken to prevent future occurrences.&lt;/p&gt;
&lt;h2 id=&quot;discovery&quot;&gt;&lt;strong&gt;Discovery&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-blonde-man-looking.Ck3Vkkwb_1jVX1v.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The issue came to light when I accessed an article on my blog &lt;a href=&quot;https://mrstebo.co.uk/?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;https://mrstebo.co.uk&lt;/a&gt; to gather insights on setting up linting and husky for a project at work. To my surprise, several images within the post were not loading, presenting a clear indication that something was amiss.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/whoops-when-did-my-image-links-start-breaking-technical-post-mortem-1.DsQbezyI_Z1lEOW6.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;773&quot;&gt;&lt;figcaption&gt;Screenshot of the website showing broken image links.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;initial-analysis&quot;&gt;&lt;strong&gt;Initial Analysis&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-blonde-man-thinking.Bp2RnbSX_Z198kBV.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;To understand the scope of the problem, I navigated to the Ghost admin area, which serves as the backend for content management on my blog. The images failed to load in the admin area as well, suggesting the issue was not isolated to the frontend.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/whoops-when-did-my-image-links-start-breaking-technical-post-mortem-2.Cm8Zr_fj_10YPU7.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;773&quot;&gt;&lt;figcaption&gt;Screenshot of the Ghost admin area with the broken links visible.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Utilizing browser developer tools, I conducted a deeper investigation into the source of the images. This revealed that the broken links were attempting to load images from a Discord CDN. This was a critical insight, as it indicated the root cause: images were copied directly from Discord chats instead of being properly downloaded and uploaded to the blog.&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/whoops-when-did-my-image-links-start-breaking-technical-post-mortem-3.D9KvNr-J_Z1Ww3PN.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;773&quot;&gt;&lt;figcaption&gt;Browser developer tools open with the Discord CDN link highlighted.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;scope-of-the-issue&quot;&gt;&lt;strong&gt;Scope of the Issue&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer.CUTc4f5P_67e1j.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;To quantify the extent of the issue, I developed a Ruby script to scan my blog&amp;#39;s sitemap for any articles containing Discord CDN links. This script efficiently parsed the sitemap, identifying articles with potentially broken image links.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;net/http&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;nokogiri&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;json&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; get_posts_links_from_sitemap&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;sitemap_url&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    uri&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; URI&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(sitemap_url)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    response&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Net&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;HTTP&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(uri)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    doc&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Nokogiri&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(response)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    doc.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;loc&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;:text&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; get_discord_image_links_from_page&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;page_url&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    uri&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; URI&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(page_url)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    response&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Net&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;HTTP&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(uri)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    doc&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; Nokogiri&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(response)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    doc.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;xpath&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;//img[@src]&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        .&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {|&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;img&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;| img[&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;src&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=~&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; /discordapp/&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        .&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {|&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;img&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;| img[&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;src&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; save_image_list_to_file&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;image_list&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;file_path&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;    File&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(file_path, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;w&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;|&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        file.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;write&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(image_list)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;post_links&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; get_posts_links_from_sitemap&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;https://www.mrstebo.co.uk/sitemap-posts.xml&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;image_links&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;post_links.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; do&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;|&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    puts&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Getting images from &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;#{&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    images&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; get_discord_image_links_from_page&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(link)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    puts&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;Found &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;#{&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;images.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; images&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; images.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        image_links.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;link:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; link, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;images:&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; images})&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;save_image_list_to_file&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;JSON&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;pretty_generate&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(image_links), &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;images.json&apos;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A Ruby script that gets posts from the sitemap and checks each post for Discord CDN links&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;dependencies&quot;&gt;&lt;strong&gt;Dependencies&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;To run this script, the following dependencies were necessary, outlined in a &lt;code&gt;Gemfile&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;ruby&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;source &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;https://rubygems.org&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;gem &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&apos;nokogiri&apos;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;outcome&quot;&gt;Outcome&lt;/h3&gt;
&lt;p&gt;The script output a JSON file listing the affected posts and their respective Discord-hosted image links. Here&amp;#39;s a snippet of the output:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;json&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    &quot;link&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;https://www.mrstebo.co.uk/make-it-dark-putting-the-engine-together/&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    &quot;images&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;      &quot;https://cdn.discordapp.com/attachments/image_link_1.png&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;      &quot;https://cdn.discordapp.com/attachments/image_link_2.png&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    &quot;link&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;https://www.mrstebo.co.uk/make-it-dark-turning-requirements-into-code/&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;    &quot;images&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;      &quot;https://cdn.discordapp.com/attachments/image_link_3.png&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;      &quot;https://cdn.discordapp.com/attachments/image_link_4.png&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A snippet showing the output of the script&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;resolution&quot;&gt;&lt;strong&gt;Resolution&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-2.B5H20hBv_ZfbqWx.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Armed with the list of affected articles, I embarked on a task to replace the broken links. This involved locating the original images in Discord, downloading them, and uploading them directly to the respective blog posts. This process not only restored the intended visual content but also ensured the images were now hosted within a more reliable and controlled environment.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/whoops-when-did-my-image-links-start-breaking-technical-post-mortem-4.C9UDhs19_ea2HF.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;1000&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;preventative-measures&quot;&gt;&lt;strong&gt;Preventative Measures&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-3.BWCrieO2_7uF5T.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;To prevent a recurrence of this issue, I am in the process of developing monitoring tools specifically designed to detect broken links on the blog. These tools will extend beyond image links, encompassing all external links to ensure the integrity and reliability of the blog&amp;#39;s content.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/software-engineer-4.DfPxjn4U_Z1P9DAv.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;This incident highlighted the importance of a meticulous approach to content management, especially regarding the sourcing and hosting of images. The resolution has not only corrected the immediate issue but has also spurred the development of tools and practices that will enhance the blog&amp;#39;s long-term maintenance and reliability. Through this post-mortem, I have taken a critical step towards ensuring a more robust and resilient digital presence.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Post-Mortem</category><category>Software Engineering</category><category>CDN</category><category>Knowledge Sharing</category></item><item><title>Make It Dark - Hooking up the Engine to the UI</title><link>https://www.mrstebo.co.uk/make-it-dark-hooking-up-the-engine-to-the-ui/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/make-it-dark-hooking-up-the-engine-to-the-ui/</guid><description>After meticulously crafting the foundational classes like GridManager, LightToggleStrategy, WinConditionChecker, and assembling them into our &quot;finely tuned engine,&quot; the GameEngine, the stage is set for the final act: bringing Make It Dark…</description><pubDate>Mon, 26 Feb 2024 08:45:04 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui.DDK-_fx4_Z1uWg8N.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;After meticulously crafting the foundational classes like &lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, &lt;code&gt;WinConditionChecker&lt;/code&gt;, and assembling them into our &amp;quot;finely tuned engine,&amp;quot; the &lt;code&gt;GameEngine&lt;/code&gt;, the stage is set for the final act: bringing Make It Dark to life with a user interface. The groundwork in previous posts ensures the game&amp;#39;s logic is robust and ready to be interfaced with Svelte, a modern framework designed for building reactive and efficient components.&lt;/p&gt;
&lt;h2 id=&quot;building-a-landing-page&quot;&gt;Building a Landing Page&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/aircraft-landing.BPpPvFd4_Z1pwrVc.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;For the landing page, I wanted something straightforward yet captivating, a portal that immediately draws players into the game&amp;#39;s essence. The HTML5 UP&amp;#39;s &lt;a href=&quot;https://html5up.net/fractal?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;Fractal&lt;/a&gt; template was perfect for this purpose, offering a sleek design that could be easily adapted to fit the game&amp;#39;s theme. The process involved taking the HTML structure provided by Fractal and integrating it into a Svelte page, ensuring a seamless blend of template aesthetics with Svelte&amp;#39;s reactive capabilities.&lt;/p&gt;
&lt;p&gt;Fractal comes packed with various elements designed to cater to a wide range of websites, but for Make It Dark, I required a significant simplification. The goal was to keep the focus on the game, eliminating any superfluous content that didn&amp;#39;t serve this primary purpose. Here&amp;#39;s the streamlined version of the Fractal template I ended up using, specifically tailored for the game&amp;#39;s landing page:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;html&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;&amp;#x3C;!-- Header --&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;header&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h1&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; href&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;Make It Dark&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h1&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;Bringing back the childhood nostalgia!&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;actions&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;            &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; href&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;/game&quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;button primary icon solid fa-gamepad&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;Play&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;image phone&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;inner&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;img&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; src&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;/images/screen.png&quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D;font-style:italic&quot;&gt; alt&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; /&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id=&quot;key-adjustments&quot;&gt;Key Adjustments&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Concentrated Content&lt;/strong&gt;: The header element was retained to encapsulate the game&amp;#39;s introduction. It houses the game title, and a brief tagline that hints at the nostalgic journey players are about to embark on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Navigation&lt;/strong&gt;: A singular call-to-action button invites players directly to start playing, simplifying navigation and focusing user attention on game engagement.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visual Appeal&lt;/strong&gt;: The phone image div was updated to include a screenshot of the game (or a conceptual visualization of it), offering a peek into the gameplay and visually communicating the game&amp;#39;s premise.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;implementing-in-svelte&quot;&gt;Implementing in Svelte&lt;/h4&gt;
&lt;p&gt;Incorporating this HTML into a Svelte component involved creating a new &lt;code&gt;+page.svelte&lt;/code&gt; file within the &lt;code&gt;routes&lt;/code&gt; folder of my Svelte project. This approach leverages Svelte&amp;#39;s routing capabilities to serve the landing page as the initial point of entry for users.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui-1.CheMG_pG_Z2rPj6g.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;773&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui-2.WfbWzyTy_UEDK9.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;773&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;building-the-gamegrid-component&quot;&gt;Building the GameGrid Component&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/top-down-view-of-grid.awLQgnyI_CBtKL.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The heart of the game&amp;#39;s UI is the &lt;code&gt;GameGrid&lt;/code&gt; component, situated within the &lt;code&gt;lib/components&lt;/code&gt; folder. This component is tasked with displaying the current state of the grid and enabling the toggling of lights on and off. It acts as a direct reflection of the game&amp;#39;s state, providing a visual and interactive element that captures the essence of the game.&lt;/p&gt;
&lt;p&gt;In the construction of the &lt;code&gt;GameGrid&lt;/code&gt; component, I harnessed several of Svelte&amp;#39;s standout features to create a dynamic and interactive display of the game&amp;#39;s grid. Utilizing &lt;code&gt;export let&lt;/code&gt;, I exposed essential props such as &lt;code&gt;data&lt;/code&gt;, representing the grid&amp;#39;s current state with a two-dimensional boolean array, and &lt;code&gt;onLightPressed&lt;/code&gt;, a callback function for handling light toggling events. This setup allows the component to reactively display the grid&amp;#39;s state and respond to player interactions, directly tying the visual elements to the game&amp;#39;s logic.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; let&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; onLightPressed&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To visually represent the grid, I employed dynamic styling and layout techniques, adjusting the grid&amp;#39;s appearance based on its state. Variables like &lt;code&gt;blockSize&lt;/code&gt; for the size of each light block and &lt;code&gt;blockGap&lt;/code&gt; for the spacing between blocks were introduced to fine-tune the grid&amp;#39;s look and feel. The grid&amp;#39;s layout, leveraging CSS grid properties, is dynamically generated to fit the dimensions of the &lt;code&gt;data&lt;/code&gt; prop, showcasing Svelte&amp;#39;s ability to intertwine reactive data with CSS for a seamless UI experience.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; blockSize&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 50&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; blockGap&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  style&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;border: 1px solid #000; width: fit-content; background-color: #dedede;&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    style&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;display: grid; grid-template-columns: repeat(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;blockSize&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px); grid-template-rows: repeat(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;blockSize&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px); grid-gap: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;blockGap&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px; width: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; blockSize&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; blockGap&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; blockGap&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px; background-color: #fff; margin: 20px;&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The core of the grid&amp;#39;s interactivity is facilitated through Svelte&amp;#39;s &lt;code&gt;#each&lt;/code&gt; block, iterating over the &lt;code&gt;data&lt;/code&gt; array to render each light as a customizable button. This approach not only streamlines the rendering process but also embeds interactivity directly within the grid&amp;#39;s structure, enabling players to toggle lights on and off in their quest to solve the puzzle.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; col&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      style&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;background-color: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ?&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;#f00&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &apos;#000&apos;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;; width: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;blockSize&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px; height: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;blockSize&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;px;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; onLightPressed&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;each&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By integrating these features and techniques, the &lt;code&gt;GameGrid&lt;/code&gt; component not only serves as a visual representation of the game&amp;#39;s current state but also as a bridge between the player and the game&amp;#39;s underlying logic. The result is a component that is both functional and engaging.&lt;/p&gt;
&lt;h2 id=&quot;building-the-game-page&quot;&gt;Building the Game Page&lt;/h2&gt;
&lt;p&gt;The game page, created as another route (&lt;code&gt;routes/game/+page.svelte&lt;/code&gt;), hosts the &lt;code&gt;GameGrid&lt;/code&gt; component. It&amp;#39;s here that the &lt;code&gt;GameEngine&lt;/code&gt; is initialized, marrying the backend logic with the frontend display. This page serves as the operational hub, where players can start and restart the game, diving into the challenge Make It Dark presents.&lt;/p&gt;
&lt;p&gt;Integrating the game logic into a user interface brings the gameplay experience to the forefront, facilitated by the powerful features of Svelte. The game page serves as the interactive canvas where players engage with the game, utilizing the foundational classes developed earlier—&lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, &lt;code&gt;WinConditionChecker&lt;/code&gt;—through the orchestrating &lt;code&gt;GameEngine&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;integrating-the-game-logic&quot;&gt;Integrating the Game Logic&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/engine&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/components/GameGrid.svelte&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  );&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; moves&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This script sets the stage, initializing the &lt;code&gt;GameEngine&lt;/code&gt; with its necessary dependencies and defining reactive variables to track the game&amp;#39;s state, moves, and grid status. It emphasizes how Svelte&amp;#39;s reactivity system makes it straightforward to connect game logic with UI elements, ensuring updates are efficiently managed and rendered.&lt;/p&gt;
&lt;h3 id=&quot;facilitating-player-interaction&quot;&gt;Facilitating Player Interaction&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;actions&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Start&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Reset&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; onLightPressed&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Moves: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;moves&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; won&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h2&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;You won!&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h2&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The game&amp;#39;s interactivity is showcased here, with buttons for starting and restarting the game and the conditional rendering of the &lt;code&gt;GameGrid&lt;/code&gt; component and move counter based on the game&amp;#39;s state. The &lt;code&gt;GameGrid&lt;/code&gt; component, in particular, is a direct reflection of the game&amp;#39;s current grid state, allowing players to toggle lights in an attempt to solve the puzzle.&lt;/p&gt;
&lt;h3 id=&quot;styling-for-engagement&quot;&gt;Styling for Engagement&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  .full-height&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;min-height&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 100vh&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  .actions&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;display&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; flex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;justify-content&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; center&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;gap&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 20px&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  .actions&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt; button&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;padding&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 2em&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;text-align&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; center&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  .game-section&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;display&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; flex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;justify-content&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; center&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The styling emphasizes the game&amp;#39;s UI, focusing on usability and visual appeal. The flexible CSS ensures that the game components are not only accessible and interactive but also pleasing to the eye, enhancing the overall player experience.&lt;/p&gt;
&lt;p&gt;This implementation illustrates a seamless bridge between the game engine and its presentation layer by weaving together Svelte&amp;#39;s reactivity and component-based architecture with the game&amp;#39;s logic.&lt;/p&gt;
&lt;h2 id=&quot;creating-the-game-page&quot;&gt;Creating the Game page&lt;/h2&gt;
&lt;p&gt;Creating the game page for Make It Dark within the Svelte framework marks a pivotal moment where the game&amp;#39;s underlying logic seamlessly integrates with an interactive user interface. This page, located at &lt;code&gt;routes/game/+page.svelte&lt;/code&gt;, serves as the main arena where players engage with the game, embodying the start, play, and reset functions within an aesthetically pleasing and intuitive layout.&lt;/p&gt;
&lt;p&gt;The script section begins by importing the essential game logic components—&lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, &lt;code&gt;WinConditionChecker&lt;/code&gt;—and weaving them into the &lt;code&gt;GameEngine&lt;/code&gt;. This foundational setup ensures that the game&amp;#39;s mechanics are primed for execution. Additionally, the &lt;code&gt;GameGrid&lt;/code&gt; component is imported to visually depict the game&amp;#39;s grid, facilitating direct interaction through light toggles.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/engine&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/components/GameGrid.svelte&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    started&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;hasWon&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This script meticulously tracks the game&amp;#39;s progress through reactive variables such as &lt;code&gt;started&lt;/code&gt;, &lt;code&gt;won&lt;/code&gt;, and &lt;code&gt;grid&lt;/code&gt;, responding dynamically to user interactions. The functions &lt;code&gt;startGame&lt;/code&gt;, &lt;code&gt;restartGame&lt;/code&gt;, and &lt;code&gt;toggleLight&lt;/code&gt; manage the game&amp;#39;s lifecycle and player interactions, updating the game state as appropriate.&lt;/p&gt;
&lt;p&gt;The HTML structure, enriched by Svelte&amp;#39;s reactive blocks, animates the game&amp;#39;s interface:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;full-height&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;wrapper style1 special&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;major&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h1&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Make It Dark&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h1&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Click on the lights to turn them off. The goal is to turn off all the lights.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;actions&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Start&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;        &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; on&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;restartGame&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Reset&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; won&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;wrapper style3 special&quot;&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h2&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;You won!&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;h2&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; onLightPressed&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  {/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This configuration prioritizes user experience, presenting control buttons and game instructions prominently. Conditional rendering, based on the game&amp;#39;s phase—whether in progress or concluded—ensures active engagement by providing immediate visual feedback on the player&amp;#39;s actions.&lt;/p&gt;
&lt;p&gt;Styled elements underscore the page&amp;#39;s visual appeal, making the game elements not only operational but also visually harmonious and inviting. This deliberate design and style strategy ensures the game page is more than a mere interface for logic; it&amp;#39;s a welcoming space that captures and holds player interest.&lt;/p&gt;
&lt;p&gt;However, an initial oversight led to the game always starting with an empty grid, inadvertently simplifying the challenge to an immediate win condition. This revelation highlights the iterative essence of game development, where gameplay refinement and testing are integral to crafting a compelling and challenging experience.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui-3.wm2OB9jv_Z1NULXU.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;777&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;swiftly-implementing-the-gridrandomizer-class&quot;&gt;Swiftly implementing the &lt;code&gt;GridRandomizer&lt;/code&gt; class&lt;/h2&gt;
&lt;p&gt;Discovering the game consistently initiated with an empty grid illuminated a crucial oversight in the initial design, leading to an unintended shortcut to victory. To inject complexity and unpredictability into the game&amp;#39;s startup, the &lt;code&gt;GridRandomizer&lt;/code&gt; class was conceptualized. This addition aimed to diversify the grid&amp;#39;s initial state, ensuring a challenging and engaging experience from the very start. The &lt;code&gt;GridRandomizer&lt;/code&gt; class, with its function to randomize the grid, was then seamlessly integrated into the &lt;code&gt;GameEngine&lt;/code&gt;, enhancing the gameplay with minimal structural impact yet significantly enriching its value.&lt;/p&gt;
&lt;h3 id=&quot;unit-tests-for-gridrandomizer&quot;&gt;Unit Tests for &lt;code&gt;GridRandomizer&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;To validate the efficacy and reliability of the &lt;code&gt;GridRandomizer&lt;/code&gt;, a series of unit tests were constructed:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;vitest&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GridRandomizer&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;GridRandomizer&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;randomize&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should randomize the grid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; randomizedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;randomize&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;randomizedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should randomize the grid with a 50% chance of being true&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; randomizedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;randomize&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;      // Testing the randomness involves checking the grid does not become uniformly true,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;      // implying there&apos;s a balanced chance for each cell to be true or false.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;randomizedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;These tests focus on ensuring that the &lt;code&gt;randomize&lt;/code&gt; function effectively alters the grid from its initial state, introducing a mix of true (on) and false (off) values across the grid. This randomness mimics the unpredictable nature of the game, providing a fresh challenge with each new session.&lt;/p&gt;
&lt;h4 id=&quot;implementation-of-gridrandomizer&quot;&gt;Implementation of &lt;code&gt;GridRandomizer&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;The &lt;code&gt;GridRandomizer&lt;/code&gt; class is succinct yet powerful in its ability to transform the game&amp;#39;s dynamics:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  randomize&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;random&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt; 0.5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By iterating over each cell of the provided grid and deciding its state (on or off) based on a 50% probability, &lt;code&gt;GridRandomizer&lt;/code&gt; ensures the game begins with a challenging and unpredictable setup. This simple approach, leveraging JavaScript&amp;#39;s &lt;code&gt;Math.random&lt;/code&gt;, introduces the desired variability without complicating the game&amp;#39;s logic or the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s implementation.&lt;/p&gt;
&lt;p&gt;This addition to the game&amp;#39;s logic layer meant that the &lt;code&gt;GameEngine&lt;/code&gt; needed to integrate &lt;code&gt;GridRandomizer&lt;/code&gt; effectively, ensuring its use had a minimal impact on the existing structure while significantly enhancing gameplay value.&lt;/p&gt;
&lt;h3 id=&quot;integration-into-the-gameengine&quot;&gt;Integration into the &lt;code&gt;GameEngine&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;GridRandomizer&lt;/code&gt;&amp;#39;s introduction into the game&amp;#39;s framework underscores a critical enhancement in the gameplay mechanics. By modifying the &lt;code&gt;GameEngine&lt;/code&gt; to incorporate the &lt;code&gt;GridRandomizer&lt;/code&gt;, the initial grid setup now presents a varied landscape of lights, setting the stage for a more dynamic and engaging player experience.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Newly added dependency&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  ) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridRandomizer&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;randomize&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With this integration, the &lt;code&gt;GameEngine&lt;/code&gt; now leverages the &lt;code&gt;GridRandomizer&lt;/code&gt; to ensure that each game begins with a grid that&amp;#39;s both challenging and engaging, effectively addressing the previously identified flaw. This enhancement not only maintains the integrity of the game&amp;#39;s design but also enriches the player&amp;#39;s experience by offering a genuinely unpredictable and enjoyable puzzle with each new game.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui-4.DC5TyUu6_ZlG1lf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;777&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;adding-additional-functionality&quot;&gt;Adding Additional Functionality&lt;/h2&gt;
&lt;p&gt;To enhance gameplay, a move counter was incorporated into the game page. This feature allows players to track the number of moves made, fostering a competitive spirit as they seek to outdo their past performances or compete with others.&lt;/p&gt;
&lt;h4 id=&quot;implementing-move-tracking&quot;&gt;Implementing Move Tracking&lt;/h4&gt;
&lt;p&gt;Integrating move tracking into the game required minimal adjustments to the existing codebase, demonstrating Svelte&amp;#39;s ease in facilitating dynamic updates. The main concept revolves around incrementing a &lt;code&gt;moves&lt;/code&gt; counter each time a player toggles a light, providing immediate feedback on their progress and strategy efficiency.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/engine&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  import&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;$lib/components/GameGrid.svelte&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; moves&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Initialized move counter&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    started&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    moves&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Reset moves counter when game starts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  function&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rowIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;colIndex&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;getGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    won&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; engine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;hasWon&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    moves&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; +=&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;// Increment moves counter on each light toggle&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This addition to the script section subtly enhances the game&amp;#39;s depth, making each session more meaningful as players can now reflect on their approach through the quantifiable metric of moves made.&lt;/p&gt;
&lt;h4 id=&quot;displaying-move-count-to-players&quot;&gt;Displaying Move Count to Players&lt;/h4&gt;
&lt;p&gt;To make this new data point visible and useful to players, the game&amp;#39;s UI needed to display the move count in a clear and intuitive manner. This was achieved by adding a simple paragraph element to the game page, updating reactively with each move:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;svelte&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{#&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; started&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt;GameGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; data&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; onLightPressed&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;Moves: &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;moves&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt; &amp;#x3C;!-- Displaying the move count --&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;{/&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This straightforward addition, nestled within the conditional rendering block that checks if the game has started, ensures that the move count is only displayed during active gameplay, keeping the interface clean and focused.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-hooking-up-the-engine-to-the-ui-5.CGzcIf9z_Z26hOBp.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;777&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;automated-game-testing-function&quot;&gt;Automated Game Testing Function&lt;/h2&gt;
&lt;p&gt;In an effort to rigorously test the game&amp;#39;s mechanics, I implemented a function capable of automatically playing the game. Initially tested with a 3x3 grid for efficiency, this function highlighted the game&amp;#39;s scalability challenges when expanding to a 5x5 grid, where the randomness of moves significantly increased the difficulty.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;ts&quot;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  setInterval&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;started&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x26;&amp;#x26;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;won&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; cols&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;floor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;random&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;floor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;Math&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;random&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; cols&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.DxqsMuiB_Z2bkhgi.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Reaching the end of this project marks a significant milestone in exploring Svelte and TDD. The journey from conceptualizing the game&amp;#39;s mechanics to realizing them through code and finally presenting them within an interactive UI has been both challenging and rewarding. While there remains potential for further exploration, particularly in testing the UI, the foundation established provides a solid base for future enhancements.&lt;/p&gt;
&lt;p&gt;Thank you for joining me on this exploration of Svelte and TDD. The process of bringing Make It Dark from a collection of ideas to a playable game has been a testament to the power of systematic development and the capabilities of modern web technologies.&lt;/p&gt;
&lt;p&gt;You can find the code on my Github account at &lt;a href=&quot;https://github.com/mrstebo/make-it-dark?ref=mrstebo.co.uk&quot; rel=&quot;noopener&quot;&gt;https://github.com/mrstebo/make-it-dark&lt;/a&gt;&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Svelte</category><category>Software Architecture</category><category>Software Engineering</category><category>Test Driven Development</category></item><item><title>Make It Dark - Putting the Engine Together</title><link>https://www.mrstebo.co.uk/make-it-dark-putting-the-engine-together/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/make-it-dark-putting-the-engine-together/</guid><description>After constructing the core classes for Make It Dark—GridManager, LightToggleStrategy, and WinConditionChecker—the next step is to develop the GameEngine. This phase involves integrating these components to work together seamlessly. The…</description><pubDate>Mon, 19 Feb 2024 08:55:36 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-putting-the-engine-together.wcTsWOLB_Z6EKPf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;478&quot;&gt;&lt;/p&gt;
&lt;p&gt;After constructing the core classes for Make It Dark—&lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt;—the next step is to develop the &lt;code&gt;GameEngine&lt;/code&gt;. This phase involves integrating these components to work together seamlessly. The process so far has adhered to a Test-Driven Development (TDD) approach, ensuring that each component functions correctly before integration. This methodology has kept the development focused, allowing for the addition of only necessary features and avoiding extraneous code.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;GameEngine&lt;/code&gt; is envisioned as the central mechanism that orchestrates the game&amp;#39;s logic, managing the grid, toggling lights according to player actions, and checking for win conditions. The aim is to unify the previously developed components into a single entity that dictates the overall game flow and interaction.&lt;/p&gt;
&lt;p&gt;In this next stage, the emphasis is on the practical application of these components within the &lt;code&gt;GameEngine&lt;/code&gt;. While TDD has provided a structured framework for developing the individual pieces, the focus now shifts to their integration. This involves ensuring that the &lt;code&gt;GameEngine&lt;/code&gt; effectively utilizes each component, maintaining the game&amp;#39;s integrity and interactive capabilities. The process is straightforward: define the engine&amp;#39;s responsibilities, test its interactions with the components, and implement the necessary logic to fulfil its role in the game.&lt;/p&gt;
&lt;p&gt;By proceeding with this integration, the goal is to complete a functional &lt;code&gt;GameEngine&lt;/code&gt; that serves as the backbone of the game, driving forward the gameplay experience without unnecessary complexity.&lt;/p&gt;
&lt;h2 id=&quot;the-role-of-the-gameengine&quot;&gt;The Role of the &lt;code&gt;GameEngine&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/car-engine.CxK8eDRA_1Eimv5.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;GameEngine&lt;/code&gt; in Make It Dark is the linchpin that brings together all the components of the game, ensuring they work in concert to deliver a coherent gameplay experience. Its responsibilities are multifaceted: initializing the game grid, processing player actions like toggling lights, and evaluating the game&amp;#39;s win condition. Essentially, the &lt;code&gt;GameEngine&lt;/code&gt; acts as the mediator between the player and the game&amp;#39;s logic, managing the state of the game from start to victory or reset. This central role necessitates a robust and flexible design that can handle the dynamic nature of gameplay, adapting to player actions and game events efficiently.&lt;/p&gt;
&lt;h2 id=&quot;defining-tests-for-the-gameengine&quot;&gt;Defining Tests for the &lt;code&gt;GameEngine&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/engine-being-tested.KjMvNjON_Z8ITQO.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;To validate the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s functionality and its interaction with other components, a comprehensive suite of tests is essential. These tests are designed to ensure that the &lt;code&gt;GameEngine&lt;/code&gt; not only performs its expected duties but does so reliably under various scenarios:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Grid Creation at Game Start&lt;/strong&gt;: Ensures the game correctly initializes the grid through the &lt;code&gt;GridManager&lt;/code&gt; at the start of each game session.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grid Reset Functionality&lt;/strong&gt;: Verifies the engine&amp;#39;s ability to reset the grid to its initial state, allowing players to restart the game from a clean slate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restriction on Restarting the Game&lt;/strong&gt;: Confirms that attempts to restart or reset the game without it being started first are handled properly, preventing invalid game states.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handling Light Toggles&lt;/strong&gt;: Tests the engine&amp;#39;s capability to process light toggling actions by the player and reflect these changes accurately in the grid&amp;#39;s state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Toggling Lights Before Game Start&lt;/strong&gt;: Checks that the engine does not allow light toggling if the game has not been initiated, maintaining logical game flow.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Win Condition Assessment&lt;/strong&gt;: Ensures the &lt;code&gt;GameEngine&lt;/code&gt; can accurately determine whether the win condition has been met based on the current state of the grid.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Win Condition Check Before Game Start&lt;/strong&gt;: Verifies that the engine restricts win condition checks to valid game sessions, enhancing the game&amp;#39;s integrity and logical structure.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These tests are foundational for developing the &lt;code&gt;GameEngine&lt;/code&gt;, setting clear criteria for its expected behaviour and interactions within the game. Through careful implementation of these tests, the engine is shaped into a reliable and effective conductor of the game&amp;#39;s logic, ready to respond to player actions and guide the gameplay experience.&lt;/p&gt;
&lt;h2 id=&quot;building-functionality-in-the-gameengine&quot;&gt;Building Functionality in the &lt;code&gt;GameEngine&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/top-down-view-of-tools.BCastOam_1A0IMr.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;With the &lt;code&gt;GameEngine&lt;/code&gt; acting as the orchestrator for Make It Dark, the focus now shifts to implementing its functionalities, guided by the suite of tests designed to ensure each component integrates smoothly. This suite is designed to validate the engine&amp;#39;s ability to integrate and utilize its dependencies—&lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt;—effectively. The goal is to confirm that the &lt;code&gt;GameEngine&lt;/code&gt; can manage the game&amp;#39;s state, respond to player actions, and determine the game&amp;#39;s outcome based on the rules defined by these components.&lt;/p&gt;
&lt;h3 id=&quot;initial-test-suite-setup&quot;&gt;Initial Test Suite Setup&lt;/h3&gt;
&lt;p&gt;The setup process involves creating instances of the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s dependencies and injecting them into the &lt;code&gt;GameEngine&lt;/code&gt;. This approach not only facilitates the testing of the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s functionality in isolation but also ensures that its interactions with the dependencies are as expected.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;vitest&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./WinConditionChecker&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./LightToggleStrategy&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GridManager&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GameEngine&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;GameEngine&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gameEngine&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gridManager&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This setup is critical for the subsequent development and testing of the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s methods. It ensures that each component the engine depends on is correctly instantiated and available for use within the tests.&lt;/p&gt;
&lt;p&gt;Following the setup of the test suite, the &lt;code&gt;GameEngine&lt;/code&gt; class is implemented to accept its dependencies through constructor injection. This design allows for flexible integration with the &lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt;, providing the &lt;code&gt;GameEngine&lt;/code&gt; with the necessary tools to control the game&amp;#39;s logic.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  ) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The constructor of the &lt;code&gt;GameEngine&lt;/code&gt; is straightforward, receiving instances of the grid manager, light toggle strategy, and win condition checker. This setup not only facilitates unit testing by allowing for mock implementations to be injected but also aligns with principles of good software design, such as dependency inversion and single responsibility.&lt;/p&gt;
&lt;p&gt;With this initial setup complete, the foundation is laid for developing and testing the &lt;code&gt;GameEngine&lt;/code&gt;&amp;#39;s functionality. The focus will shift to implementing the engine&amp;#39;s methods to start the game, toggle lights, check win conditions, and handle game resets, each guided by the tests defined in the suite. This methodical approach ensures that the &lt;code&gt;GameEngine&lt;/code&gt; is thoroughly vetted and capable of seamlessly orchestrating the game&amp;#39;s complex interactions.&lt;/p&gt;
&lt;h2 id=&quot;the-startgame-method&quot;&gt;The &lt;code&gt;startGame&lt;/code&gt; Method&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;startGame&lt;/code&gt; method is a crucial part of the &lt;code&gt;GameEngine&lt;/code&gt; in Make It Dark, responsible for initializing the game state. This includes creating the initial grid layout that players will interact with. The method&amp;#39;s functionality is verified through a targeted test, designed to ensure that &lt;code&gt;startGame&lt;/code&gt; correctly invokes the &lt;code&gt;GridManager&lt;/code&gt;&amp;#39;s &lt;code&gt;createGrid&lt;/code&gt; method with the appropriate dimensions for the grid.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;p&gt;The test checks whether the &lt;code&gt;GridManager&lt;/code&gt;&amp;#39;s &lt;code&gt;createGrid&lt;/code&gt; method is called with specific arguments when &lt;code&gt;startGame&lt;/code&gt; is invoked. This is crucial for verifying that the game grid is initialized correctly at the beginning of each game session.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;startGame&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should call gridManager.createGrid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; createGridSpy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; vi&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;spyOn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;createGrid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;createGridSpy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toHaveBeenCalledWith&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#2EE2FA&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To support this test, spying on the &lt;code&gt;GridManager&lt;/code&gt;&amp;#39;s &lt;code&gt;createGrid&lt;/code&gt; method is accomplished using &lt;code&gt;vi.spyOn&lt;/code&gt; from Vitest, allowing the test to verify that &lt;code&gt;startGame&lt;/code&gt; correctly delegates grid initialization to the &lt;code&gt;GridManager&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;In the &lt;code&gt;GameEngine&lt;/code&gt;, the &lt;code&gt;startGame&lt;/code&gt; method&amp;#39;s implementation is designed to meet the expectations set by the test. It ensures that the game grid is initialized and correctly sets up the grid dimensions.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  constructor&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; readonly&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  ) {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this implementation, &lt;code&gt;startGame&lt;/code&gt; creates the grid using &lt;code&gt;GridManager&lt;/code&gt;&amp;#39;s &lt;code&gt;createGrid&lt;/code&gt;, storing the result in &lt;code&gt;initialGrid&lt;/code&gt; and copying it to &lt;code&gt;grid&lt;/code&gt; for game play. This ensures that the original state can be restored if needed, for instance, during a game reset.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-putting-the-engine-together-1.BgXDPsCA_1wYnNm.jpg&quot; alt=&quot;&quot; width=&quot;536&quot; height=&quot;217&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;resetting-mocks-with-aftereach&quot;&gt;Resetting Mocks with &lt;code&gt;afterEach&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;To ensure the reliability of tests, especially when using spies or mocks, it&amp;#39;s important to reset them after each test. This prevents test interference and ensures that mocks/spies are clean for each test case.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;javascript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;afterEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;  vi&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;restoreAllMocks&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;afterEach&lt;/code&gt; hook calls &lt;code&gt;vi.restoreAllMocks()&lt;/code&gt; to reset all mocking behaviour, ensuring that each test starts with a clean slate. This practice is essential for maintaining test isolation and reliability, especially when tests depend on mocking library functionalities like spying on method calls.&lt;/p&gt;
&lt;h2 id=&quot;the-restartgame-method&quot;&gt;The &lt;code&gt;restartGame&lt;/code&gt; Method&lt;/h2&gt;
&lt;p&gt;The introduction of the &lt;code&gt;restartGame&lt;/code&gt; method within the &lt;code&gt;GameEngine&lt;/code&gt; serves a pivotal role, offering players the capability to reset their current game to its initial state. This functionality is particularly valuable as it permits a fresh start without necessitating a complete exit and re-entry into the game, enhancing the overall player experience. The method leverages the initial grid setup, preserved by the &lt;code&gt;GameEngine&lt;/code&gt;, to efficiently revert the game back to its starting conditions.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;restartGame&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should reset the game to its initial state&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; createGridSpy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; vi&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;spyOn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;createGrid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;createGridSpy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toHaveBeenCalledTimes&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The testing of the &lt;code&gt;restartGame&lt;/code&gt; method is two-fold. The first test ensures the game can be reset to its initial setup without making additional calls to &lt;code&gt;gridManager.createGrid&lt;/code&gt;, which would imply unnecessary reinitialization of the grid. This verifies the method&amp;#39;s capability to revert the game state effectively. The second test is critical for maintaining the game&amp;#39;s logical flow, checking that attempting to reset the game without it being initially started results in an error. This error handling prevents illogical game state manipulations, ensuring that reset actions are only possible within a valid game session context.&lt;/p&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;To meet the specifications outlined by the tests, the implementation of &lt;code&gt;restartGame&lt;/code&gt; is methodically developed.&lt;/p&gt;
&lt;p&gt;The class is prepared with private fields to track the game&amp;#39;s grid states, ensuring there&amp;#39;s a record of the initial setup to revert to upon reset.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The core of &lt;code&gt;restartGame&lt;/code&gt; involves resetting the &lt;code&gt;grid&lt;/code&gt; to mirror the &lt;code&gt;initialGrid&lt;/code&gt;, effectively restarting the game. This operation is conditional on the game having been started, as indicated by the presence of an initial grid setup.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  restartGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This structured approach ensures that &lt;code&gt;restartGame&lt;/code&gt; not only provides the functionality for resetting the game but does so in a manner that respects the game&amp;#39;s state and logical progression. By implementing this method in line with the outlined tests, the &lt;code&gt;GameEngine&lt;/code&gt; enhances its ability to manage game states efficiently, offering players a seamless mechanism to restart their game within a valid session.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-putting-the-engine-together-2.CD_kJA72_TEJrW.jpg&quot; alt=&quot;&quot; width=&quot;531&quot; height=&quot;214&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-togglelight-method&quot;&gt;The &lt;code&gt;toggleLight&lt;/code&gt; Method&lt;/h2&gt;
&lt;p&gt;Integrating the &lt;code&gt;toggleLight&lt;/code&gt; method into the &lt;code&gt;GameEngine&lt;/code&gt; brings a crucial aspect of gameplay to life, allowing players to interact with the grid by toggling lights. This method directly engages with the &lt;code&gt;LightToggleStrategy&lt;/code&gt; to update the grid&amp;#39;s state based on the player&amp;#39;s action, reflecting the core interactive element of Make It Dark. It&amp;#39;s this interaction that drives the game forward, challenging players to achieve the win condition.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;toggleLight&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should call lightToggleStrategy.toggle&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; toggleLightSpy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; vi&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;spyOn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;toggle&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;toggleLightSpy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The tests for the &lt;code&gt;toggleLight&lt;/code&gt; method serve a dual purpose. Firstly, they verify that the method successfully invokes the &lt;code&gt;LightToggleStrategy&lt;/code&gt;&amp;#39;s &lt;code&gt;toggle&lt;/code&gt; function, essential for changing the state of the grid in response to player input. This ensures that the game engine can effectively update the grid according to the game&amp;#39;s rules. Secondly, they assess the method&amp;#39;s error handling by expecting an error when a toggle attempt is made before the game&amp;#39;s initiation. This is vital for maintaining the integrity of the game&amp;#39;s logic, ensuring that interactions only occur during an active game session.&lt;/p&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;To satisfy the test conditions, the &lt;code&gt;toggleLight&lt;/code&gt; method implementation is straightforward yet critical for the game&amp;#39;s interactivity:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GridManager&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./LightToggleStrategy&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./WinConditionChecker&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggleLight&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;    this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;y&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This method first checks if the game has been started by verifying the &lt;code&gt;initialGrid&lt;/code&gt;&amp;#39;s presence. If the game hasn&amp;#39;t started, it throws an error, adhering to the logical flow of the game. Upon confirming the game&amp;#39;s active status, it proceeds to call the &lt;code&gt;LightToggleStrategy&lt;/code&gt;&amp;#39;s &lt;code&gt;toggle&lt;/code&gt; function with the current grid and the specified coordinates, effectively updating the grid state based on the toggle action. This update reflects the core gameplay mechanic, allowing players to interact with the game by changing the grid&amp;#39;s light configuration in their quest to meet the win condition.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-putting-the-engine-together-3.C2Pwt2W8_Z2qQ8IM.jpg&quot; alt=&quot;&quot; width=&quot;518&quot; height=&quot;212&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-haswon-method&quot;&gt;The &lt;code&gt;hasWon&lt;/code&gt; Method&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;hasWon&lt;/code&gt; method within the &lt;code&gt;GameEngine&lt;/code&gt; plays a critical role in determining the outcome of the game. By assessing the current state of the grid, it utilizes the &lt;code&gt;WinConditionChecker&lt;/code&gt; to ascertain whether the player has met the conditions for victory. This method embodies the moment of truth for the player&amp;#39;s efforts, translating the grid&amp;#39;s configuration into a clear win or continue playing scenario.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;hasWon&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should call winConditionChecker.check&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; checkSpy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; vi&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;spyOn&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;check&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;startGame&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;hasWon&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;checkSpy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;hasWon&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The testing for &lt;code&gt;hasWon&lt;/code&gt; focuses on two main aspects. The first test ensures that upon calling &lt;code&gt;hasWon&lt;/code&gt;, the &lt;code&gt;GameEngine&lt;/code&gt; indeed utilizes the &lt;code&gt;WinConditionChecker&lt;/code&gt;&amp;#39;s &lt;code&gt;check&lt;/code&gt; method to evaluate the win condition. This is fundamental for integrating the win condition logic seamlessly into the game&amp;#39;s engine, providing a definitive answer to whether the game&amp;#39;s objective has been achieved. The second test addresses the game&amp;#39;s flow integrity by asserting that an error is thrown if there&amp;#39;s an attempt to check the win condition before the game officially starts, ensuring that game actions align with the game&amp;#39;s state.&lt;/p&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;To align with the tests and fulfil the method&amp;#39;s purpose, the &lt;code&gt;hasWon&lt;/code&gt; implementation is straightforward yet pivotal for gameplay:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GridManager&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./LightToggleStrategy&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./WinConditionChecker&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GameEngine&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; initialGrid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  private&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#848BBD;font-style:italic&quot;&gt;  // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  hasWon&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;initialGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Game has not started yet&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt; this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FE4450;font-weight:bold&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This method first checks whether the game has been initiated by verifying the &lt;code&gt;initialGrid&lt;/code&gt;&amp;#39;s existence. If not, it prevents further action by throwing an error, maintaining the consistency of game actions within the game&amp;#39;s lifecycle. Once it&amp;#39;s established that the game is in progress, &lt;code&gt;hasWon&lt;/code&gt; proceeds to consult the &lt;code&gt;WinConditionChecker&lt;/code&gt;, passing the current grid state for evaluation. The return value of &lt;code&gt;check&lt;/code&gt; directly determines the method&amp;#39;s output, effectively concluding if the win condition is met based on the grid&amp;#39;s current configuration.&lt;/p&gt;
&lt;p&gt;Implementing the &lt;code&gt;hasWon&lt;/code&gt; method with a precise focus on the outlined tests ensures that the &lt;code&gt;GameEngine&lt;/code&gt; robustly supports essential gameplay functionality, offering a clear mechanism to determine game outcomes. This approach not only integrates the win condition logic effectively into the game&amp;#39;s engine but also reinforces the importance of aligning game interactions with the state of the game, enhancing the overall gaming experience.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-putting-the-engine-together-4.K2QqEZJj_Z2ofcuF.jpg&quot; alt=&quot;&quot; width=&quot;520&quot; height=&quot;214&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.Bd7t4UrJ_12OoO2.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;And just like that, the heart of Make It Dark begins to beat with a rhythm all its own. Through the thoughtful assembly of &lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt; into the &lt;code&gt;GameEngine&lt;/code&gt;, what was once a collection of individual components now stands as a cohesive unit, ready to bring the game to life. It’s a bit like conducting an orchestra where each section has been practising in isolation, and now, under the baton of the &lt;code&gt;GameEngine&lt;/code&gt;, they come together in harmony.&lt;/p&gt;
&lt;p&gt;This journey of composition has not just been about ensuring that each part fits; it&amp;#39;s been about creating something greater than the sum of its parts. The &lt;code&gt;GameEngine&lt;/code&gt; doesn&amp;#39;t just manage the state of the game; it breathes life into it, transforming static grids and rules into an interactive experience that&amp;#39;s ready to engage and challenge players.&lt;/p&gt;
&lt;p&gt;With the &lt;code&gt;GameEngine&lt;/code&gt; in place, the path is clear for the next adventure: integrating this engine with a user interface. The prospect of seeing the engine interact with player inputs and respond on a visual canvas is thrilling. It’s one thing to know the engine works as intended, quite another to see it in action, bringing joy, frustration, and triumph to players as they navigate through the game.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-blone-man-holding.Cafc-Ndi_Z1wA9GT.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In the next post, the focus will shift from the backend logic to the frontend spectacle. The &lt;code&gt;GameEngine&lt;/code&gt; will serve as the backbone for the UI, translating player actions into game responses and, ultimately, into victory or defeat. This upcoming phase promises not just to showcase the functionality of the game but to encapsulate the essence of what makes Make It Dark engaging and fun 🥳.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Svelte</category><category>Software Architecture</category><category>Test Driven Development</category><category>Testing Frameworks</category></item><item><title>Make It Dark - Turning Requirements into Code</title><link>https://www.mrstebo.co.uk/make-it-dark-turning-requirements-into-code/</link><guid isPermaLink="true">https://www.mrstebo.co.uk/make-it-dark-turning-requirements-into-code/</guid><description>Ah, finally, the moment has arrived where we transition from meticulous planning to the exciting phase of writing code. Up to this point, the focus has been on laying a robust foundation: establishing the project&apos;s architecture, embracing…</description><pubDate>Wed, 14 Feb 2024 07:30:25 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code.3F8YFLNE_ZOjpr9.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;Ah, finally, the moment has arrived where we transition from meticulous planning to the exciting phase of writing code. Up to this point, the focus has been on laying a robust foundation: establishing the project&amp;#39;s architecture, embracing the principles of Test-Driven Development (TDD), and refining my coding style and linting preferences. The integration of Git hooks has also played a crucial role, ensuring every push to the repository adheres to consistent, high-quality standards. Now, it&amp;#39;s time to bring all these preparations into fruition, translating the carefully gathered requirements into functional, well-tested code.&lt;/p&gt;
&lt;h2 id=&quot;the-development-approach&quot;&gt;The Development Approach&lt;/h2&gt;
&lt;p&gt;As the coding phase begins, my strategy is rooted in clarity and precision. The transition from requirements to code involves a systematic process guided by the principles of Test-Driven Development (TDD). This approach is crucial for ensuring that each feature is not only necessary but implemented accurately and effectively.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Setting Up Test Suites&lt;/strong&gt;: The first step in addressing each requirement is establishing the structure of the test suite. Initially, these test suites will be &lt;em&gt;outlines&lt;/em&gt;, framing the scope and nature of the tests that will follow. This stage is about creating a clear roadmap for the detailed testing and validation of each functionality.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detailing Individual Tests&lt;/strong&gt;: With the framework set, the focus shifts to fleshing out each specific test. Here, the purpose and necessity of every test are explored, elucidating how it contributes to fulfilling the corresponding requirement. This phase is integral, not just for functionality checks but for gaining a deeper understanding of the role each test plays in the game&amp;#39;s mechanics.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coding to Fulfill Tests&lt;/strong&gt;: The final and crucial step is the coding process. In this phase, the outlined tests become the driving force behind the development of functionalities. The process involves writing code, rigorously testing it against the predefined tests, and refining it through iterative development and refactoring.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This approach is designed to ensure that every piece of code is purposeful and contributes meaningfully to the overall gameplay experience. By adhering to TDD, the development is structured and focused, ensuring that the game not only functions as intended but does so in a way that aligns seamlessly with the game’s core objectives. This disciplined methodology sets the stage for building a game that is both engaging and technically sound.&lt;/p&gt;
&lt;h2 id=&quot;object-oriented-programming&quot;&gt;Object-Oriented Programming&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/uml-diagram-of-class.DgkvGdoU_2quNWf.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;In shaping the codebase for Make It Dark, my inclination towards Object-Oriented Programming (OOP), stemming from my extensive experience with languages like C# and Java, plays a pivotal role. I’ve chosen to structure the game’s logic using classes (apologies, Ash 🥲), a decision that aligns with my familiarity and comfort with OOP principles. This approach not only aids in organizing the code into logical, manageable units but also facilitates maintainability and scalability. Let&amp;#39;s outline the key classes that will form the backbone of Make It Dark’s functionality:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;**GridManager**&lt;/code&gt;: The cornerstone of our game, the &lt;code&gt;GridManager&lt;/code&gt;, is tasked with creating and managing the grids that are central to Make It Dark. This class will handle the initialization of the grid based on specified dimensions and possibly other parameters, ensuring that the grid is always in a valid state for gameplay.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;**LightToggleStrategy**&lt;/code&gt;: A crucial aspect of the game is the logic behind toggling lights on the grid. The &lt;code&gt;LightToggleStrategy&lt;/code&gt; class will encapsulate this logic, determining how the state of the grid changes with each interaction. This class allows for flexibility and creativity in defining how each light toggle affects the grid, potentially allowing for different game modes or variations in the future.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;**WinConditionChecker**&lt;/code&gt;: Winning the game isn&amp;#39;t just about turning off all the lights; it&amp;#39;s about meeting specific conditions defined within the game. The &lt;code&gt;WinConditionChecker&lt;/code&gt; class will house the rules and logic to determine whether the player has met the winning criteria, adding an essential layer of gameplay and challenge.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;**GameEngine**&lt;/code&gt;: Acting as the central interface through which the player interacts with the game, the &lt;code&gt;GameEngine&lt;/code&gt; class ties everything together. It serves as a proxy layer, facilitating interactions between the player and the underlying components like the &lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt;. The &lt;code&gt;GameEngine&lt;/code&gt; ensures that these components work in harmony, providing a seamless and engaging gameplay experience.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By using these classes, I aim to create a clear and logical structure for my game, where each class has a distinct responsibility and contributes to the overall functionality of the game. This object-oriented approach not only aligns with my programming preferences but also ensures that the game&amp;#39;s code is robust, testable, and extendable. As we delve deeper into the coding phase, these classes will be fleshed out, each playing its part in bringing the game to life.&lt;/p&gt;
&lt;h3 id=&quot;the-gridmanager-class&quot;&gt;The &lt;code&gt;GridManager&lt;/code&gt; Class&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;GridManager&lt;/code&gt; class is a cornerstone in Make It Dark, responsible for generating the game&amp;#39;s grid—a fundamental aspect of gameplay. It must not only create grids of varying sizes but also ensure each cell&amp;#39;s initial state is set correctly and handle invalid grid dimensions gracefully.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;p&gt;The test suite for &lt;code&gt;GridManager&lt;/code&gt; is designed to validate each aspect of its functionality, ensuring the class behaves as expected under various scenarios.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;vitest&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./GridManager&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;GridManager&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    gridManager&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;createGrid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should create a grid with the correct number of rows&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should create a grid with the correct number of columns&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should create a grid with all cells set to false&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the number of rows is less than 1&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of rows must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the number of columns is less than 1&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; gridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of columns must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;I am going to implement the &lt;code&gt;GridManager&lt;/code&gt; class in is a step-by-step process, aligning with the Test-Driven Development (TDD) approach. Here’s how each test shapes the gradual build-up of the class.&lt;/p&gt;
&lt;p&gt;Initially, &lt;code&gt;GridManager&lt;/code&gt; is a simple class without any methods:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The first implementation step addresses the tests for invalid grid sizes. I start by adding a &lt;code&gt;createGrid&lt;/code&gt; method that includes validation checks:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of rows must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of columns must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-1.Bz0gPEmV_199mN0.jpg&quot; alt=&quot;&quot; width=&quot;1048&quot; height=&quot;276&quot;&gt;&lt;/p&gt;
&lt;p&gt;This ensures the class correctly handles requests for grids with zero or negative dimensions. I also find it advantageous to work on the tests that have error conditions first, as it ensures that any leading tests I run have valid inputs.&lt;/p&gt;
&lt;p&gt;I also extend the &lt;code&gt;createGrid&lt;/code&gt; method to create a grid. Initially, it returns an empty array, which is enough to pass the dimension validation tests but not the grid creation tests.&lt;/p&gt;
&lt;p&gt;To satisfy the tests for the correct number of rows and columns, the &lt;code&gt;createGrid&lt;/code&gt; method is further refined to return a grid of the specified dimensions:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of rows must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of columns must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({ &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;At this stage, the grid is created with the correct dimensions, but the cell states are not yet set.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-2.CF36SrGv_2uNHBH.jpg&quot; alt=&quot;&quot; width=&quot;1036&quot; height=&quot;262&quot;&gt;&lt;/p&gt;
&lt;p&gt;Finally, to pass the test that checks the initial state of the grid&amp;#39;s cells, I update the grid creation logic to set all cells to &lt;code&gt;false&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; GridManager&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  createGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;rows&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of rows must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;columns&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Number of columns must be greater than 0&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({ &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; rows&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }, &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;({ &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#B6B1B1&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; columns&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; }, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    );&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-3.Dfw_aLrZ_1AB5Yh.jpg&quot; alt=&quot;&quot; width=&quot;1074&quot; height=&quot;428&quot;&gt;&lt;/p&gt;
&lt;p&gt;This completes the &lt;code&gt;GridManager&lt;/code&gt; implementation, ensuring it meets all the outlined tests.&lt;/p&gt;
&lt;p&gt;Through this step-by-step implementation, aligned with the TDD methodology, the &lt;code&gt;GridManager&lt;/code&gt; evolves from a basic class into a functional component capable of generating and managing the game&amp;#39;s grid.&lt;/p&gt;
&lt;h2 id=&quot;the-lighttogglestrategy-class&quot;&gt;The &lt;code&gt;LightToggleStrategy&lt;/code&gt; Class&lt;/h2&gt;
&lt;p&gt;In Make It Dark, the &lt;code&gt;LightToggleStrategy&lt;/code&gt; class plays a key role in defining the game&amp;#39;s core mechanics. This class is responsible for changing the state of lights on the grid, including adjacent lights, based on player interactions. It is crucial for ensuring the game&amp;#39;s logic is consistent and adheres to the defined rules of how lights should behave when toggled.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;p&gt;The test suite for &lt;code&gt;LightToggleStrategy&lt;/code&gt; is designed to validate several key aspects of light toggling behaviour:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;vitest&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./LightToggleStrategy&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;LightToggleStrategy&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;toggle&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should toggle the light at the given coordinates&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should toggle adjacent lights&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should toggle adjacent lights on the edge of the grid&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should toggle adjacent lights off that are already on&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toStrictEqual&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;([&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should throw an error if the given coordinates are out of bounds&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Row -1 is out of bounds&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Column -1 is out of bounds&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Row 3 is out of bounds&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; lightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toThrow&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;Column 3 is out of bounds&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;With the tests defined, the &lt;code&gt;LightToggleStrategy&lt;/code&gt; class can be implemented to satisfy these requirements.&lt;/p&gt;
&lt;p&gt;Initially, &lt;code&gt;LightToggleStrategy&lt;/code&gt; is an empty class:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The main functionality revolves around the &lt;code&gt;toggle&lt;/code&gt; method. This method must toggle the state of the specified light. However, I will tackle the error conditions first:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Row &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; is out of bounds`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; ||&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;=&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;        throw&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;`Column &lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#72F1B8&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; is out of bounds`&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-4.BcYEkA5k_Z2dVN5P.jpg&quot; alt=&quot;&quot; width=&quot;1094&quot; height=&quot;270&quot;&gt;&lt;/p&gt;
&lt;p&gt;Now that the error cases have been handled, the method can be updated to toggle the state of the specified light:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-5.CcEe_Syz_2cduPK.jpg&quot; alt=&quot;&quot; width=&quot;1166&quot; height=&quot;280&quot;&gt;&lt;/p&gt;
&lt;p&gt;I can now extend the &lt;code&gt;toggle&lt;/code&gt; method to also toggle adjacent lights:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-6.BnPGfELz_1oF12L.jpg&quot; alt=&quot;&quot; width=&quot;1076&quot; height=&quot;286&quot;&gt;&lt;/p&gt;
&lt;p&gt;Finally, I need to ensure that I handle edge cases, such as when the light is at the border of the grid:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; LightToggleStrategy&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  toggle&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][], &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;      updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; updatedGrid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-7.BJxuaJ1z_Z1S9av9.jpg&quot; alt=&quot;&quot; width=&quot;1090&quot; height=&quot;432&quot;&gt;&lt;/p&gt;
&lt;p&gt;Through this implementation process, the &lt;code&gt;LightToggleStrategy&lt;/code&gt; evolves into a functional component of Make It Dark, capable of handling the intricate logic of light toggling.&lt;/p&gt;
&lt;h2 id=&quot;the-winconditionchecker-class&quot;&gt;The &lt;code&gt;WinConditionChecker&lt;/code&gt; Class&lt;/h2&gt;
&lt;p&gt;Next up, I will be looking at the &lt;code&gt;WinConditionChecker&lt;/code&gt; class, tasked with evaluating the grid to determine if the player has met the win conditions. Unlike traditional games where winning might involve reaching a certain score or level, Make It Dark&amp;#39;s victory criteria are based on the state of the grid - specifically, whether all lights have been turned on. This class encapsulates the logic needed to assess the grid&amp;#39;s state, providing a clear and concise check that can be called at any point in the game to determine if the player has won.&lt;/p&gt;
&lt;h3 id=&quot;the-tests&quot;&gt;The Tests&lt;/h3&gt;
&lt;p&gt;The tests designed for &lt;code&gt;WinConditionChecker&lt;/code&gt; aim to cover all possible scenarios the player might encounter:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;vitest&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt; &quot;./WinConditionChecker&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;WinConditionChecker&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  beforeEach&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(() &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;    winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  describe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;check&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should return true if all the cells are false&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toBe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should return false if all the cells are true&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toBe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;    it&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF8B39&quot;&gt;&quot;should return false if some cells are true and some are false&quot;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;        [&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;      ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;      const&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; result&lt;/span&gt;&lt;span style=&quot;color:#FFFFFFEE&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; winConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;      expect&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;toBe&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;the-implementation&quot;&gt;The Implementation&lt;/h3&gt;
&lt;p&gt;To fulfil the outlined tests, &lt;code&gt;WinConditionChecker&lt;/code&gt; needs a &lt;code&gt;check&lt;/code&gt; method that can accurately assess the state of the grid.&lt;/p&gt;
&lt;p&gt;Initially, &lt;code&gt;WinConditionChecker&lt;/code&gt; is an empty class:&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The core functionality resides in the &lt;code&gt;check&lt;/code&gt; method, which initially will return &lt;code&gt;false&lt;/code&gt; until we provide the actual implementation.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#F97E72&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-8.DpdjJEaJ_1bslCF.jpg&quot; alt=&quot;&quot; width=&quot;1064&quot; height=&quot;218&quot;&gt;&lt;/p&gt;
&lt;p&gt;Next, I can refine the new method to accurately return &lt;code&gt;true&lt;/code&gt; when all lights in the grid are turned off.&lt;/p&gt;
&lt;div class=&quot;code-block&quot; data-lang=&quot;typescript&quot;&gt;&lt;pre class=&quot;shiki synthwave-84&quot; style=&quot;background-color:#262335;color:#bbbbbb&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; WinConditionChecker&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;  check&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;[][])&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#FE4450&quot;&gt; boolean&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; grid&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;every&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt; row&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#36F9F6&quot;&gt;every&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB;font-style:italic&quot;&gt;light&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;color:#FEDE5D&quot;&gt; !&lt;/span&gt;&lt;span style=&quot;color:#FF7EDB&quot;&gt;light&lt;/span&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#BBBBBB&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/make-it-dark-turning-requirements-into-code-9.Cqvdzyoe_Z1cjX1S.jpg&quot; alt=&quot;&quot; width=&quot;1032&quot; height=&quot;360&quot;&gt;&lt;/p&gt;
&lt;p&gt;Through this implementation, &lt;code&gt;WinConditionChecker&lt;/code&gt; becomes a crucial element in determining the progression and conclusion of Make It Dark. The class&amp;#39;s method, developed and refined through TDD, provides a reliable means to assess the game&amp;#39;s win condition. This ensures that the game&amp;#39;s objectives are clear and that the condition for winning is consistently applied, enhancing the game&amp;#39;s playability and challenge.&lt;/p&gt;
&lt;h2 id=&quot;pausing-for-now&quot;&gt;Pausing For Now...&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://www.mrstebo.co.uk/_astro/young-man-with-blonde.CZc5NSIF_19GMaS.jpg&quot; alt=&quot;&quot; width=&quot;1200&quot; height=&quot;673&quot;&gt;&lt;/p&gt;
&lt;p&gt;After developing the &lt;code&gt;GridManager&lt;/code&gt;, &lt;code&gt;LightToggleStrategy&lt;/code&gt;, and &lt;code&gt;WinConditionChecker&lt;/code&gt; with a focus on Test-Driven Development, the groundwork for the core game mechanics is now in place. These components are crucial for setting up the gameplay, managing the grid, and defining the conditions for winning.&lt;/p&gt;
&lt;p&gt;At this point, it&amp;#39;s appropriate to pause and prepare for the next steps. Integrating these components into a unified system will be tackled in the next phase of development, specifically through the &lt;code&gt;GameEngine&lt;/code&gt; class. This class will serve as the central hub for interaction within the game, tying together the logic and functionality of the various components.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;GameEngine&lt;/code&gt; will also illustrate the implementation of the Proxy pattern, streamlining the complexity of interactions. The focus on this pattern in the upcoming work will show how it aids in managing the game state and delegating tasks efficiently.&lt;/p&gt;
&lt;p&gt;This staged development approach ensures that each part of the game is built with attention to detail and integrates seamlessly. The next step, focusing on the &lt;code&gt;GameEngine&lt;/code&gt;, is crucial for bringing together the game&amp;#39;s logic and providing a smooth gameplay experience. It marks a significant transition from building the game&amp;#39;s foundational elements to focusing on the architecture that will drive the game forward.&lt;/p&gt;
</content:encoded><dc:creator>Steven Atkinson</dc:creator><category>Svelte</category><category>Software Architecture</category><category>Software Engineering</category><category>Test Driven Development</category><category>Testing Frameworks</category></item></channel></rss>