Stronger Types with C++

So I used to read Joel On Software quite a bit. A few posts stand out, but one in particular is Making Wrong Code Look Wrong for a few reasons: the problem Joel describes is real, it’s subtle, and the proposed solution is elegant and trivial. Now I’m not going to claim I’m disciplined enough to actually follow it all the time – especially since most of my projects start off as toys where it’s easy enough to keep things right – but I love the idea in theory.

Continue reading

Setting up a Private Jenkins and Git Server

I found myself in a bit of a conundrum the other day. I’ve been using Jenkins on my laptop for a while, and it’s worked great, but I thought it’d be neat to turn one of my Raspberry Pis into a slave and get cross builds working. The problem though, is that I take my laptop with me to work and when I travel, and that means I’d have an offline build slave more than I’d like. I’d have the problem in reverse if I turned the Pi into the Jenkins master, but there was another problem: I’m addicted to Gentoo, and they don’t have Jenkins available for arm machines via portage.

The solution was obvious: set up another system that I could use as a Jenkins master that’d reliably be able to send jobs to the Pis. And, so long as I’m going to do that, I might as well get Gitea running on the new box.

Continue reading

Thinking With Tasks

Up until now, all dependency ordering in dev-pipeline is managed using a function that provides a valid sequence as a Python list. The simplified code is basically this:

build_order = resolve(self.targets, self.components)
for target in build_order:
    for task in self._tasks:
        task(target)

This has been fine for initial versions, but it’s not very flexible.

Continue reading

Naming Conventions Need to Add Value

Naming conventions: the only aspect of code formatting more contentious than where to put your braces (for the record, braces go on a new line). We all have our favorites, and anybody who doesn’t comply is an idiot. Not a regular idiot either like the person who says cut and paste when they mean copy and paste, but a major idiot like that guy in the office who can’t figure out how to Google error messages (we all know one).

So here’s the big question: how do you know your naming conventions are right?

Continue reading

Step 1 — Scratching Your Itch

Every good work of software starts by scratching a developer’s personal itch.

Eric Raymond, The Cathedral and the Bazaar

Like most developers, I’m a creature of habit. I like git for source control, so I use git to track changes in pretty much everything, even if they’re non-source (e.g., configuration files, my resume, and even my hobbyist writing). It’s mostly a matter of sticking with patterns I know and embracing muscle memory; with git not only get version tracking, but I can easily back my work up to tons of places with one command.

Continue reading

Modernizing C++ Interfaces

Let’s assume a project has to transform data from one form to another; this could be updating a configuration file during a software update, loading XML to store into a database, or any of the other million things that this problem applies to. For the sake of simplicity, we’ll assume the theoretical project needs to convert strings from mixed-case to uppercase.

Continue reading