Against Bit Rot (Why & how I rebuilt my blog)

The Jargon File, a compendium of hacker lore, defines “bit rot” as a jocular explanation for the degradation of a software program over time even if “nothing has changed”; the idea behind this is almost as if the bits that make up the program were subject to radioactive decay.

Wikipedia

This post is a late-night rant that gives this new blog’s motivation and high-level details.

Rant (the ‘why’)

The story started four years ago when I built my Gatsby-based blog. It was based on a “minimalist” template, and the result was beautiful right out of the box.

To this day, 99.9% of my changes were to the blog content written in Markdown. I didn’t touch the codebase because I didn’t need anything else.

As the number of content grew, I noticed the build started to get slower. Well, this goes with the territory, and I didn’t care much as I could easily preview my changes in my code editor. Builds only need to run on Github actions, and I didn’t care how long that took.

Fast-forward to two days ago: the last straw was that after a year or two, I couldn’t build my blog locally anymore. I was hit with numerous warnings and errors every time I tried.

Why is this failing? Last I checked, Markdown, HTML, CSS, and Javascript haven’t changed significantly. My requirements from 4 years ago have stayed the same. So, what gives?

I decided to have a look behind the veil. Lo and behold! I found my blog has 1537 dependencies!!! Why do I need multicast-dns? Or any one of the other 1500 dependencies?

Bruv! I just want to write in Markdown and have it show up on the internet. I don’t want to be a “professional engineer” on a side project — if I wanted that, I’d return to work.

I was shouldering the maintenance burden of dependencies I didn’t actually need. This large surface area maximized my exposure to bit rot.

New blog setup (the ‘how’)

Let’s review my requirements from four years ago, which hasn’t changed:

  1. Convert Markdown (CommonMark) to HTML.
  2. Provide syntax highlighting for code blocks.
  3. Support for LaTeX.
  4. A simple method for deploying the static blog.
  5. A minimalist design (content is king).
  6. I don’t want to tinker with the codebase unless necessary.

I am confident these requirements will remain unchanged for the next 5 years. Therefore, I just need to find a tool that is resilient to bit rot. Unfortunately, most Markdown blogging tools are more complex than I need. They often offer features I don’t need or sacrifice simplicity for flexibility.

Fortunately, I stumbled upon this blog template. The last commit was five years ago (older than my blog), and when I pulled it, it worked locally without any hassle.

Parfait! According to the Lindy Effect, this tool should last another five years. Here’s how it functions:

It reads all the Markdown files in a src directory and converts them into HTML files in a dest directory. It comes with a simple CSS file in the dest directory for essential styling and uses the marked library for Markdown to HTML conversion, along with highlight.js for syntax highlighting.

It’s that simple! I think, this template was more resilient to bit rot because:

  1. It has only two dependencies.
  2. Both are bundled locally.
  3. The setup is incredibly simple.

I decided to use this as the basis for my new blog with the following changes:

  1. Added LaTeX support using Katex.
  2. Implemented functionality to list all blog posts on the index page by year.
  3. Updated the CSS to match my preferences.
  4. Created a simple script for deploying to GitHub Pages.
  5. Finally, I updated the marked and highlight.js libraries to the latest versions. I committed my node_modules to the repository to keep the dependencies local.

The build script consists of ~100 lines of pure JavaScript. It is so simple that I could rewrite it in an hour if needed.

I rely on standard features from Markdown, HTML, CSS, and Javascript, which will likely stay the same in the coming years. If any of my third-party dependencies rot, I can easily replace them with something else or choose not to update them.

Conclusion

I’m pleased with my new blog setup. It is simple, fast, and resilient to bit rot. Now, I can focus on creating content without incurring unnecessary maintenance costs.

That starter pack or boilerplate template might help you start quickly, but it often conceals unnecessary complexity. You don’t need a rocket ship to go grocery shopping.

Time is precious! Spend it on what truly matters.