<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Coding on Bill Glover</title>
		<link>https://old.bill.dev/tags/coding/</link>
		<description>Recent content in Coding on Bill Glover</description>
		<generator>Hugo</generator>
		<language>en-gb</language>
		
			<managingEditor>hello@bill.dev (Bill)</managingEditor>
		
		
			<webMaster>hello@bill.dev (Bill)</webMaster>
		
		
		
			<lastBuildDate>Sun, 28 Sep 2025 22:27:35 +0100</lastBuildDate>
		
			<atom:link href="https://old.bill.dev/tags/coding/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Diy Traffic Lights</title>
				<link>https://old.bill.dev/2022/05/01/diy-traffic-lights/</link>
				<pubDate>Sun, 01 May 2022 17:32:04 +0100</pubDate><author>hello@bill.dev (Bill)</author>
				<guid>https://old.bill.dev/2022/05/01/diy-traffic-lights/</guid>
				<description>&lt;p&gt;The imagination of a child can bring a Lego city to life. I can still remember my dad helping me build an automated &amp;ldquo;Mind the Gap&amp;rdquo; announcement for the 12V Lego railway system. It was a classic case of over-engineering; completely unnecessary but so much fun.&lt;/p&gt;&#xA;&lt;p&gt;A microswitch carefully placed at the end of a station platform joined two pins on a parrallel port cable (the wide ones that we used to use to connect printers). A BASIC program running in an infinite loop handled switch de-bouncing and then started a sequence of beeps accompanied by text on an orange display to warn the little Lego figures they needed to Mind the Gap when leaving the train. I loved it.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Go on ARM: why struct field alignment matters</title>
				<link>https://old.bill.dev/2020/06/19/go-on-arm-why-struct-field-alignment-matters/</link>
				<pubDate>Fri, 19 Jun 2020 14:00:00 +0000</pubDate><author>hello@bill.dev (Bill)</author>
				<guid>https://old.bill.dev/2020/06/19/go-on-arm-why-struct-field-alignment-matters/</guid>
				<description>&lt;p&gt;I&amp;rsquo;d assumed the Go compiler provided a robust abstraction across CPU architectures. Code that ran on one CPU architecture would run on another. It turns out I was wrong. In this post, I provide a minimal example application that demonstrates the importance of field alignment when using &lt;code&gt;sync/atomic&lt;/code&gt; and &lt;code&gt;64-bit&lt;/code&gt; values.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;package&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;fmt&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fmt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;Println&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Hello, 世界&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can build and run this program on our local machine (in my case a MacBook) with the following command.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Learn Go: by Concatenating Strings</title>
				<link>https://old.bill.dev/2019/03/13/learn-go-by-concatenating-strings/</link>
				<pubDate>Wed, 13 Mar 2019 13:02:49 +0000</pubDate><author>hello@bill.dev (Bill)</author>
				<guid>https://old.bill.dev/2019/03/13/learn-go-by-concatenating-strings/</guid>
				<description>&lt;p&gt;Joining strings is so common that many of us take it for granted. While working through the exercises in &amp;lsquo;The Go Programming Language&amp;rsquo; book as part of the London Study Group, I wanted to understand the differences between the various approaches for joining strings.&lt;/p&gt;&#xA;&lt;p&gt;If you are looking to concatenate strings in Go, here is what I&amp;rsquo;d do:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Outside a loop: use the &lt;code&gt;+&lt;/code&gt; operator: e.g. `&amp;ldquo;a&amp;rdquo; + &amp;ldquo;b&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Inside a loop: use &lt;code&gt;strings.Join([]string, string)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you want to know why read on. The notes that follow are primarily for my own understanding. They chart my attempt to explain the results of exercise 1.3 and explore different options for string concatenation.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
