Lessons from UTF-8

By Eric — — 2 minute read

XKCD Standards

The famous XKCD comic includes "character encodings" in its list of proliferating standards, and it is no joke. There are dozens, just counting the ones in common use. But the UTF-8 encoding seems unique in that it didn't just add one more, but is managing to legitimately become that one …

Read more...

The Log-and-Raise Anti-Pattern

By Eric — — 6 minute read

In its simplest form, the log-and-raise pattern looks like this:

def my_function() -> None:
    try:
        do_something()
    except Exception:
        logger.exception("My function failed!")
        raise

What's wrong with that? Even the official Python documentation says:

The most common pattern for handling Exception is to print or log the exception and then re-raise …

Read more...

Review of "A Disturbance in the Force: How and Why the Star Wars Holiday Special Happened"

By Eric — — 4 minute read

Book Cover

My fifth-grade teacher required us to write in a journal during class. She would often supply a topic that we would write about. My entries in the fall of 1978 indicated a bit of an obsession:

  • If I had three wishes: Wish number 1: The Millennium Falcon
  • Happiest moment: Seeing …

Read more...

Python Time 2025

By Eric — — 2 minute read

A quick reference for time...

Get the current time in UTC

from datetime import datetime, UTC

datetime.now(UTC)
datetime.datetime(2025, 1, 28, 23, 4, 45, 419714, tzinfo=datetime.timezone.utc)

You might think you should use datetime.utcnow() but:

Deprecated since version 3.12: Use datetime.now() with …

Read more...

Technical Enthusiasm Isn't All Bad

By Eric — — 2 minute read

I love you, robot

Image credit: Stable Diffusion

I've read some things recently about choosing the right tool for the job, from a technology and programming language perspective. Most recently it was a post by Jeremy Bowers.

In it, he pokes at Python's weaknesses, but he isn't really writing about Python (as he says …

Read more...

Raspberry Pi Pico Apology Button

By Eric — — 3 minute read

When playing Call of Duty, I like "hardcore" mode, where a bullet or two is enough to send someone off to respawn land rather than having to empty half a clip. That mode also allows for friendly fire, which is a challenge. I appreciate that the game starts reflecting damage …

Read more...

Thoughts on A Philosophy of Software Design

By Eric — — 12 minute read

Book Cover

John Ousterhout's A Philosophy of Software Design sometimes aligned with and other times challenged my opinions about building software. The overall theme could be summarized with a Ray Ozzie quote: "Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces …

Read more...

The Happy Coder

By Eric — — 9 minute read

Happy Coder

Image credit: Stable Diffusion

I encountered the following quote by Clive Thompson a while back:

When you meet a coder, you're meeting someone whose core daily experience is of unending failure and grinding frustration.

I chuckled and thought, Oh, man, sometimes that is spot on.... I've found myself pondering the …

Read more...

What's hard about SQL

By Eric — — 6 minute read

SQL can be hard

Image credit: Stable Diffusion

These are some things that I find difficult about SQL.

Leaky abstraction

SQL is the poster-child for leaky abstractions.

The SQL language is meant to abstract away the procedural steps that are needed to query a database, instead allowing you to define merely what you want …

Read more...

Review of "Python Testing with pytest, Second Edition"

By Eric — — 3 minute read

Book Cover

Even though I've been using pytest for years, being a testing enthusiast, I thought I'd read Brian Okken's book to see what I might be able to learn from it. I was pleased to discover not only several tidbits of the workings of pytest I hadn't known about, but also …

Read more...