Open in app

Sign In

Write

Sign In

Adam Hooper
Adam Hooper

324 Followers

Home

About

Jun 4, 2021

Date APIs and their impossible promises

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: “Timestamp”…

Python

7 min read

Python

7 min read


Mar 23, 2021

My philosophy of exceptions: they’re always ambiguous

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…

Programming

2 min read

Programming

2 min read


Mar 1, 2021

Design by error

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()) asyncio.exceptions.CancelledError

Error Handling

4 min read

Error Handling

4 min read


Dec 7, 2019

Sandboxing data crunches, chapter 3: containerize

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…

Programming

6 min read

Sandboxing data crunches, chapter 3: containerize
Sandboxing data crunches, chapter 3: containerize
Programming

6 min read


Nov 27, 2019

Sandboxing data crunches, Chapter 2: clone processes

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”. …

Programming

6 min read

Sandboxing data crunches, Chapter 2: clone processes
Sandboxing data crunches, Chapter 2: clone processes
Programming

6 min read


Nov 20, 2019

Sandboxing data crunches, Chapter 1: use a subprocess

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…

Docker

6 min read

Sandboxing data crunches, Chapter 1: use a subprocess
Sandboxing data crunches, Chapter 1: use a subprocess
Docker

6 min read


Sep 21, 2017

Describing code? Avoid these words.

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…

Programming

3 min read

Programming

3 min read


Aug 24, 2017

Multiple Share Cards For Your Web Page

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…

Social Media

4 min read

Multiple Share Cards For Your Web Page
Multiple Share Cards For Your Web Page
Social Media

4 min read


Aug 1, 2017

Make UglifyJS way faster by using it sooner

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. …

JavaScript

3 min read

JavaScript

3 min read


Apr 5, 2017

A File Format For Static Websites

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. …

Web Development

4 min read

Web Development

4 min read

Adam Hooper

Adam Hooper

324 Followers

Journalist, ex software engineer

Following
  • Phillip Smith

    Phillip Smith

  • Mike Bostock

    Mike Bostock

  • Hanna Wallach

    Hanna Wallach

  • devongovett

    devongovett

  • BBC News Labs

    BBC News Labs

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech