arp242.net

Website of Martin Tournoij/arp242. I write about stuff, occasionally.
https://www.arp242.net/ (RSS)
visit blog
Against best practices
16 Nov 2024 | original ↗

I have come to believe that by and large “best practices” are doing more harm than good. Not necessarily because they’re bad advice as such, but because they’re mostly pounded by either 1) various types of zealots, idiots, and assholes who abuse these kind of “best practices” as an argument from authority, or 2) inexperienced programmers who lack...

Jia Tanning Go code
28 Oct 2024 | original ↗

The Go compiler skips files ending with _test.go during normal compilation. They are compiled with go test command (together will all other .go files), which also inserts some chutney to run the test functions. The standard way to do testing is to have a foo.go and foo_test.go file next to each other. If you have a file that appears to end with...

Safe terminal escape codes
22 May 2024 | original ↗

th { text-align:left; } tbody >tr >td:nth-child(1), tbody >tr >td:nth-child(2) { font-family:monospace; white-space:pre; } A long time ago when the Unix greybeards were slightly less grey beards everyone was using hardware terminals to talk to some mainframe. Those terminals had wildly different feature sets and ways to...

s/bash/zsh/g
20 Oct 2021 | original ↗

You would expect this to work, no? bash% echo $(( .1 + .2 )) bash: .1 + .2 : syntax error: operand expected (error token is ".1 + .2 ") Well, bash says no, but zsh just works: zsh% echo $(( .1 + .2 )) 0.30000000000000004 # Well, "works" insofar IEEE-754 works. There is simply no way you can do calculations with fractions in bash without...

Getting started with RimWorld modding on Linux
29 Sept 2021 | original ↗

This describes how to create RimWorld mods on Linux; this is an introduction to both RimWorld modding and developing C♯ with Mono; it’s essentially the steps I followed to get started. This doesn’t assume any knowledge of Unity, Mono, or C♯ but some familiarity with Linux and general programming is assumed; if you’re completely new to programming...

Stallman isn't great, but not the devil
25 Mar 2021 | original ↗

So Richard Stallman is back at the FSF, on the board of directors this time rather than as President. I’m not sure how significant this position is in the day-to-day operations, but I’m not sure if that’s really important. How anyone could have thought this was a good idea is beyond me. I’ve long considered Stallman to be a poor representative of...

Go is not an easy language
22 Feb 2021 | original ↗

Go is not an easy programming language. It is simple in many ways: the syntax is simple, most of the semantics are simple. But a language is more than just syntax; it’s about doing useful stuff. And doing useful stuff is not always easy in Go. Turns out that combining all those simple features in a way to do something useful can be tricky. How do...

Downsides of working remotely
18 Feb 2021 | original ↗

I love remote work, and I’ve been working remotely for the last five years, but I think there are some serious downsides too. In spite what all the “remote work is the future!” articles of the last year claim, it’s not all perfect, or suitable for everyone. Working remotely means less socializing with your coworkers: fewer chats over the coffee...

Bitmasks for nicer APIs
10 Dec 2020 | original ↗

Bitmasks is one of those things where the basic idea is simple to understand: it’s just 0s and 1s being toggled on and off. But actually “having it click” to the point where it’s easy to work with can be a bit trickier. At least, it is (or rather, was) for me 😅 With a bitmask you hide (or “mask”) certain bits of a number, which can be useful for...

Stupid light software
29 Nov 2020 | original ↗

The ultralight hiking community is – as you may gather from the name – very focused on ultralight equipment and minimalism. Turns out that saving a bit of weight ten times actually adds up to a significant weight savings, making hikes – especially longer ones of several days or weeks – a lot more comfortable. There’s also the concept of stupid...

↑ These items are from RSS. Visit the blog itself at https://www.arp242.net/ to find everything else and to appreciate author's digital home.