data Blog = Blog { me :: Programmer, posts :: [Opinion] }


Rust Needs Metaphors, Part 1: Lifetimes
Sep 19, 2020 programming rust
I recently had a conversation with a friend who said: “I don’t trust most of what I hear about Rust, because it sounds like agitprop from the Rust Evangelism Strike Force, but people like you whom I trust and respect seem to like it. Can you help me understand why?” I tried to. I said things that make sense, in the abstract: it offers a very powerful type system, it allows me to feel more confident about my code in surprising ways, and so on.

Under the Rug: Hidden (but Essential) Complexity
Apr 23, 2020
I don’t like docopt. That makes me an outlier; most people I’ve talked to seem to think it makes command-line applications “easy.” They like its premise that, by writing documentation, you’re writing code. When you make a command-line application with docopt, you’ve automatically got the help text written and the module documented properly, right? Why bother with something verbose and object-oriented like argparse? My objection is that you aren’t writing code, but you’re also not writing documentation, despite the name of the package.

Loops and Recursion
Dec 22, 2019 programming concepts exercises
Recursion was a concept that took me a long time to understand. It wasn’t until years after I’d started programming that I felt I really understood it, and it wasn’t until years after that that I felt confident reaching for it as a tool. Like almost everyone, the first way that I learned to think of iteration was with loops. If you wanted to add something together, for example, you would create a “bookkeeping” variable and modify it inside the loop.

The M-Word: The Culture of Programming
Dec 14, 2019 programming learning teams
In addition to it begin useful, it is also cursed and the curse of the monad is that once you get the epiphany, once you understand—“Oh, that’s what it is!"—you lose the ability to explain it to anybody. — Doug Crockford. I had a problem, once. I was working on a Rails application which generated integration files to be consumed by external partners. They were generated every night in a dozen formats and shipped around the Internet to populate sites you’ve probably used.

Mind the Gaps
Dec 12, 2019 programming learning
“If you truly accumulate effort for a long time, then you will advance.” Xunzi. It’s no secret that many programmers are self-taught. Some of us, myself included, lack formal credentials related to computer science. I’ve worked with good programmers who didn’t graduate high school. It’s a strange profession, with the skills often acquired simply as a side effect of tinkering. You don’t hear about many civil engineers or corporate attorneys who do what they do because they enjoyed playing Zork on their dad’s office computer.

On Symbolic Logic
Nov 20, 2019 programming math logic
I went to public school in the United States, and I was always “bad at math.” I hated homework and tests, and it never got better: as I went through the grades, the problems got longer and more intricate, and I inevitably would make a calculation error—misplacing a decimal or flubbing an easy sum—halfway through. I got used to seeing $\color{red}{-\frac{1}{2}}$ on my papers. Those add up! In college, the first thing I did when planning my path through general education was look for a way to avoid Calculus.

The Danger of “Simplicity”
Nov 16, 2019 simplicity trust
There are a few tendencies among programmers that involve the totem of “simplicity.” There’s the ancient concept of KISS, of course, but there’s also the much-abused YAGNI, the insistence that we “Choose Boring Technology," entire languages that base their elevator pitch around the idea that they’re “simple,” and the concept in object-oriented design that “every class should have a single responsibility.” The problem with these approaches is that “simplicity” never gets a rigorous definition.

“Parsing” in Python
Nov 10, 2019 programming python trust types

I recently read “Parse, Don’t Validate” and liked it enough to share it with my coworkers and let it bring me out of retirement on It captures a concept that I have struggled to explain, leading to many cases where I couldn’t say why I thought something was better beyond a vague “It’s a matter of taste.” That’s not very satisfactory as a justification when you’re trying to explain to someone why they should rework a piece of code in a review.