Docker's dirty little secret

Jeff Terrell
June 6, 2016

Docker isn't what I thought it was.

I thought it provided a way to run docker images on any host that supported docker. As it turns out, that's not true.

I first encountered something fishy when I found this docker image on Docker Hub, whose description said, "FreeBSD Docker host is required to run this image." I thought, "How is that even possible?" And sure enough, I could run the image just fine with a FreeBSD host. But when I tried to run it on my iMac, it silently failed. How could this be?

Continue reading →

Histograms: an anti-rationale

Jeff Terrell
May 6, 2016

Or: Why Histograms are the New Pie Chart

Introduction

Although pie charts are commonplace, those skilled in the art of data visualization disparage them as a poor vehicle for conveying information. Wedges, the unit being compared in a pie chart, are not something the human visual system is designed to compare with much accuracy. Furthermore, many good alternatives exist, such as bar charts, that lose no information and are easier for humans to digest accurately.

I argue that histograms are more akin to pie charts than bar charts. In other words, they do not play well with the human visual system, and a good alternative exists. This article examines the primary flaw of histograms.

Continue reading →

A few tips for writing macros in Clojure

Jeff Terrell
April 29, 2016

Abstract

Macros are powerful metaprogramming tools, but they can be difficult to use well. In this article, I share several tips for creating correct, legible, and useful macros in Clojure.

Introduction

Macros, in the Lisp sense, are in many ways the ultimate metaprogramming tool. In Lisp, not only is the parse tree explicit in the source code (which is the point of the parentheses), but the code can be treated simply as data. Macros, which transform code, are thus, in Lisp, merely transforming data. And functional programming techniques excel at transforming data.

Continue reading →

The benefits of writing a separate test suite for your app

Jeff Terrell
March 11, 2016

Abstract: Keeping a test suite separate from the application itself has several benefits, including adopting a user's perspective, (potentially) identical tests for development or production, load testing, and flexibility to totally rewrite the app.

We Altometrics engineers were recently discussing the nature of tests and test suites. Why are they useful? What assumptions are they founded on? What about them is lacking? As we discussed, we stumbled upon an idea that was new to us: having a test suite that isn't fundamentally tied to the language and framework you're using for your application. No doubt others have considered and used this approach, but it seems to be far enough out of the way things are done, at least in our programming subculture, that it seems worth publishing.

Continue reading →

Reducing the conceptual load of reduce

Jeff Terrell
July 9, 2015

Abstract: calls to reduce are difficult to understand. An example reduce in a code sample is analyzed and discussed to explore the reasons. An alternative version without the reduce is offered and compared.

I'm really keen on legible code. Apart from correctness, I think legibility is the most important thing for software engineering, where the main cost is in communicating things between people. The trick is that "legible" is neither objective nor quantifiable, but that's actually how it should be: we're dealing with humans, here.

In my quest for legibility, I do code reviews. I recently saw the following code (in Clojure). I think it's not quite as legible as it could be.

Continue reading →