Yay, six day weekend! Gonna get my day walks in. 🌲

While poking through some old GarageBand projects I came across this track I wrote a few of years ago. I didn’t think much of it of the time, but over the last day or so, it’s started to grow on me.

I’ve been asked to prepare a presentation for work, which means I have an opportunity to use iA Presenter. It’s clear that I’ll have to unlearn my Powerpointing ways.

One thing Slack has recently started doing is formatting CSV snippets as tables. This is a great feature. Being able to paste a CSV export directly into a channel, without having to format it as an ASCII-art table to make it readable, is really nice.

Will try not to make too long a comment about how I generated a report for someone, with created and updated dates for each row, and the first question they asked me is which row is the most recent one. πŸ˜’

Why I Like Go

This question was posed to me in the Hemispheric Views Discord the other day. It’s a bit notable that I didn’t have an answer written down for this already, seeing that I do have pretty concrete reasons for why I really like Go. So I figured it was time to write them out.

I should preface this by saying that by liking Go it doesn’t mean I don’t use or like any other languages. I don’t fully understand those that need to dislike other languages like they’re football teams. “Right tool for the job” and all that. But I do have a soft-spot for Go and it tends to be my go-to language for any new projects or scripting tasks.

So here it is: the reasons why I like Go.

First, it’s simplicity. Go is not a large language, and a large majority of it you can keep in your working memory. This makes Go easy to write and, more importantly, easy to read.

It might seam that a small feature set makes the language quite limiting. Well, it does, to a degree, but I’d argue that’s not a bad thing. If there are only a couple of ways to do something, it makes it way easier to predict what code you’re expecting to see. It’s sort of like knowing what the next sentence will be in a novel: you know a piece of logic will require some dependant behaviour, and you start thinking to yourself “how would I do that?” If the answer space is small, you’re more likely to see what you expect in the actual code.

But just because Go is a deliberately small language doesn’t mean that it’s a stagnant language. There have been some pretty significant features added to it recently, and there are more plans for smoothing out the remaining rough edges. It’s just that the dev team are very deliberate in how they approach these additions. They consider forward compatibility as much as they do about backwards compatibility, being careful not to paint themselves into a corner with every new feature.

Type parameters are a great example of this. There were calls for type parameters since Go 1.0, but the dev team pushed back until they came up with a design that worked well for the language. It wasn’t the first design either. I remember one featuring some new constraint-based constructs that did about 80% what interfaces were doing already. If that were shipped it would’ve meant a lot of extra complexity just for type parameters. What was shipped isn’t perfect, and it doesn’t cover every use case type parameters could theoretically support. But it made sense: type parameters built on interfaces, a construct that already existed and was understood.

This, I think, is where C++ fails to a huge degree. The language is massive. It was massive 30 years ago, and they’ve been adding features to the language every few year since, making it larger still. I see Apple doing something similar with Swift, and I’m not sure that’s good for the language. It’s already quite a bit larger than Go, and I think Apple really should curb their desire for adding features to the language unless there’s a good reason for doing so.

The drive for simplicity also extends to deployments. Go is compiled to a static binary, one that is extremely portable and could be easily deployed or package as you so desire. No need to fluff about with dependencies. This is where I found Go having a leg-up over scripting languages, like Python and Ruby. Not because Go is compiled (although that helps) but that you have less need to think about packaging dependencies during a deploy. I wrote a lot of Ruby before looking at Go, and dealing with gems and Bundle was a pain. I’m not a huge Python expert to comment on the various ways that language deals with dependencies, but hearing about the various ways to setup virtual environments doesn’t fill me with confidence that it’s simple.

And I will admit that Go’s approach to this isn’t perfect either. For a long while Go didn’t even have a way to manage versioned dependencies: they were all lumped into a single repository. The approach with modules is better, but not without some annoyances themselves. Any dependency that goes beyond version 1 requires you to change the import statement to include a vX, an unnecessary measure if the version change is backwards compatible. That’s not even considering packages that avoid this, and are forever on version 1 (or 0).

But since moving to modules my encounters with package dependencies issues remains quite rare, and once you’ve got the build sorted out, that’s it. No need to deal with packaging after that.

And I’d argue that Go rides that sweet-spot between a scripting language like Python and Ruby, and a compiled language like C (maybe Rust, but I know very little of that language to comment on it). It’s type safe, but type inferences make it easy to write concise code without excessive annotations everywhere. It’s compiled to an executable, yet memory is managed for you. I won’t talk about how Go does concurrency, but after dealing with Java threads for several years, using them are a joy.

I should probably balance the scale a bit and talk about areas where I think Go could be made better. The big one is error handling. While I do like the principals β€” that errors are values and can be handled as such β€” it does mean a lot of boilerplate like this:

foo, err := doThis()
if err != nil {
  return err
}

bar, err := doThat(foo)
if err != nil {
  return err
}

baz, err := doAnotherThing(bar)
if err != nil {
  return err
}

To the Go teams credit, the are looking at improving this. And I think there’s enough prior art out there for a solution that’ll look pretty nice without having to resort to exceptions. Maybe something like Swift’s guard statement, that can be used in an expression.

And yeah, other areas of Go, like it’s support for mobile or GUI-style programming and lacking a bit. That could probably be plugged with third-party modules to a degree, although I think because Go is not an object-orientated language, the seals won’t be perfect (take a look at Go’s implementation of QT to see how imperfect Go maps to a toolkit that assumes objects). And some gaps need to be plugged by Google themselves, like with mobile support (they do have something here, but I’m not sure to what degree they’re being maintained).

But I’m sure most of these issues are surmountable. And no language is perfect. If Go doesn’t work for a situation, I’ll use Java or Swift or something else. “Right tool for the job” and all that.

So these are the reasons why I like Go. And I think it all boils down to trying to keep the language simple while still being useful. And as far as my experience with Go is concerned, those maintaining it are doing a pretty stellar job.

Got a hair cut today. Same cut as always: no. 3 round the side and trim with scissors on the top. I wonder if barbers get sick of trivial cuts like this. Wonder if it’s to cosmetology as building yet another CRUD app is to computer science.

Stealing an idea from Rob Knight and changing Working Set to a GitBooks powered digital garden. Still need to import the blog posts to this site before I can move the domain, but the various reference and technique posts are there now. We’ll see how long I’ll settle with this arrangement.

It’s interesting seeing the different names used in unit tests to identify the setup, test, and verification stages. I’ve seen “given”, “when,” and “then” used a lot in a previous role. Today I found a different convention: “arrange”, “act,” and “assert”.

Lunch at South Melbourne Market.

Entrance to the food hall, with a fish seller on the left.

Happy new theme day. Figured it was time for a new look for this site so I changed the theme from Arabica to Tiny Theme by @mtt. Gotta say, looks pretty good! I’ve got some ideas for customising it slightly but love the fresh new look it gives.

Pro-tip: if you’re waiting outside, don’t get caught in hail.

Carpark with the front of a black 4WD in the hail

Work Email Spam

Opened my work email this morning and received a greeting from the following spam messages:

  • Webinar to “overcome the fear of public speaking” from some HR Training mob
  • A training course on “accelerating innovation in data science an ML” (there’re a few emails about AI here)
  • Webinars from Stripe, Slack, and Cloudflare about how other companies are using them
  • Weekly updates about what’s happening on our Confluence wiki (this probably could be useful… maybe? But our wiki is so large that most updates are about things other teams are working on)
  • A training course on some legal mandates about hiring (honestly, my email must’ve appeared on some mailing list for HR professionals)
  • Another webinar from the first training mob about dealing with “employees from hell”

Marked all as read, closed email, and opened Slack.

Follow-up to yesterday: I was curious to know if the click-track is only present in bounces of projects imported from GarageBand, or if it also occurs in Logic Pro projects created from scratch. After a quick test, it looks like it doesn’t matter where the project is from: the clicks are there.

TIL that Logic Pro will include the click-track in the bounce if it’s left on. This “feature” costed me a fair bit of rework today. I’d prefer it if the click-track is never in the bounce unless you enable it otherwise. More likely to show intent: wanting it there vs. forgetting to turn it off.

This conversation with @Gaby got my creative juices flowing so I though I’d put together a small video tutorial for using the GLightbox plugin by @jsonbecker. There have been a few updates with the plugin so how I use it might be slightly out of date. Either way, please enjoy.

I enjoyed today’s issue of People and Blogs with Jim Nielsen. I’m a huge fan of Jim Nielson’s blog and it’s always fun reading about how people like Jim started their blogging careers.

Apart from looking at Fiber this week, I also took a look at import maps. I was skeptical at first, but after using them I can probably learn to like them, especially if it means no build step for JavaScript. Would be nice if I could put them in a separate file, but I guess that’ll come in time.

Funny how we’ve gone from online services being famous for getting users off their site as quickly as possible (Google circa 2000), to online services warning users that they’re leaving the site when they click on a link (Discord circa today).

My upcoming trip will take 40 minutes, so I can probably give it 45 minutes to get there. I don’t need to leave an hour out.

Honestly, thank goodness I’m in software development. I’m too anxious for a job in logistics.