week 25, 2022

Don't let dicts spoil your code

The simplicity of organic code growth has a flip side: it becomes too hard to maintain. The proliferation of dicts as primary data structures is a clear signal of tech debt in your code. Fortunately, modern Python provides many viable alternatives to plain dicts.

Source: Don't let dicts spoil your code, an article by Roman Imankulov.

Go Patterns - Fanning

Fanning is a handwave-y term for ‘taking a lot of stuff, using it in a variety of different places, and consolidating it all back to one place.’

Source: Go Patterns - Fanning, an article by Sean Hinchee.

Westland Boat Parade

Early in the afternoon Esme, some friends, and I went to see the Westland Boat Parade. The boats are decorated with flowers, fruits, and vegetables.

One of the boats in the parade
One of the boats in the parade.

Later, when I got up, Esme spotted a tiny rodent. It ran towards her, she was still sitting, and nestled itself against her upper leg. Carefully I picked up the little animal and Esme took a few photos. I guess it's a common vole, Microtus arvalis. I moved the tiny animal to a safe spot in the shadow of a tree.

Common vole, Microtus arvalis, on my hand. Photo by Esme
Common vole, Microtus arvalis, on my hand. Photo by Esme.
One of the boats in the parade
One of the boats in the parade.
One of the boats in the parade
One of the boats in the parade.

Dangit, Git!?!

Git is hard: messing up is easy, and figuring out how to fix your mistakes is impossible. Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about in order to fix your problem.

Source: Dangit, Git!?!, an article by Katie Sylor-Miller et al.

Nobody (2021)

A docile family man slowly reveals his true character after his house gets burgled by two petty thieves, which, coincidentally, leads him into a bloody war with a Russian crime boss.

In the evening Esme and I watched Nobody. I liked the movie, it reminded me a bit of the John Wick movies, and give it an 8 out of 10.

Hardening macOS

This guide is about security, not privacy.

Additionally, security measures that heavily compromise usability were not included.

This guide aims to produce above-average secure systems, without giving up features.

Source: Hardening macOS, an article by Ricard Bejarano.

The Northman (2022)

From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder.

In the evening I watched The Northman. I liked the movie and give it a 7 out of 10.

The list of monoids pattern

In this post, I want to share a small little pattern that I’ve found to have a surprisingly high quality-of-life improvement, and I call it the list of monoids pattern.

The idea is that whenever we have a monoidal value - a type that is an instance of the Monoid type class - we can sometimes produce a more ergonomic API if we change our functions to instead to a list of these monoidal values.

Source: The list of monoids pattern, an article by Ollie Charles.

Effective Shell

This book is for anyone who is interested in computing, and wants to learn more about the exciting, but sometimes daunting world of The Shell. The shell is simple interface for working with computers and programs and learning some of its features can enormously increase your productivity as any computer user - whether a home user or hobbyist, programmer, data scientist, writer, administrator or other professional.

Source: Effective Shell an online book by Dave Kerr.

Failure is your Domain

Go’s paradox is that error handling is core to the language yet the language doesn’t prescribe how to handle errors. Community efforts have been made to improve and standardize error handling but many miss the centrality of errors within our application’s domain. That is, your errors are as important as your Customer and Order types.

Source: Failure is your Domain, an article by Ben Johnson.

Why new Macs break your Docker build, and how to fix it

One of the promises of Docker is reproducibility: you can build an image on a different machine, and assuming you’ve done the appropriate setup, get the same result. So it can be a little confusing when you try to build your Python-based Dockerfile on a new Mac, and everything starts failing. What used to work before—on an older Mac, or on a Linux machine—fails in completely unexpected ways.

Source: Why new Macs break your Docker build, and how to fix it, an article by Itamar Turner-Trauring.

Error Messages in Haskell, and how to Improve them

I’ve been writing more and more Haskell lately, as part of a side project involving GraphQL. As part of working with the language, I’ve had to work with its compile errors. The Haskell compiler gives you errors that are extremely informative—if you know the language. If you don’t know the language very well, the compiler errors can occasionally be opaque and unhelpful.

I’ve very much enjoyed using Haskell, and I figure the best way for me to give back to the community is to make this situation a little better. In order to do this, we’re going to take a fun dive into Haskell errors, why they’re confusing, and how they might be improved.

Source: Error Messages in Haskell, and how to Improve them.

nixpkgs bootstrap intro

This post is an informal walk through bootstrap setup of nixpkgs. It’s quite long and has many facets we look at here. If you don’t understand some bits of it don’t worry: it’s both a complicated topic and I did a bad job at explaining it.

Source: nixpkgs bootstrap intro.