<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Software Development on Liam Asman&#39;s Blog</title>
    <link>https://liamasman.com/blog/tags/software-development/</link>
    <description>Recent content in Software Development on Liam Asman&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <copyright>Copyright © 2025, Liam Asman.</copyright>
    <lastBuildDate>Sun, 23 Nov 2025 17:30:00 +0000</lastBuildDate>
    <atom:link href="https://liamasman.com/blog/tags/software-development/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Avoid booleans by default</title>
      <link>https://liamasman.com/blog/posts/2025/11/avoid-booleans-by-default/</link>
      <pubDate>Sun, 23 Nov 2025 17:30:00 +0000</pubDate>
      <guid>https://liamasman.com/blog/posts/2025/11/avoid-booleans-by-default/</guid>
      <description>&lt;p&gt;Booleans make maintaining and changing code needlessly error-prone. Use enums instead.&lt;/p&gt;&#xA;&lt;h3 id=&#34;method-parameters&#34;&gt;Method parameters&lt;/h3&gt;&#xA;&lt;p&gt;What does the following function do?&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;updateState(state, true);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Specifically, what does &lt;code&gt;true&lt;/code&gt; mean? What would it mean to be false?&lt;/p&gt;&#xA;&lt;p&gt;Modern IDEs may give the parameter name as a hint, but it&amp;rsquo;s still cumbersome to read.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;updateState(state, silent: true)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;A boolean in a method implies that changing the boolean changes the behaviour, so there is a high likelihood of that&#xA;method containing an if statement. So why not just make two separate methods and keep the methods shorter?&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Booleans make maintaining and changing code needlessly error-prone. Use enums instead.</p>
<h3 id="method-parameters">Method parameters</h3>
<p>What does the following function do?</p>
<p><code>updateState(state, true);</code></p>
<p>Specifically, what does <code>true</code> mean? What would it mean to be false?</p>
<p>Modern IDEs may give the parameter name as a hint, but it&rsquo;s still cumbersome to read.</p>
<p><code>updateState(state, silent: true)</code></p>
<p>A boolean in a method implies that changing the boolean changes the behaviour, so there is a high likelihood of that
method containing an if statement. So why not just make two separate methods and keep the methods shorter?</p>





<pre tabindex="0"><code>updateStateSilently(State state);
updateStateWithNotification(State state);</code></pre><p>Here&rsquo;s another scenario:</p>





<pre tabindex="0"><code>void updateState(State state, bool silent, bool isAdmin);</code></pre><p>What happens when we want to make a change to the function signature, such as removing one of the booleans?
We need to be very careful that we refactor appropriately - deleting the wrong parameter could incorrectly invoke
admin privileges!</p>
<p>Again, ide tools may manage to handle this for you, but it&rsquo;s not fool proof. What if instead, we used an enum?</p>





<pre tabindex="0"><code>void updateState(State state, NotificationMode notificationmode, PrincipalStatus principalStatus);

...

void updateState(state, NotificationMode.SILENT, PrincipalStatus.USER);</code></pre><p>Now, if we incorrectly deleted the wrong parameter, we&rsquo;ll get a compilation error instead!</p>
<h3 id="state">State</h3>
<p>Sometimes, you might have a boolean field in an object.</p>
<p>Consider the following example of an Order in a financial exchange. Sometimes, a user may want to place an order onto the
order book, but want it to be cancelled if it would immediately match with an opposite order already on the book
(frequently used by market makers). We call this a *post only` order.</p>





<pre tabindex="0"><code>NewOrder{
  Symbol symbol,
  Price price,
  Quantity quantity,
  boolean postOnly
}</code></pre><p>As a developer, we&rsquo;ve been tasked with implementing a new behaviour: if a post-only order would match, then instead
of cancelling the order, we adjust the price of the order to be as close as possible to the original price without
it matching.</p>
<p>We could add a new boolean to the object, or an enum that expresses the behaviour of the post only order, but we&rsquo;d only
set it if the order was post only to begin with. This makes for some unsightly code, with behaviours that aren&rsquo;t entirely
predicatble to a developer reading the code for the first time.</p>
<p>Instead, we could change the postOnly field from a boolean to an enum, with three possible behaviours:</p>





<pre tabindex="0"><code>OnMatchBehaviour.EXECUTE
OnmatchBehaviour.CANCEL
OnmatchBehaviour.ADJUST</code></pre><p>But because we used a boolean to start with, we now have to change many places from <code>true</code> and <code>false</code>. We may also
be making a breaking change to our API. If we had used an enum in the first place, our change would have been much easier
to make.</p>
<p>I recommend using Enums as much as you can instead of booleans. The enum can have a <code>boolean isSomething()</code> method to be
used in an <code>if</code> statement. If you then need to add a third enum, removing the <code>isSomething()</code> method will then result
in a compilation failure, ensuring that you update the code in all the correct places.</p>
<p>Alternatively, you could use a <code>switch()</code> statement without a default case, so that a new Enum also results in a
compilation failure.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Getting to Senior Developer: Prioritisation</title>
      <link>https://liamasman.com/blog/posts/2025/06/getting-to-senior-developer-prioritisation/</link>
      <pubDate>Wed, 25 Jun 2025 05:00:00 +0100</pubDate>
      <guid>https://liamasman.com/blog/posts/2025/06/getting-to-senior-developer-prioritisation/</guid>
      <description>&lt;p&gt;Being self-organised is a key attribute for becoming a senior software engineer. Part of self-organisation is the ability to prioritise tasks.&lt;/p&gt;&#xA;&lt;p&gt;Developers may get stuck pursuing minor software improvements over adding real value. This could be due to&#xA;inexperience in estimating effort versus value, and not realising when a task is taking longer than expected. Alternatively, the developer&#xA;could be choosing a low-value task that feels comfortable; achieving a solo contribution.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Being self-organised is a key attribute for becoming a senior software engineer. Part of self-organisation is the ability to prioritise tasks.</p>
<p>Developers may get stuck pursuing minor software improvements over adding real value. This could be due to
inexperience in estimating effort versus value, and not realising when a task is taking longer than expected. Alternatively, the developer
could be choosing a low-value task that feels comfortable; achieving a solo contribution.</p>
<p>When you have the freedom to choose what to work on, consider the priorities for the team and how you can best help. Remember:
today&rsquo;s priority may not be the same as yesterday&rsquo;s, so you may need to shelve what you are working on. This is okay: the work is not lost.</p>
<p>If you are not sure what the priorities are, ask! This will show initiative and higher-level thinking.</p>
<p>It&rsquo;s important to note that low <em>business</em> value does not mean low value: maintaining a healthy codebase is important. This is where the skill of
prioritisation comes in: technical debt reduction must be balanced alongside the goals of the business.</p>
<p>Think: What is the goal? How do I help us get there?</p>
]]></content:encoded>
    </item>
    <item>
      <title>Trunk-based development</title>
      <link>https://liamasman.com/blog/posts/2025/04/trunk-based-development/</link>
      <pubDate>Sat, 19 Apr 2025 16:30:00 +0100</pubDate>
      <guid>https://liamasman.com/blog/posts/2025/04/trunk-based-development/</guid>
      <description>&lt;h2 id=&#34;what-is-trunk-based-development&#34;&gt;What is trunk-based development?&lt;/h2&gt;&#xA;&lt;p&gt;Trunk-based development is a collaborative development approach where all developers&#xA;commit directly to the main branch (often called &amp;ldquo;trunk&amp;rdquo;). Feature branches and&#xA;pull-requests should be avoided. Instead, teams rely on fast feedback loops,&#xA;high collaboration, and strong CI practices to maintain code quality and stability.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-is-trunk-based-development-better-than-branches&#34;&gt;Why is trunk-based development better than branches?&lt;/h2&gt;&#xA;&lt;p&gt;Feature branches are ineffective for several reasons:&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-slow-feedback-loop&#34;&gt;1. Slow feedback loop&lt;/h3&gt;&#xA;&lt;p&gt;The pull request cycle requires waiting for a reviewer. After receiving feedback,&#xA;you make changes, then wait again. Repeat ad nauseum.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<h2 id="what-is-trunk-based-development">What is trunk-based development?</h2>
<p>Trunk-based development is a collaborative development approach where all developers
commit directly to the main branch (often called &ldquo;trunk&rdquo;). Feature branches and
pull-requests should be avoided. Instead, teams rely on fast feedback loops,
high collaboration, and strong CI practices to maintain code quality and stability.</p>
<h2 id="why-is-trunk-based-development-better-than-branches">Why is trunk-based development better than branches?</h2>
<p>Feature branches are ineffective for several reasons:</p>
<h3 id="1-slow-feedback-loop">1. Slow feedback loop</h3>
<p>The pull request cycle requires waiting for a reviewer. After receiving feedback,
you make changes, then wait again. Repeat ad nauseum.</p>
<h3 id="2-merge-conflicts">2. Merge conflicts</h3>
<p>You wrote the code against a version of the main branch. It may have moved on
since then. You now have to spend time fixing merge-conflicts.</p>
<h3 id="3-quality">3. Quality</h3>
<p>Reviewers did not write the code. Reading and understanding code takes time,
especially for a pull request for a full feature - otherwise it gets skimmed and
rubber-stamped. Either quality suffers, or velocity does.</p>
<h2 id="how-do-we-keep-quality-high-without-pull-requests">How do we keep quality high without pull requests?</h2>
<h3 id="pair-programming">Pair programming</h3>
<p>Pair programming means continuous code review. No waiting. Code quality improves,
defects are caught early, and features are developed faster as pairs bounce ideas
between themselves, rather than waiting for responses to questions in a team channel.</p>
<p>Pair programming also results in better knowledge sharing and improved developer
satisfaction.</p>
<h3 id="test-driven-development-and-responsive-ci">Test driven development and responsive CI</h3>
<p>Commit early, commit often. Comprehensive test suites should be run for every commit.
The test suite should complete quickly - ideally within 10 minutes. If a commit
breaks the build, revert immediately. Don&rsquo;t wait for the next developer to notice.
Don&rsquo;t leave the broken commit while you fix the bug. Revert - push - fix - push.</p>
<p>Trunk should always be releasable.</p>
<h3 id="feature-toggles-and-incremental-commits">Feature toggles and incremental commits</h3>
<p>Big features often require a lot of work to get working; an acceptance test for
a feature may not pass until the end of development.
Instead of completing the entire feature before committing, disable
the test and commit in small, testable increments.</p>
<p>Use static feature flags to disable compilation or run-time behaviour that
shouldn&rsquo;t be visible to users yet. You can safely commit
code with a failing test, as long as it doesn&rsquo;t cause the tests for existing behaviour
to fail, and the failing test is disabled until the feature flag is enabled.</p>
<p>This lets us commit in small, frequent batches. Any merge conflicts will then hopefully be
minimal in scope and impact.</p>
<h2 id="other-benefits">Other benefits</h2>
<h3 id="ship-more-often">Ship more often</h3>
<p>The only code that matters is code that is in production.
The only code that is in production is code that is in the main branch.
Working on trunk means working on what matters.</p>
<p>By having trunk always in a releasable state, we can ship to production at any
time. This means we can ship as often as we&rsquo;d like.</p>
<h3 id="boosted-morale">Boosted morale</h3>
<p>Developers like to get things into production. Having code sit on a feature
branch for a long time damages morale. Big-bang releases are also anxiety inducing.
Both of these are avoided with trunk-based development and frequent releases.</p>
<h3 id="better-collaboration">Better collaboration</h3>
<p>Long-lived branches create knowledge silos; when a developer spends a long time
on a feature branch they become the de facto owner of that code. If they are
away for any reason, progress stalls.</p>
<p>This is avoided with pair-programming and frequent commits to the main branch
which form a log of work done and break the task up into smaller, more manageable
tasks.</p>
<h2 id="in-summary">In summary</h2>
<p>For faster delivery, better software quality, and happier teams:</p>
<ul>
<li>Pair program</li>
<li>Write tests first</li>
<li>Run fast CI</li>
<li>Commit small, commit often, commit to main</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>Vibe Coding</title>
      <link>https://liamasman.com/blog/posts/2025/04/vibe-coding/</link>
      <pubDate>Thu, 17 Apr 2025 18:00:00 +0100</pubDate>
      <guid>https://liamasman.com/blog/posts/2025/04/vibe-coding/</guid>
      <description>&lt;p&gt;&amp;ldquo;Vibe Coding&amp;rdquo; is a term used to describe the creation of software simply by&#xA;prompting an LLM, and accepting whatever it outputs.&lt;/p&gt;&#xA;&lt;p&gt;Although the term soon became the butt of some jokes, I believe there is a place&#xA;for &amp;lsquo;Vibe Coding&amp;rsquo; in serious software development.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;        &#xA;        &lt;img src=&#34;https://liamasman.com/blog/posts/2025/04/vibe-coding/vibe-tweet_hu_b6a0507b350a280f.png&#34; alt=&#34;Post on X (formerly known as Twitter) by Andrej Karpathy (@karpathy). 11:17pm, 2 February 2025. There\&amp;#39;s a new kind of coding I call \&amp;#34;vibe coding\&amp;#34;, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists. It\&amp;#39;s possible because the LLMs (e.g. Cursor Composer w Sonnet) are getting too good. Also I just talk to Composer with SuperWhisper so I barely even touch the keyboard. I ask for the dumbest things like \&amp;#34;decrease the padding on the sidebar by half\&amp;#34; because I\&amp;#39;m too lazy to find it. I \&amp;#34;Accept All\&amp;#34; always, I don\&amp;#39;t read the diffs anymore. When I get error messages I just copy paste them in with no comment, usually that fixes it. The code grows beyond my usual comprehension, I\&amp;#39;d have to really read through it for a while. Sometimes the LLMs can\&amp;#39;t fix a bug so I just work around it or ask for random changes until it goes away. It\&amp;#39;s not too bad for throwaway weekend projects, but still quite amusing. I\&amp;#39;m building a project or webapp, but it\&amp;#39;s not really coding - I just see stuff, say stuff, run stuff, and copy paste stuff, and it mostly works.&#34; class=&#34;post-img&#34; title=&#34;I&amp;#39;m not sure about the term, but Andrej has a point about it being &amp;#39;Not bad for throwaway weekend projects&amp;#39;&#34; loading=&#34;lazy&#34;&gt;&#xA;    &#xA;&#xA;&lt;span class=&#34;img-caption&#34;&gt;&#xA;    &#xA;Andrej Karpathy has been credited with coining the term &#34;Vibe Coding&#34;.&#xA;&#xA;&lt;/span&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>&ldquo;Vibe Coding&rdquo; is a term used to describe the creation of software simply by
prompting an LLM, and accepting whatever it outputs.</p>
<p>Although the term soon became the butt of some jokes, I believe there is a place
for &lsquo;Vibe Coding&rsquo; in serious software development.</p>
<p>


    
    
    
    
        
        <img src="https://liamasman.com/blog/posts/2025/04/vibe-coding/vibe-tweet_hu_b6a0507b350a280f.png" alt="Post on X (formerly known as Twitter) by Andrej Karpathy (@karpathy). 11:17pm, 2 February 2025. There\&#39;s a new kind of coding I call \&#34;vibe coding\&#34;, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists. It\&#39;s possible because the LLMs (e.g. Cursor Composer w Sonnet) are getting too good. Also I just talk to Composer with SuperWhisper so I barely even touch the keyboard. I ask for the dumbest things like \&#34;decrease the padding on the sidebar by half\&#34; because I\&#39;m too lazy to find it. I \&#34;Accept All\&#34; always, I don\&#39;t read the diffs anymore. When I get error messages I just copy paste them in with no comment, usually that fixes it. The code grows beyond my usual comprehension, I\&#39;d have to really read through it for a while. Sometimes the LLMs can\&#39;t fix a bug so I just work around it or ask for random changes until it goes away. It\&#39;s not too bad for throwaway weekend projects, but still quite amusing. I\&#39;m building a project or webapp, but it\&#39;s not really coding - I just see stuff, say stuff, run stuff, and copy paste stuff, and it mostly works." class="post-img" title="I&#39;m not sure about the term, but Andrej has a point about it being &#39;Not bad for throwaway weekend projects&#39;" loading="lazy">
    

<span class="img-caption">
    
Andrej Karpathy has been credited with coining the term "Vibe Coding".

</span></p>
<p>Let&rsquo;s be clear; this is not a replacement for software development. Unchecked,
untested code should not make its way to production. I do not believe AI will be
a replacement for programmers any time soon, and certainly not in its current
state.</p>
<p>What AI can do is improve a developer&rsquo;s productivity. If I do not know how to
build an iOS app, AI can get me started, or if I do not know a particular API, AI
can point me in the right direction. This is AI used as a learning aid. All the
AI&rsquo;s output should be read, understood. Anything that is confusing should be
clarified and verified. Production code should be tested, and the test cases
designed by a human.</p>
<p>If I need to write a suite of similar looking tests, AI can help me generate them.
This is AI used as a productivity tool to remove tedious, repetitive tasks. Again,
all the AI&rsquo;s output should be checked.</p>
<p>&lsquo;Vibe coding&rsquo;, at its extreme, involves blindly accepting whatever the LLM has
generated. We do not check the output, we do not understand it. We run the
program, and if it does something wrong, we tell the AI to fix it. Edge cases
are ignored, and the code is not backed by a comprehensive test suite.
This is code that is fragile. This is code that is unmaintainable.</p>
<p>This is code that is not fit for production.</p>
<p>But it is fit for a prototype. It is fit for a proof of concept. It is fit for a
hackathon.</p>
<p>To build good software fast, we need an engineering mindset. We need to test
early and often and get fast feedback. A common issue in commercial software
development is that the business doesn&rsquo;t know what it wants, or isn&rsquo;t aware of
all the issues or edge cases that need business consideration.</p>
<p>A prototype that can be built quickly with vibe coding can be shown to the
business team and used to gather feedback. It can be used to explore the
problem space. It can be used to explore the solution space. It can be used to
explore the user experience. It can be used to explore the technology stack.
It can be used to explore the business model.</p>
<p>Once you have your feedback, and you move to writing production quality software,
the vibe code may be referenced, but picked from with consideration. Standard
software engineering practices should be followed; pair-programming and test-driven-development
must not be forgotten about. Ensure those that see the prototype understand that
it is an early prototype for gathering feedback, and not production quality code -
we all know how sales people can take a prototype and run with it!</p>
<p>I expect that in the future AI will be a competent pair-programmer. I do not
think we are at that stage yet. To blindly trust AI code would be a mistake. But
we do not need to trust it for it to be useful.</p>
<p>So get vibing! Try it yourself, but remember to set boundaries. Start a dialogue
with your teams about how to use AI in your software development process.
Finally, share your experiences! The more we share our experiences of using AI,
the faster the engineering community can learn and adapt to this rapidly
evolving technology.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
