It’s 8 years now since I handed my notice in at my job and set out to take on the world, resulting in the formation of Cottage Labs. Occasionally people ask me for advice when they are considering doing the same thing. I’d hardly consider myself an expert in becoming freelance, but I did it and it went pretty well, so here’s what I learned.
First, let’s be clear what I’m not talking about. I’m not talking about quitting your job and immediately becoming a contractor. That’s a viable route as a software engineer, if that kind of thing suits…
params to my functions, and embed everything in there.
Before I try to convince you this is a good idea, let’s take a look at how…
Back near the start of my career I worked for a large UK university library on a project to capture and publish PhD theses electronically. This was to increase the access and availability of previously hidden research.
Prior to that, PhD theses were submitted to the library in print (two bound copies) and held in Special Collections where readers could come and view them.
My colleague and I were tasked with understanding the traditional thesis submission workflow and their subsequent usage in research, and how that would translate into a digital environment.
One of the things we did was go…
Writing tests with good coverage and that work all dimensions of your code is time consuming, repetitive, tedious and subject to the law of diminishing returns.
When we start out as developers writing tests, we tend to take the approach of one test per case, and aggregate related tests into suites. For example, you might see a suite like this:
Each test case needs to carry out all its custom prep, execution and assertion stages. If these cases are closely related, this could result in a…
Do you ever write software by accident? It happens to me all the time. “Oh, I could just write a quick script to do X” / “hm, this would be better if I could pass it some arguments” / “this code is messy I’d better split it up into functions” / “urgh, I could really do with some model objects to make this easier” / “ah, damn, I’ve written some software”.
You know how it goes.
As a result, us oldies who come from traditional OO backgrounds sometimes struggle to think about the language correctly. When I first…
I hate truthy tests, and I don’t think you should use them, and I oppose them whenever they appear in a Pull Request.
Why? Because in my experience, more bugs arise from broken truthy tests than from any other class of error. And the bugs from broken truthy tests can also be the worst to track down.
If you don’t know what I mean by a truthy test, it’s this (in Python, but we’ll look at some other languages in a moment):
This asks whether
some_variable evaluates to
true before carrying out some conditional action.
If your horizontal bar chart labels are too long for your left margin, by default in NVD3 the labels will simply overflow the space, and disappear off to the left, which is annoying and looks unprofessional. On these charts, space for the vertical axis labels is at a premium, so to do a good job it’s not enough to implement word-level wrapping, we need to incorporate hyphenated wrapping and label truncation.
One of the reasons that space can be limited for these labels is the temptation to make your horizontal bars around a single text line height. In that case…
I recently needed to check the links in a dataset to find out if they were active or how they were failing. Flippantly, I thought that this sounded pretty easy; after all you could just script a GET on each link and record the result, then you’d know, right. Right?
This is a story about what I learned in the surprisingly subtle and imprecise world of link checking.
First, it’s worth noting that I couldn’t immediately obviously sign up to a link checking service — the dataset was “offline” so it wasn’t like I could have a link checker…
DOIs (Digital Object Identifiers) provide stable and persistent identifiers for your resources, and are routinely assigned to journal articles, research data, and many other kinds of artefact.
Here’s an example of a DOI for a journal article I wrote many years ago:
(you can see the publisher’s page for this article, which is behind a paywall, or you can get the fulltext at the University of Edinburgh’s institutional repository)
It has many great features, like: