<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harry Dennen on Medium]]></title>
        <description><![CDATA[Stories by Harry Dennen on Medium]]></description>
        <link>https://medium.com/@hdennen?source=rss-611724be21fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*15EC9EdwgzMP1ldsQQhIgw@2x.jpeg</url>
            <title>Stories by Harry Dennen on Medium</title>
            <link>https://medium.com/@hdennen?source=rss-611724be21fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 21:59:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hdennen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Software with AI in 2026]]></title>
            <link>https://medium.com/@hdennen/building-software-with-ai-in-2026-2f6cc083aaf2?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f6cc083aaf2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 14:10:52 GMT</pubDate>
            <atom:updated>2026-07-18T14:10:52.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wtX9FUB_CZrqhr6EXT7-NQ.png" /><figcaption>catching data (in the style of Perry Bible Fellowship)</figcaption></figure><p>Things have changed and stayed the same.</p><p>Good engineers have good mental models. True before. More true now.</p><p>You are now limited by your own cognitive contextual limits and how fast you can learn. Before LLMs, there was the hard part, and there was the easy part.</p><p>The hard part was the figuring out. The designing, the going back and forth with colleagues about trade offs and and constraints. This has always been the programming part. This part is very much still true, possibly more so because it now involves a machine intelligence faster than us.</p><p>The easy part was the writing code. Headphones on and just go. It was relaxing. It was great.</p><p>The easy part is gone. And that presents a problem for some. The act of typing out code, for many, was the act of thinking. Coding was the act of working through ideas, and unlocking understanding. But it was also the conflation of planning and execution. It led to coding by exception, logically pigeon holing yourself, creating stateful traps and many, many other issues we find in any codebase.</p><p>There were always anti-patterns telling us this was not a great method, but not everyone made themselves aware.</p><p>I was recently asked what I actually do now. It was surprisingly hard to answer. I am busier than ever, but touching code is a small portion of my activity. It’s like I am constantly loading context and reasoning about direction, constraint, and interest, then deciding. The hard part over and over again.</p><p>Because these machines are so quick and so confident about their answers, it becomes work to ensure the right concerns are weighted at the right level, such that the outcome is useful in a way that does not establish an extension trajectory that will make issues, or ignore a user persona’s actual need.</p><p>And then there is the cruft. These machines are addative to a codebase in a way that treats the entire past as a good idea and golden truth. And any bit of text not in the context simply does not exist. Over a long enough timescale, this produces insane results that will be justified and reinforced by the LLM.</p><p>I find that I need to protect the program model from unnecessary extension and interleaving of behaviors. Architecture, rules, and skills help with this, but again, the past is The Truth to these things and knowing when an idea has lost it’s value and to change tack does not seem to be in the cards here.</p><p>The human is still responsible for the outcome, and the increase in speed has increased the demand for planning, organizing, and deciding. And not just for code, but for intent, infrastructure, logical architecture, and deployment architecture.</p><p>It’s exhausting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f6cc083aaf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to JSON in GitHub Secrets]]></title>
            <link>https://medium.com/@hdennen/how-to-json-in-github-secrets-dda8fdd31189?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/dda8fdd31189</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[github-secret]]></category>
            <category><![CDATA[yaml]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Fri, 23 May 2025 01:33:27 GMT</pubDate>
            <atom:updated>2025-05-23T01:33:27.923Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgSBo4YOjQGbIIJm5fA7sg.png" /></figure><p>Don’t.</p><p>When that secret is applied to environment variables it will be interpreted as many individual variables. Things will mush together and nothing will work.</p><p>You must save a string in the secret, then pick up the string and JSONify it at run time.</p><p>base64 makes a great string.</p><ol><li>base64 your json</li><li>put base64 string into GitHub secret</li><li>do your deploy yaml magic to read the secret and put it in an environment variable.</li><li>at runtime, read the variable and convert to json.</li></ol><p>It’s not a complex thing and in hindsight is obvious. But I wasted time on this so hopefully you will not. Also, somehow none of the LLMs will notice this unless you really point it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dda8fdd31189" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Software With AI in January 2025]]></title>
            <link>https://medium.com/@hdennen/building-software-with-ai-in-january-2025-11566c6ae084?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/11566c6ae084</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 16:15:17 GMT</pubDate>
            <atom:updated>2025-01-23T16:15:17.578Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building with AI in January 2025</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/0*qj3k8lqUYx8ZxYsf.jpg" /></figure><p>note: This post was written 100% by me. No LLM involvement.</p><p>Having some unexpected free time on my hands I have now built a handful of web apps using tools like Bolt, Cursor and CoPilot. It’s been interesting. This is a dive into the specifics of what to expect.</p><h3>It’s Great at Boilerplate (Sometimes)</h3><p>Want to spin up a React app? No need for tools like create react app or any other template generator. Just ask Bolt or Lovable and you’ll get one. Sure, it might use conflicting libraries as you go, or confuse framework APIs between versions, or even make things up whole cloth, but it’s still a nicer place to start than a blank repo. And for the most part, you can almost one-shot simple apps!</p><p>Want a basic C# API with a few endpoints? You’ll get the weather app based on the classic template, but ask for anything more in depth and you’ll get a lot of code that does not compile. Not too bad since .NET has a ton more boilerplate, and anything that’s going to type all that out for you is fantastic.</p><p>All in all, when you’re spinning up something new, having an LLM spit out the boilerplate is a big net positive as long as you already know what you’re doing and have the capacity to imagine all the things it’s not telling you.</p><h3>It’s Great at Working with Existing Libraries (Mostly)</h3><p>This might be my favorite perk. I used to have to read documentation of varying degrees of arcane wizard spells whereas now I can just point the LLM at docs and a repo and interrogate the library. This is nice, even if it occasionally lies.</p><p>But even with the odd lie, it’s honestly so much faster to have a conversation with an API instead sifting through the docs. I still recommend reading the docs just to be aware of the API surface, but talking to the LLM is the way to move quickly.</p><h3>It Will Make Things Up</h3><p>When I used to interview people at Derivco, one of the red flags we looked for was being confidently wrong. LLMs are always confident, and therefore when wrong, can only be confidently wrong. Not fun. I have two examples.</p><p>My first real taste was when I spent 30 minutes trying to work out why a drop down wasn’t working only to find that Claude had made up the props object syntax. It happily set my props objects with item and value properties when <a href="https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/list-items.ts#L10-L18">it simply is not that</a>:</p><pre>export interface ListItem&lt;T = any&gt; extends InternalItem&lt;T&gt; {<br>  title: string<br>  props: {<br>    [key: string]: any<br>    title: string<br>    value: any<br>  }<br>  children?: ListItem&lt;T&gt;[]<br>}</pre><p>My second time suck was while trying out PapaParse. 4o assured me that a library function contained a parameter for seeing all headers of a table, regardless of which individual column header you happened to be on. It gave me the signature of the function, it gave me examples how I could use it. It recommended I use that approach. The problem? When I cloned the <a href="https://github.com/mholt/PapaParse/blob/master/papaparse.js#L1246">PapaParse</a> repo, that signature did not exist, and not only did that headers array param not exist, the way column headers were created did not allow for you to get to the full headers list without directly using arguments. While not a huge deal, it was still making things up and wasting my time.</p><pre>function addHeader(header, i)<br>   {<br>    if (isFunction(_config.transformHeader))<br>     header = _config.transformHeader(header, i); // my comment: array param not listed, though you could still use arguments param in your tranform function<br><br>    _fields.push(header);<br>   }<br><br>   if (Array.isArray(_results.data[0]))<br>   {<br>    for (var i = 0; needsHeaderRow() &amp;&amp; i &lt; _results.data.length; i++)<br>     _results.data[i].forEach(addHeader); // my comment: all params are passed to addHeader<br><br>    _results.data.splice(0, 1);<br>   }</pre><p>So where do the LLMs get their lies? Are they from stale proposal branches? Old code? I don’t know, and neither does the LLM. My recommendation when dealing with code written by an LLM is <a href="https://en.wikipedia.org/wiki/Nullius_in_verba">nullius in verba</a>.</p><h3>It Will Not Clean Up After Itself</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*T0fnCI7tUFbwOi--.jpg" /></figure><p>So you’ve got your starter code, you’ve got your boilerplate, now you’re building some domain and application logic. This is where the cruft sneaks in. As a developer you’re going to change your mind and bump into unknown unknowns. The LLM is going to confidently charge ahead. You can end up with a different geolocation library for every module you interact with location data, or entire files that do absolutely nothing. This might be a Cursor thing as that’s what I’m mostly using, but even giving it many files for context, the composer will only produce what is the statistically probable next code, but it’s not going to account for all the unconscious assumptions you’ve made in your head.</p><p>I think part of this is about building an intuition for how best to interact with an LLM, part it is building an appropriate model of what you can reasonably expect from an LLM / how abstract you can be, and part is how good the context and prompt is that the LLM is getting. Either way, nullius in verba again.</p><h3>It Doesn’t Know You Put Something in the Wrong Place</h3><p>While getting routes to work in a Vercel deployment I needed to add some settings to my vercel.json. This is a simple task, but for some reason it just wasn’t working. Claude was happy to keep trying things, jovially accepting what it perceived were its mistakes and then suggesting another absolute guess.</p><p>Claude: “Ah, my mistake! you need to do x instead.”<br>Me: “we already tried that”<br>Claude: “Oh, of course, we need to include x and y to the configuration file”<br>Me: “are x and y necessary?”<br>Claude: “No, they are not necessary in this case because z.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/0*BDGsBXnbf_X79kIZ.gif" /></figure><p>In the end I had inadvertently put the vercel.json a directory level above where I meant to. I did a dumb thing and Claude was stumped.</p><h3>You Don’t Know What It’s Not Telling You</h3><p>This is dangerous. Any of us who have made progress in our software development careers know that knowing what questions to ask is half the battle. And that knowledge comes from experience, usually the painful kind.</p><p>I caught a bit of a wake up the other day making a react native app. I wanted some boilerplate to start out so went to Bolt and asked for a react native app with some simple specifications. It gave me some broken code but I was able to sort out minor squiggly line issues on my local machine.</p><p>Then, while trying to add some functionality, Claude noticed I was trying to implement something in react native when the codebase was in native script.</p><p>wat. That wasn’t what I asked for.</p><p>I’m new to react native and just wanted to dive in and get my hands dirty, no stress about running it, just exploring the code. I had no idea there were two frameworks. Yes this was careless on my part, but also exactly what happens when you’re moving quickly. What struck me was that I was given some code, and I just went with it… And I’ve been doing that<em> a lot</em>. When I extrapolate on that, it gets frightening. The code an LLM gives you is just that, the code it gave you. There are worlds of other possibilities that it did not choose, <em>and you had no say in that</em>.</p><p>Think about that for a minute.</p><p>Aside from all codebases written with LLMs converging on the same code, think about how much thought you’ve put into choosing things in your career. Now offload that to an LLM. When are you building your discernment muscle in that world?</p><p>A new fear at this point is that we offload so much of our cognitive load to LLMs that we lose our capacity for critical thinking. The way I’ve heard it put is that LLMs make you lazy. While definitely true, that is an understatement. My suspicion is that over time, heavy use might actually retard your cognitive growth by sheer opportunity cost of constantly letting something else think for you.</p><p>Or the load will shift to crafting prompts, and that will build the discernment muscle? Maybe it doesn’t matter?</p><p>Either way, I can’t give up the speed. I don’t think any of us can. It’s wild how fast I can build with these tools. Most fun programming I’ve had in years. Personally though, I will stick to writing my own words.</p><p>At least then I’m thinking for myself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11566c6ae084" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goodbye Vue, Hello React.]]></title>
            <link>https://medium.com/@hdennen/goodbye-vue-hello-react-bc08dfdbf340?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc08dfdbf340</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 15:46:09 GMT</pubDate>
            <atom:updated>2025-01-20T15:46:09.628Z</atom:updated>
            <content:encoded><![CDATA[<p>I haven’t built with a front end framework in probably 4 years, but when I did, Vue was my favorite. Having built two UIs recently, one in Vue and one in React, React is the clear winner for a couple reasons. (yes, I know I’m late to the party)</p><p>1. Integrating a component library is easy. With Vue, you almost have to start with a Vuetify (or other) install and once there, you are stuck with vendor lock in. With React, very straightforward to include or remove.</p><p>2. UseEffect hook. A major issue with all the big front end frameworks once your UI gets big enough is performance, and one of the main offenders is how they handle state change detection. AngularJS was terrible, Angular’s zone.js approach was marginally better, and Vue’s dependency chain monitoring was better still. React gave it to the developer to decide. It seems stupidly simple, but what a useful approach.</p><p>At this point I am only reaching for React and will be rebuilding my Vue front end in React. (and with AI it’ll probably take me a day, but that’s another post)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc08dfdbf340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collaboration Is Not Transactional]]></title>
            <link>https://medium.com/@hdennen/collaboration-is-not-transactional-f9954bca0f9e?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9954bca0f9e</guid>
            <category><![CDATA[collaboration]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Tue, 17 Dec 2024 15:08:43 GMT</pubDate>
            <atom:updated>2024-12-17T15:08:43.407Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y7SzEJBM_J9j5snHzxBprg.jpeg" /></figure><p>When we say things like, “when will you have that done?” Or, “when do you want it by?” it creates an exchange based interaction rather than a collaborative interaction. Delays are avoided if the discussion is about an end result instead. “We need X and Y done before Z. Let’s shoot for Z by N time.”</p><p>If we then say things like “I’m waiting Bob to finish X” it reinforces the exchange based interaction. A collaborative approach would be to say “We can’t start Z without X, so I’ll jump on X with Bob.”</p><p>Collaboration is about the mission, doing what is necessary to move a piece of work over the line.</p><p>It’s also about looking out for each other. We all rabbit hole. We all have our tendencies and habits that don’t always align with getting the right thing done. We all have blind spots. It’s up to our team members to notice if we’re spinning our wheels. It is much easier to see the mistakes someone else is making then to see the mistakes we are making. A team should rely on each other, and the best way for that to happen is when everyone becomes the person they would want tapping them on the shoulder to say “hey, I noticed you’re spending a lot of time on this, you want a second set of eyes?”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9954bca0f9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make a Coffee Table in 65 Steps: A Programmer’s Guide]]></title>
            <link>https://medium.com/@hdennen/how-to-make-a-coffee-table-in-65-steps-a-programmers-guide-b4e6d4bf1625?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4e6d4bf1625</guid>
            <category><![CDATA[woodworking]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 14:05:48 GMT</pubDate>
            <atom:updated>2024-10-13T21:38:26.264Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtlQT9M5OYlDqLdP2JgXow@2x.jpeg" /></figure><p>Project timeline: 3 days</p><p>Actual timeline: 10 days</p><ol><li>Have idea for table</li><li>Search better ideas for table</li><li>Design</li><li>Model</li><li>Make cutting lists</li><li>Plan execution</li><li><strong>Start Table top</strong></li><li>Mark</li><li>Plane</li><li>Cut</li><li>Glue</li><li>Clamp up a big square of wood</li><li>Look at doing Legs, everything changes.</li><li>Make cardboard templates</li><li>Mark wood</li><li>Line up</li><li>Set jig</li><li>Freak out about it cutting your fingers off before collecting yourself</li><li>Cut</li><li>Joinery time, realize how difficult mortise and tenon joints are with hand tools and question what you have committed to</li><li>Plan cross joint</li><li>plan mortices in cross and tenons on legs</li><li>Mark where they will be</li><li>Cut tenons rough</li><li>Clamp leg for creating mortise</li><li>Drill 3 holes in a row to start the mortise — one time, get it right</li><li>Chisel out between holes</li><li>Continue to shape mortise with chisel</li><li>adjust tenons to fit mortises because you hand drilled them in a row and that wasn’t the best idea.</li><li><strong>Table top cuts</strong></li><li>Make center pin jig on table saw for square of wood to turn on</li><li>Cut a million times till round</li><li>Set the belt sander in place and rotate the table— two people</li><li>Beer</li><li><strong>Day 3 Cross joints &amp; legs</strong></li><li>Don’t cut cross joint to depth so you can adjust as you finish cutting.</li><li>Sand</li><li>Recut if you’re not happy, adjust leg lengths</li><li>If it feels wrong in your gut, redo it.</li><li>Accidentally chamfer both edges fully on the cross joint. A symbol of your fallibility.</li><li>Glue and clamp cross pieces with legs. Realize that keeping offcuts is critical when you need to clamp something that now has an angle you made. Fail to find enough pieces to belt sand a fourth and curse your lack of foresight.</li><li>more sanding</li><li>Attempt using sanding sealer on table top and legs because that worked well on the bed you made out of Ash. Be confused when the Walnut drinks it and finish isn’t silky at all.</li><li>Apply another coat and sand some more. Fail again. Apply another coat and sand again. Get frustrated. Admit defeat and spend a cumulative 10 hours reading forums about finishing Walnut. Slowly admit to yourself that you have seriously underestimated what this is going to take.</li><li>Take a break. Rethink your choices. Decide that you’re just going to glue it up into a table because you’re tired of looking at pieces.</li><li>With the table top upside down place the legs and pencil outline where they should be. Realize that your center cross cut is slightly off and while no one will ever notice, it still bothers you a lot.</li><li>Vice legs and drill holes for dowels. Make a guide jig by drilling two holes equidistant from the center hole. Put pegs in the outer holes to sit either side the wood so that the center hole is always centered over the wood.</li><li>Line up the holes to the table top and mark with these special pin things. Realize that while you have plenty of pin things, only two fit. You need four.</li><li>Say screw it and roughly pencil the dowel outlines from the legs. Drill freehand without a jig because you’re getting frustrated now. Barely drill at first so that you can measure and adjust for accuracy.</li><li>Keep drilling because the dowels have swollen a bit because you live in a humid climate and they don’t fit like they’re meant to.</li><li>Glue it up and freak out when one of the cross sections doesn’t sit flush with the table top. Pack it with more glue. Turn the table right side up and put a flipping great rock on it.</li><li>Read more forums about Walnut finishing. Slowly realize you are about to belt sand all the sanding sealer off the table and it’s going to be a nightmare because you already glued it up.</li><li>Spend the next day sanding.</li><li>Discover Watco Danish Oil.</li><li>Watch youtube videos on how to apply it. Read forums on how to apply it. Learn about the 3rd law of woodworking which states that the number of finishing methods in response to a question is equal to the number of woodworkers answering the question.</li><li>Find out that all methods are just approaches and that the fundamentals are the same.</li><li>These things matter: Grain , pores , heartwood vs sapwood, desired result , polymers need texture to bind to, oils chemically bind to under layers, oils don’t bind to polymers, oils weep, curing takes time.</li><li>go at it with the Danish oil.</li><li>realize you got pigmented and that was a mistake.</li><li>wait the recommended time between coats and discover that whoever made the recommendation must live in a desert because in your humid climate it takes 3 days between coats.</li><li>stare at it whenever you walk past at various times throughout the day and notice everything you did poorly and isn’t good enough.</li><li>when it’s finally dry give a light sand, careful not to rub through the finish at the corners.</li><li>rub through the finish at the corners and curse everything.</li><li>decide it’s fine.</li><li>put it in you living room and marvel at how well it actually came out.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4e6d4bf1625" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On Readability]]></title>
            <link>https://medium.com/@hdennen/on-readability-b9fbeb97b46e?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9fbeb97b46e</guid>
            <category><![CDATA[readability]]></category>
            <category><![CDATA[programming-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Thu, 29 Aug 2019 11:52:47 GMT</pubDate>
            <atom:updated>2019-08-29T11:52:47.864Z</atom:updated>
            <content:encoded><![CDATA[<p>None of this is new and I don’t know that it’s possible to follow these 100%. But if these are your targets then your code will be a pleasure to work with.</p><h3>The Function Does Not Rely on Hidden Cleverness</h3><p>Language peculiarities around order of interpretation for type coercion are confusing. Yes it’s fun to explore them, but leveraging them in production is effectively setting a landmine for the next developer who touches that code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*R7aLiky3T7mArMRCxwQ3zw.png" /><figcaption>Javascript favorite language comic</figcaption></figure><h3>The Function Makes Sense in Isolation</h3><p>The reasons why a function was constructed are apparent from the title and contents of the function, without the need for additional context of the caller or any internally called functions.</p><p>If a developer needs to read anything other than the function to understand what it’s doing, it’s not readable. The ultimate first prize is to convey precise meaning with the function name alone.</p><h3>The Function Assumes Knowledge of the Language</h3><p>Yes the semantics of Promises and methods like .reduce are cumbersome. Yes closure and context take effort to initially get your head around. Yes you still need to be comfortable with all of that.</p><p>The one caveat here is to be careful not to fall into leveraging hidden cleverness.</p><h3>Consistency Trumps Comfort</h3><p>So much of bug reduction boils down to eliminating surprises. If you join a front end team of ex-backend devs who are all writing functions like this:</p><pre>function makeThingsHappen()<br>{<br>  // things happening<br>}</pre><p>or they’re using / not using semicolons, or they’re using spaces / tabs, or [insert your pet peeve here], just bite the bullet and join in. Get some auto-formatting and let go of your petty preferences, they truly do not matter. Your ability to become comfortable in environments that go against your personal preferences is a professional quality — develop it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9fbeb97b46e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maintaining an Internal Library: Learning What I Thought I Already Knew]]></title>
            <link>https://medium.com/@hdennen/maintaining-an-internal-library-learning-what-i-thought-i-already-knew-e0f9e4a27c41?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0f9e4a27c41</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gitflow]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Wed, 06 Feb 2019 15:59:59 GMT</pubDate>
            <atom:updated>2019-02-06T15:59:59.598Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*BE7_w7J42VQaQ82CzoljlQ.gif" /><figcaption><a href="http://www.smbc-comics.com/?id=2475">http://www.smbc-comics.com/?id=2475</a></figcaption></figure><p>The product I work on needed to support window messaging with some company specific standards so I thought it would be nice to separate the transport from the main system entirely. That way we could give it to our customers to ease integration and use it in our other products to coerce a single standard.</p><p>Also, it was also something I could experiment on without ten other devs pushing commits. 😅</p><p>As it matured from a single file to a full library with a build / release / deployment pipeline I bumped into some <em>less obvious whys</em> behind development best practices. Here they are.</p><h3>Branching Strategy (gitflow)</h3><p>It is only faster to smash out commits on master if you ignore all the time costs that are not writing code.</p><p>We know these to be true: You will change your mind. You will make mistakes. You will forget things. You will make poor decisions.</p><p>The cost of these things is not just the backtracking and amending process, it is just as much if not more the <strong>building of mental context necessary to backtrack and amend</strong>.</p><p>Put a timer on the next time you take a week away from some code and see how long it takes to get back into that head space.</p><p>Of the many, many benefits of gitflow, I found this to be the biggest time saver: Well kept branches keep mental context cordoned off and cohesive. If the branch has too many conceptual changes in it, the benefit goes away. <strong>One idea, one branch.</strong></p><h3>Updating a library is easy, updating dependency chains is not.</h3><p>We have a small helper library we ship which depends on my library, it also includes a demo site that needs to have the latest version. Our main client also depends on my library, and there is a partner repo that stores the helper library for live pickup. Simple. 😐</p><p>Each of those external facing codebases are subject to a release process.</p><p>It did not take long to discover that <strong>if coordination is key, then Automation is cornerstone.</strong> Maybe it’s just me, but having more than a couple moving parts to coordinate meant that I almost always forgot some small piece.</p><p>Also, a good project manager is worth their weight in gold.</p><h3><a href="https://github.com/conventional-changelog/standard-version">Standard Version</a> is Great!</h3><p>Honestly, spitting out an auto generated changelog with version bumping and a nice chore commit is fantastic. We already follow Angular commit guidelines on my main project so this was an easy transition. It’s not so practical on our main project due to the sheer volume of commits, but it <a href="https://www.youtube.com/watch?v=9AvWs2X-bEA">sparks joy</a> for this smaller stuff.</p><h3>UNIT TESTS</h3><p>I have never been able to maintain TDD for very long. I am honestly not entirely sure it is a practical approach to modern JS applications. That said, well considered unit tests are 100% absolutely necessary.</p><p>Well considered is the operative phrase here. We’ve all seen high coverage of unit tests that effectively test nothing. What I am talking about are tests that ensure a given public method is going to perform as expected under any state conditions. The easiest way to achieve this: use <a href="https://en.wikipedia.org/wiki/Unary_function">unary</a> <a href="https://en.wikipedia.org/wiki/Pure_function">pure functions</a>. Wrangle some state into an object, pass it to the function, get a return value. Test the wrangling; test the return.</p><p>There are many other ways to assemble and test code. In my experience this is the simplest and most maintainable. And at the very least it will encourage you to abide by the <a href="https://en.wikipedia.org/wiki/Law_of_Demeter">Law of Demeter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0f9e4a27c41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How File Structure Informs the Programming Model]]></title>
            <link>https://medium.com/@hdennen/how-file-structure-informs-the-programming-model-ef2df62ea1a9?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef2df62ea1a9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Thu, 10 May 2018 07:47:30 GMT</pubDate>
            <atom:updated>2018-10-19T06:48:38.249Z</atom:updated>
            <content:encoded><![CDATA[<p>The file structure of the application informs the decisions a developer makes about how to organize their logic.</p><p>If the structure reflects poor organization, or categorization without intent, the code written in that structure will be poorly organized and categorized without intent.</p><p>Consider the separation of logic and model. Where should that decision be made? At an application level or a feature level? Should it be made at all?</p><p>Maybe we separate them at an application level. When building a feature we end up with a directory featureName in both the logic directory and the model directory. We have duplicate naming, but the directories map 1-to-1 with each other and we can make logic changes separate from the model.</p><p>Ok.</p><p>But what about the things we haven’t considered? The lines between application, business domain, framework, and presentation? If those lines don’t exist in the file structure they won’t exist in the code.</p><p>This is how logic grows to couple disparate system concerns. This is a painful place.</p><h4>Drawing Lines</h4><p>The file structure should prescribe, at least at a high level, separations of functionality that move in one direction.</p><pre>Things that run the app <br>  → things that run the business domain <br>  → things that present the business domain</pre><p>In this organization, things that deal with the domain do not know about things that present it.</p><p>Let’s consider two scenarios, one with a type categorized file structure and one with a separation prescriptive file structure.</p><h4>Type Categorized File Structure</h4><p>A developer is tasked with building a feature that has a slim and full version depending on the device spec. The developer (because they’re good at their job) abstracts out device detection, then sets about building this dual type feature.</p><pre>device detection<br>  → feature model <br>  → feature logic(arg: deviceType)</pre><p>Then business comes a month later and says “we want a medium spec version of this feature”. The developer is now in a position to either:</p><p><strong>a)</strong> untangle the logic for feature version selection from the logic for running the feature</p><p><strong>b)</strong> add more if statements</p><p>If they opt for A, the system will be more robust but business will ask why it takes so long. If they opt for B, they’ve added more technical debt to burn them when anything else in that area changes but business will be happy with the turn around time.</p><p>You could argue that if the developer really was a good developer they would have seen this coming. Ok. What if they develop 100 features. What’s the acceptable error rate? Why add the cognitive overhead of more problem anticipation when you can bake this one into the structure?</p><p>In this case there is no protection from future change without a prescriptive file structure.</p><h4>Concern Prescriptive File Structure</h4><p>Again a developer is tasked with building a feature that has a slim and full version depending on the device spec. The developer looks at the file structure of system -&gt; domain | presentation and can organize the logic accordingly:</p><pre>device detection<br>  → feature version functionalities - type[full, slim]<br>  → feature presentation(type[index])</pre><p>Here the structure has forced the distinction between running selected logic and defining selectable business logic to run.</p><p>Then when business asks for the medium version of the feature, the solution is straightforward to implement.</p><pre>device detection<br>  → feature version functionalities - type[full, slim, medium]<br>  → feature presentation(type[index])</pre><h4>How Does This Help Me?</h4><p>It’s easy to miss all the ways our environment influences our productivity, and I’m not talking about open plan offices 😒, I’m talking about the code bases we work in.</p><p>Think of the times you’ve spent too long building mental context of a feature just to add a small tweak, or fix a bug. Or when business asks why something is taking so long and you respond with dissertation on quantum mechanics just to establish a starting point to describe how fucked everything is.</p><p>A well organized code base can ease that pain.</p><p>Designing and building software isn’t just about constructing things in a way that makes sense, it’s also about constructing things in a way that puts the developer in a stronger position to handle what’s coming next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef2df62ea1a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How 3 Lines of Code Reduced CPU and Memory Consumption by 13%]]></title>
            <link>https://medium.com/@hdennen/how-3-lines-of-code-reduced-cpu-and-memory-consumption-by-13-b451de874701?source=rss-611724be21fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b451de874701</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[pixijs]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Harry Dennen]]></dc:creator>
            <pubDate>Thu, 26 Apr 2018 20:17:20 GMT</pubDate>
            <atom:updated>2018-04-27T20:52:42.603Z</atom:updated>
            <content:encoded><![CDATA[<p>Or how assumptions can ruin the performance of your app.</p><p>We have a fairly large Angular app using PixiJS for a lot of the rendering. Due to animations and constant updates to the canvas area, we’ve had to optimize as much as possible to keep the app running reasonably well on tablets.</p><p>The standard optimizations have all been applied.</p><p>Almost all components are set to ChangeDetectionStrategy.onPush, async and broadcasts use runOutsideAngular, logging is suppressed in production, etc.</p><p>We’ve leveraged PixiJS texture cache and don’t make any .update() calls on any display objects, and the render() call on requestAnimationFrame is run outside angular.</p><p>One oversight is size of certain call stacks when major data changing events occur, but other than that things seem fairly contained.</p><p>And yet we still had users noticing performance issues.</p><p>Lots of ideas for this. Use web workers for transport, distribute chunks of functionality across separate call stacks to reduce frame drop, make absolutely all components use ChangeDetectionStrategy.onPush, detach components and reattach for updates…</p><p>A number of investigations into Angular and PixiJS performance issues were made.</p><p>Then, while investigating the memory and timing costs of angular binding, RxJS subjects, and Angular bound subjects, I created a quick Angular CLI app. After setting everything up I checked a performance recording and noticed a distinct shortage of change detection runs.</p><p>I should mention here that in order to keep our app’s frame rate decent we use requestAnimationFrame on a loop to render the PixiJS stage. What we didn’t realize was that each RAF call was triggering change detection.</p><p>But why?</p><h3>Understanding How Your Tools Work is Important</h3><p>Enter Zone.js. I challenge any Angular user to explain how Zone.js works and how Angular leverages Zones.</p><p>Here’s the short version: Zone.js changes the prototypes of all async calls in the browser api (setTimeout, etc.) so that a) context can be shared across call stacks and b) that hooks can be emitted at the end of micro, macro, and event tasks.</p><p>Cool. And Angular?</p><p>Angular creates a new zone called NgZone which is a child of the root zone. This way when those end-of-task hooks are emitted, angular can run change detection on the off chance that a call has resulted in something, somewhere, changing. Which is great when you don’t have a ton of components. Not so much when you have lots.</p><p>And I’m not knocking Angular’s change detection. given the size of our app it was actually doing an impressive job running.</p><p>This issue is with the memory allocations required to run it. We ended up getting 12Mb garbage collections every 900ms.</p><p>Ok, and PixiJS?</p><p>Any event listener you register to a PixiJS object doesn’t hit the browser api. It hits PixiJS’s custom handling of events via their InteractionManager. And it’s the InteractionManager that registers an pointermove event to the document… which has been patched by Zone …which has been forked by Angular.</p><p>Ok. So our third party library is triggering change detection in our framework on mouse move — another problem — but that still doesn’t explain what’s triggering CD on every animation frame.</p><h3>Seriously Now, Understanding How Your Tools Work is Important</h3><p>PixiJS has a nice way of handling the scenario of a DisplayObject animating past your mouse. Under normal conditions you wouldn’t get a mouseover event because the mouse didn’t move, ergo no event.</p><p>PixiJS is clever though. It’s using that pointermove event to cache the last pointer event. Then on the next tick of pixi’s event loop it will check a moving DisplayObject’s position against the cached pointer event’s location, and fire a mouseover event if the display object is under the mouse.</p><p>Ok, next tick of Pixi’s event loop though?</p><p>Turns out in order to animate all their DisplayObjects they have a shared ticker running … wait for it … as a callback in requestAnimationFrame.</p><p>So now we not only have our render loop happening 60 times a second, we also have Pixi’s ticker triggering change detection 60 times a second. Not awesome.</p><p>First prize is to get PixiJS to run in the root zone instead of Angular’s NgZone, but in the meantime these 3 lines of code stop all the unnecessary change detection runs:</p><pre>const ticker = Pixi.shared.ticker;<br>ticker.autoStart = false;<br>ticker.stop();</pre><p>We now have 1/3 of the garbage collections as before.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b451de874701" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>