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...
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...
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...
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...
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...
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 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...
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 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...
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...