Chaotic Commits cover art

cast: not everything is a boolean

November 6, 202626 min

My mom told me, standing in her kitchen, that liberals want to make Alexander Hamilton out to be a liberal. He wasn't, she said. That kitchen argument is the same bug engineering teams ship constantly: taking a value that doesn't fit and forcing it into a field with two options. Three versions of it in software (the is_active boolean that should have been an enum, semantic drift like Knight Capital's reused flag, and presentism as a migration with no mapping script), then why we keep reaching for the boolean anyway.

Show Notes#

My mom told me, standing in her kitchen, that liberals want to make Alexander Hamilton out to be a liberal. He wasn't, she said. My kids were in the other room watching the Captain Underpants movie at a volume that suggested they thought the TV was in a different state. I gave her the only answer I had: Mom, he was a Federalist, and it's a musical. None of that matters.

She did not find that as satisfying as I did. But I kept chewing on it the whole drive home, because it's the same bug I've watched engineering teams ship for sixteen years. We take a value that doesn't fit and force it into a field with two options.

This episode walks through three versions of that bug. First, the field with too few values: is_active created on day one by someone who was very sure, then the business shows up with unconfirmed emails, suspensions, legal retention, and expired trials, and you end up with four booleans and sixteen combinations where maybe five mean anything. Plus the null nobody planned for, which is really the third answer to a question everybody assumed had two. Second, semantic drift, where the label survives and the meaning doesn't: "Federalist" in 1790 versus the Federalist Society in 1982, a status column across seven versions, and Knight Capital's reused Power Peg flag that cost more than $460 million in about forty-five minutes. Third, presentism as a data migration with no mapping script, because queries always return something, and that isn't the same as returning something true.

Then the part I did not love realizing. Why we keep reaching for the boolean anyway: cognitive closure, identity-protective cognition, splitting, and the engineering binaries we turn into jerseys (monolith versus microservices, serverless versus containers, tabs versus spaces). And the moment I caught myself doing the exact same thing to my own mother, who majored in computer science in the 1970s, wrote JCL for a living, and raised five daughters who all have graduate degrees.

If you design schemas, run design reviews, or have ever lost an argument at a family dinner, this one is for you. There's always a third value. You just haven't met it yet.

Read full transcript

Last month I went to see Hamilton. Again.

I literally don't know how many times I've seen it at this point. It's a lot. It's enough that I've stopped telling people the number, because the number has started to say something about me that's a little weird.

And I know what you're thinking. It's the same show. You know how it ends. He's not going to dodge the bullet this time.

But that's what I love about live theater. The script doesn't change, and the show still does. A different actor plays a line a little angrier, or a little more tired, and the whole scene tilts. It's the same words, but it's a different night and a different show, and you can see it ten times and get ten different versions.

But anyway, I digress. This isn't a theater review.

A little while later, I'm at my mother's house, standing in her kitchen. My kids are in the other room watching the Captain Underpants movie on her TV, at a volume that suggests they think the TV is in a different state of the universe.

And my mom says something completely out of nowhere.

"The thing is, I don't like how the media just fell in love with that play. And you know the liberals want to make it out like he was a liberal. But he wasn't."

You can probably guess what type of person my mother is.

And honestly, I was dumbfounded. I wasn't offended. Just dumbfounded. Because I could not figure out what question she was asking. It's a musical. And we're talking about a man who died in 1804.

So I said the only thing I could come up with in that moment.

"Mom. He was a Federalist. And this is a musical. None of that matters."

She did not find that as satisfying as I did. But I kept chewing on it the whole drive home, because what she'd done, what pretty much everybody does, what I have watched engineering teams do in design reviews for sixteen years, is take a value that doesn't fit and force it into a field that only has two options. True or false. Liberal or conservative. And the field didn't exist when he was alive.

Welcome back to Chaotic Commits. I'm Joanne Skiles. I'm an engineer. I teach computer science. I advise companies on how their AI systems are actually designed, and my research is on transparent systems, which it turns out mostly means asking "okay, but what does this field actually mean" in meetings until somebody sighs deeply.

October's done. The decorations are back up in the attic. And this one is about types. Data types to be specific, and the kind of types we put people in, because I think they're the same bug.

Here's the thing. Not everything is a boolean. People want binary answers, and we design systems with binary fields, and very often the real data is something else. An enum, or a range, a null nobody planned for, a value whose meaning quietly changed underneath its label. And when you force it into true or false anyway, you don't get a cleaner answer. You get a wrong answer, stored with weirdly total confidence.

We're going to walk through three ways this bug shows up. The field with too few options, the label that started to drift, and the migration nobody writes. And then we'll talk about why people, and engineers specifically, keep reaching for a boolean anyway. Including me. Especially me.

So let's get into it.

Every engineer has met this field. is_active. That's a boolean, true or false, created on day one by someone who was very, very, very sure that that's what it was.

A user is active or they aren't. What else could there possibly be?

And then, well, unfortunately, business shows up. Okay. What about someone who signed up but never confirmed their email address? Are they active? Not really. Are they inactive? Also, not really. What about suspended? What about a person who asked us to delete their account, but we're legally required to keep the record for seven years? What about someone who's using a free trial that expired yesterday, for a person who's still logged in on their phone and has no idea?

Okay. Wow.

Now you have a choice. You can change the type, or you can do what almost everyone does, which is add more booleans. is_suspended. is_pending. is_deleted.

Four booleans gives you sixteen possible combinations. Maybe five of them mean anything. The other eleven are states your system is perfectly happy to store and nobody on the team can explain. Active and deleted. Pending and suspended. It's the Schrödinger's customer.

And it isn't just users. The one I've actually watched happen, in real production code, is orders. is_paid, is_refunded, which is fine. Then one day the customer sends back one shirt out of the three, and now we have to keep track of something being partially refunded. I guess that's a new boolean.

So tell me now, what does that row mean when all three are true? Is it paid? Is it refunded? Is it a little bit of both?

Nobody knows. The database definitely doesn't know. What that order actually has is one payment status, with four or five real values and an amount attached. So what it got was three booleans, each one pretending to be pretty much the whole story.

There's a famous post on The Daily WTF from 2005 where someone's codebase defined a boolean as an enum with three values. True, false, and FileNotFound.

That was funny. We all laughed at that one. And then everybody goes back to work and writes Boolean with a capital B in Java, which can be true, false, or null. Which is the same joke with better branding.

Tony Hoare, who introduced the null reference back in 1965, later called it his billion dollar mistake. And the reason, I think, null hurts so much isn't that it's some exotic value. It's that it's the third answer to a question everybody assumed had two. Null can just be "we don't know." It can mean "it doesn't apply." It can mean "the migration didn't backfill this row." And the field will not tell you which.

Feature flags do this too. Every feature flag, for the most part, is born a boolean. On or off. Ship it dark, flip it on, delete it later. And then you don't delete it. Somebody needs it for one customer, so it's off in the EU and on for fifty percent of the traffic for an experiment. And a year later that boolean has ten configurations and a spreadsheet explaining them, and the spreadsheet is unfortunately wrong.

Here's how I think about it. A boolean is a light switch. Most of life is actually on a dimmer. And some of it is that ceiling fan with the pull chain, where there are four settings, one of them is off, one of them is apparently reversed, and nobody who lives in the house knows which pull gets you which.

Now let me run Alexander Hamilton through is_liberal.

He was an immigrant, born in the Caribbean, on Nevis. Even his birth year is a null, by the way. It's 1755 or 1757. Historians still argue about it. He arrived in New York as a teenager with basically nothing and talked his way into everything. That's a very modern kind of immigrant story.

And at the Constitutional Convention, he gave a speech suggesting the president and the Senate serve for life, on good behavior. Not exactly a man of the people.

He was a founding member of the New York Manumission Society, which pushed for gradual emancipation. And he married into the Schuyler family, who enslaved people. Research out of the Schuyler Mansion, going through his own account books, found Hamilton acting as a middleman, buying enslaved people for family and friends, and enslaving people in his own household.

So let's think about this. Immigrant striver. Fan of concentrated power. Antislavery society member. Participant in slavery. Pro-commerce, pro-manufacturing, deeply suspicious of crowds.

What's the boolean?

I'm gonna be honest, and I'm just gonna spoil it for you right now. There isn't one. The value doesn't cast. And when you force the cast anyway, whatever comes out the other side tells you a lot more about the cast than about the value.

Let's go back to what I actually said to my mom. "He was a Federalist."

I said it like it settled something, and it kind of should have, just not in the way she wanted. Because "Federalist" is a perfect example of the second version of this bug.

In 1790, a Federalist was someone who wanted a strong national government. More power at the center, less with the states. That was Hamilton's entire thing. He co-wrote the Federalist Papers arguing for it, and most of them, actually. He did fifty-one of the eighty-five.

Today, you hear "federalist" in American politics, you're most likely hearing about the Federalist Society, a conservative legal organization founded in 1982. And the word "federalism" today usually gets used to argue for limits on federal power and more room for the states.

Same word. Pointing close to the opposite direction.

And it isn't just that one. The party that fought Hamilton, Jefferson's party, called themselves Republicans. And historians now usually say Democratic-Republicans, so nobody gets confused. And that's the party today's Democrats trace their roots back to. And "liberal" in the 1700s meant individual liberty and free markets against a king, which is a description a lot of people on the right today would happily sign their name to.

The labels survived two hundred and thirty years. The meanings just didn't make the trip.

Engineers, all of you listening to this, you're like, what is she talking about? Because you have seen this. You have a column called status.

In version one, status meant whether the order was paid. In version three, somebody started using it for shipping. In version five, there was a migration that temporarily stored refund state in it. By version seven, the column has the same name, the same type, the same spot in the table, and three teams who each believe it means something different.

Nothing errors. The schema says everything is fine. That's what makes it dangerous. The type checker can tell you the value is a string. It cannot tell you the string stopped meaning what you think it means.

The most expensive version of this I know is Knight Capital. In 2012, they were rolling out new trading code that reused an old flag. That flag used to switch on a piece of retired functionality called Power Peg. The new code gave the flag a new meaning, but one of their eight servers never got the new code.

In about forty-five minutes, it fired off millions of trades nobody intended, and the company lost more than four hundred and sixty million dollars. It didn't survive as an independent company.

That's two flags, with two meanings, and nobody watching could see which meaning the machine was using.

It's semantic drift. The label stays put, the meaning moves, and the system keeps running on the label.

There's a word for what my mom was doing, and for what the people she was annoyed at were doing too. Presentism.

And I want to be careful here, because I could do a lazy version of this, of "don't judge the past by the present." And it gets used to wave away everything. Different times. And I don't buy that.

Hamilton participated in slavery. That isn't a modern category being imposed on him after the fact. People at that time knew it was wrong, including people in his own Manumission Society. Judging that is fair.

The bug isn't judging. The bug is running today's schema against old data with no migration script.

If you've ever migrated a database, you know you can't just point new code at old rows and just run on hopes and prayers. You write a mapping. This old value becomes that new value. And then you hit the rows that don't map. The field that didn't exist yet.

You have to make a decision, out loud, about those rows. Default them, mark them as null, flag them for a human to look at. What you do not do, if you're any good, is quietly cast them to whatever is convenient and then tell everyone the migration was clean.

That's what "was Hamilton a liberal" is. It's a query written against 2026's schema, run against 1790's data, with no mapping step. And it returns something. Queries always return something. That's not the same as returning something true.

Asking whether Hamilton was a liberal or a conservative is like asking whether a fax machine is pro-WiFi or anti-WiFi. It has opinions about phone lines. Strong ones. Just not about the thing you're asking about.

And honestly, both directions do this. My mom was annoyed that people on the left were claiming him. But Hamilton gets claimed from the right too. Pro-business founder. Strong-national-defense founder. Back in 2016, when the Treasury was planning to move him off the front of the ten-dollar bill, the musical was part of why he stayed. Lin-Manuel Miranda personally lobbied the Treasury Secretary.

Everyone wants him on their side of the boolean, because everybody wants the founders on their side of the boolean.

The musical itself got hit from every direction too. Some historians criticized it for going too easy on him about slavery. Other people criticized it for being too political. And it's a play about Hamilton, so that's a little weird of a criticism. It got claimed and attacked from pretty much every angle you can think of.

Which, in my experience, is usually a sign that the thing doesn't fit in either bucket.

If both teams are fighting over who gets to store a value, check the type. The problem might be the column.

So why do we keep doing this? Smart people do this. My mother is a smart person. Engineers do this, people who are on paper professionally trained to care about types.

There's a little psychology here, and I'll keep it short, because I love psychology but I don't have a PhD in that.

The first piece is something researchers call the need for cognitive closure, specifically from Arie Kruglanski, who did a lot of work on it. The short version is that ambiguity is uncomfortable, and when we're uncomfortable, we grab for the first clean answer that shows up and then hang on to it. He has a great phrase for this. Seizing and freezing. You seize an answer, then you freeze on it.

The second is what Dan Kahan calls identity-protective cognition. Once a label turns into a team jersey, people stop evaluating the thing and start defending the jersey. The question stops being "what was Hamilton actually like" and becomes "which team gets him." And once it's about teams, more information doesn't help. It just gets sorted into the buckets you already had.

The third comes from clinical psychology. It's called splitting. All good or all bad, no middle state. I'm not diagnosing anybody, but I think you'll recognize the shape.

And engineers, we are not immune to any of this. Actually, we might be worse, because we have tools that make a binary look like rigor.

Monolith or microservices. Serverless or containers. SQL or NoSQL. AI is going to save us, or is AI going to end us. And our favorite, tabs or spaces.

Tabs or spaces is my favorite, because it's just the purest form of this. Both work. Your editor converts between them on save. And people still argue about it with the kind of passion most of us reserve for sports teams. That's not a technical disagreement. That's just some weird jersey.

For every one of the real ones, monolith versus microservices and the rest, the honest answer is always "it depends." And I know, I know, I know. "It depends" is the most annoying answer in engineering. People hear it as a dodge, as hedging.

But "it depends" is only a dodge if you stop it there. The senior version is: it depends, and here's what it depends on. How big is the team. How independently do the pieces need to deploy. Do you have the observability to run fifteen services, or only enough to run one. That isn't avoiding a boolean. That's replacing it with a real type.

So here are three questions I try to ask when I feel the boolean coming.

One. What are the possible values here? All of them, including "doesn't apply" and "we don't know."

Two. Has the meaning of this label changed since the last time anybody checked? Is the word doing the work, or is it the definition?

And three. What decision am I actually trying to make? Because a lot of the time the boolean is a stand-in for a different question. "Was Hamilton a liberal" is really "is it okay for me to like this musical."

And that one has an answer. Yes, it's okay. It has some bangers.

And here's the part that's gonna get a little uncomfortable.

When I told you the story at the top of the episode, I said, "you can probably guess what type of person my mother is."

And you did, right? I handed you a boolean and you filed it. One sentence, and you filled in the whole row.

So let me give you some other columns.

My mom majored in computer science in the 1970s. As a woman. In the 1970s. And at the time, that room was not exactly built with her in mind.

And then she went and did it for a living. She worked at Lockheed, which, yes, is where I started my career too, decades later. She worked at Computer Sciences Corporation. She was a JCL expert. That's Job Control Language. If you've never touched a mainframe, JCL is how you told the machine what to run, in what order, against which datasets, and it was famously unforgiving. One thing out of place and your job didn't run, and you found out the next morning.

My mother was an expert in a language where saying exactly what you meant was the entire job.

She raised five daughters. All five of us have graduate degrees. Masters and up. Five.

And she did a lot of that on her own. My father left when I was twelve, and I really haven't talked to him since. So she wasn't just my mother. She was both my parents.

And she raised me to question everything. Which, unfortunately for her, I do. Including her opinions about Broadway musicals. That whole kitchen conversation was her parenting working exactly as designed.

None of that fits in the field I gave you. A woman writing mainframe job control in the seventies. A parent of five who covered both jobs. The person who taught me to stop and ask what question we're actually asking. And I compressed all of it into one political label, because it made the story land faster.

And I'm pretty sure it worked. That's the uncomfortable part. It usually always works. It's fast, it's clean, and it's wrong. Not because the label isn't true. Because it's the least interesting column in the row.

A label can be accurate and still be the wrong type.

You know what the only real boolean in my mother's house was that day? The thing on the TV.

In the Captain Underpants movie, the grumpy principal hears the finger snap and turns into a superhero. Splash water on him, he's the principal again. On, off, on, off. And even he's a bad example, because he's the same guy the whole time. Only the label flips.

My mom's not a boolean. She never was. Hamilton is not a boolean. Your is_active column? Isn't one either, no matter what the migration from 2019 says.

And the musical isn't one. That's the thing I started with and never finished. I've seen that show more times than I'll admit, and it has never been the same show twice. Different actor, different night, a different audience laughing at different lines. Same script, rendered fresh every time. And if the show won't hold still long enough to be one value, the man it's about definitely won't.

A lot of the research I do on transparent systems comes back to this. A system that pretends a messy value is clean isn't simpler. It's just quieter about where it's wrong. I'd rather have the enum. I'd rather have the explicit null. I'd rather have the field with a note that says "this meant something different before 2021, and here's the mapping." I know it's uglier, but it's honest.

Before you add the next boolean, ask what the third value is going to be. Because there's always a third value. You just haven't met it yet.

And the next time somebody asks you whether a person from two hundred and thirty years ago was on your team or theirs, maybe skip the argument. Tell them he was a Federalist. Tell them it's a musical.

And then ask them what they actually want to know.

That's this episode of Chaotic Commits. I'm Joanne Skiles, and I've seen Hamilton more times than I'm willing to put in a database, mostly because I still can't decide what type that field should be. New episodes wherever you get podcasts. No highlight reel. Just the commit history.

All Chaotic Commits episodes →