When we brainstorm Workbench features, I have a mantra: don’t promise the impossible.

Last month we designed our date and time system. My mantra came up again and again. A lot of APIs promise the impossible.

TL;DR when you’re programming with dates and times, store data in two formats:

Python, C++, Ruby and Java all use exceptions. To them, “exception” means, “nifty piece of syntax kinda like goto.” Language specifications and communities haven’t defined “exception” in a way humans can understand.

It’s the only incomprehensible term out there. Anybody who’s programmed for five hours can explain “if” to a…

Errors are the universal language of programming. Make them count.

A well-designed error helps fix bugs

The other day, I saw this server error in my inbox:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.8/site-packages/aiormq/base.py", line 115, in <lambda>
future.add_done_callback(lambda x: x.exception())

… and the service stalled. I…

This is the third and final post in a series. In Chapter 1, we sandboxed using subprocesses. In Chapter 2, we leveraged Linux’s clone() system call to create subprocesses quickly.

Workbench’s Renderer process runs one Step process after another. We sandbox each (untrusted) Step by running it as a non-root…

This post, second in a series, offers a Python solution to a Python problem. The broad principles should apply to any single-threaded language on Linux.

In Chapter 1, we began sandboxing. Workbench’s “Renderer” runs a series of Pandas-powered “Steps”. …

Workbench lets users drag and drop “Steps” to create programs we call “Workflows.” It’s like a user-friendly Jupyter.

When a user submits a Step, our “Renderer” program executes all the Steps in the Workflow. Most steps are pre-built; but users may code their own using Python and Pandas.

The dilemma…

When we describe code, we tend to use confusing words. Re-think your language with this simple guide.

These quick tips apply to README files, code comments, API documentation, reports, research papers, websites, elevator pitches and water-cooler conversations.

“Automatically” means “without human control.” Who is responsible for what the code does…

The first — and hopefully last — experience your user has with your news story is on social networks. I’ll describe a neat trick for sharing a single web page on social networks in several ways or at several times.

Primer: the share card

Virtually all news sites get one thing right: they create…

Grunt, Gulp, Browserify, Webpack — they all make the same rookie mistake.

The task is “minifying”: transforming many small-but-verbose JavaScript files (coders maintain these) and into a few large-but-terse JavaScript files that do the same thing (browsers download these).

All the JavaScript bundlers I’ve seen do it wrong. …

Everybody’s doing it wrong. Use this file format.

Ever hear of a “static website?” They’re the Next Big Thing in website hosting — and a return to yesteryear. Unlike today’s normal hosting companies, static-site hosting companies don’t run any of your code. …

Adam Hooper

Journalist, ex software engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store