Here’s a belief I’ve held for a while but only recently been able to put into words: explanatory comments are often easier to understand than explanatory variable or function names. Consider a complicated expression with multiple sub-expressions. This expression is going to be difficult for the next person reading this code to decipher; we should make it easier for them. There are a couple of ways to solve this. We could break down the expression into sub-expressions, and assign those sub...| jonathan-frere.com
If you’re used to React, you’re probably used to using useEffect to run side-effectful code, such as integrating with third-party libraries or setting up MutationObservers1. SolidJS also has createEffect, which works very similarly to useEffect, but it also has some other functions, and I’ve noticed that people getting started with SolidJS often aren’t sure which function to use for any given side-effects. If you’re in that boat, then here is the answer in tabular form:| jonathan-frere.com
A bit over a month ago, I switched my blog over to BunnyCDN. I wanted to update that post when the trial period was up, but I ended up being busy, so here’s an update from a month and change in. Pricing First, a note on the free trial. The trial period lasts 14 days, and during this period I was given $20 of “trial credit” that expired as soon as the trial was over. I could have earned more credit by providing an automatic payment method — although for me that wasn’t necessary at all.| Posts on Jonathan's Blog
This is a quick post to point out a potential issue that might catch you out with using Fastify’s sessions mechanism alongside tRPC’s websockets transport, and how I’ve fixed it in my projects. The problem happens with an application that looks something like this: const app = Fastify(); app.register(ws); app.register(fastifyCookie); app.register(fastifySession, { secret: "..." }); app.register(fastifyTRPCPlugin, { prefix: "/trpc", useWSS: true, trpcOptions: { router, onError, createCon...| jonathan-frere.com
Given some recent, uh, instability in US politics, and given that everyone likes an underdog, I’ve been looking at European alternatives to my current hosting situation, which is Cloudflare. After looking through european-alternatives.eu, and reading some opinions on Bluesky, I figured I’d try out BunnyCDN, which is a CDN service based in Slovenia. The process of completely switching over to BunnyCDN was remarkably easy, and took a little under two hours to set up.| jonathan-frere.com
Jujutsu is a relatively new version control system that is designed around working directly with commit-like objects called “changes”1. Each change has an ID, and these IDs are important because they’re the main way of referring to different changes2. To make referencing these IDs a bit easier, Jujutsu often shows ID prefixes rather than the whole ID when displaying commits (such as in the jj log command). This is similar to how Git can show an abbreviated commit hash, (typically 7-8 ch...| jonathan-frere.com
I’ve come to accept that I’m just a sucker for shiny nerd things. I use Rust, despite never having had a professional reason to use it in my life. I switched to Linux in my student years and I’ve never looked back since, even though it constantly breaks and I can’t get my Bluetooth headphones to connect. I have a split keyboard with home row mods set up because I read some random blog posts and it looked cool to me.| jonathan-frere.com
During the Pandemic, I found the YouTube channel Cracking the Cryptic, which is run by two champion puzzlers, Simon and Mark, who solve various logic puzzles, focusing mainly on variant sudoku. Variant sudoku adds additional rules to a normal sudoku grid — for example killer sudoku, where all the numbers in a certain marked area need to add up to a certain number. As you add more rules, they often end up combining in weird and clever ways, and you can logically deduce more about the grid wi...| jonathan-frere.com
As of the beginning of September, I’ve been programming “with purpose” for a decade. Before then it was just a hobby — something I could do in my room while burying my head in the sand about the Physics degree I was failing at the time. But that summer, I realised maybe if I was choosing to spend all my free time coding, maybe it was worth trying to pursue that as a career instead.| jonathan-frere.com
I enjoy reading other people’s blog posts, but I often enjoy reading the comments more. The post itself becomes a jumping-off point for further discussion, where people can add critique, additional supporting evidence, or their own alternative explanations. Or just get side-tracked by one specific line in the article and start a whole flame-war about it. But having your own comment section means supporting forms, loading the comments dynamically somehow, handling moderation, and right now I...| jonathan-frere.com
This review is largely in response to the article “It’s probably time to stop recommending Clean Code”, and the ensuing Reddit discussion. A lot of really interesting points were brought up, but the big question that the author themself wasn’t able to answer was: “What should we recommend instead?” I believe the book we should be recommending is A Philosophy of Software Design by John Ousterhout. In this post I want to spend a bit of time reviewing it and giving an overview of the...| jonathan-frere.com
Why do you write tests? I’ve been thinking about this question a lot recently. I’ve been trying to motivate some teammates that tests are worth writing. But I’m going to convince them of that, I need to be able to answer that question for myself, right? Tests sometimes get portrayed as one of the chores of software development. As a new developer, that’s how I saw tests for a long time: something I did because it was what I was told to do — besides, if I got the coverage to 100%, I ...| jonathan-frere.com