Existential State Machines

Last updated May 24th, 2021
Ready, aim, fire! To Be is to choose: your identity, beliefs, and actions. The key to building habits that help you stay on track to meeting your goals? Create a container within yourself; base it on the identity capable of achieving your desired outcomes. Then forget about the outcomes. Focus on your systems — your internal state machine.

Originally published in volvox vault's issue on metamorphosis.

Someone said I was a writer the other day. When the hell did that happen? Over the last two years, I've been writing blog posts - blog posts that would help my past self figure out how to stop writing code that looks like it was written by a drunken kitten (possibly more like a kitten at step six of a seven-step rehab program).

When exactly did I become a writer, though? Was it when I hit CTRL+S on that first sentence? Those first few blog posts? Maybe it was when I realized I wasn't writing email newsletters for my auntie and uncle anymore. Or perhaps it was when I looked up and realized I had published over 50 blog posts, and people seem to be finding my book somewhat decent?

I don't know. But I know that my focus wasn't on becoming a writer; it was about consistently doing shit that writers tend to do.

Many of us have goals we'd love to see come to fruition, but for whatever reason, it can be hard to stay on track. You know - you want to write a bestseller, get ripped, and play sold-out shows. But when you realize you've been trying to write the same chapter for months, your abs don't look like a cheese grater yet, and Iggy Pop isn't playing your LP for his pet bird, you might feel like you want to throw in the towel.

Over the last 400 days or so, I've read many books on productivity, philosophy (mainly about ethics, absurdism, and existentialism), and software design. Remarkably, I think there's a fascinating parallel to be drawn here. At least, I'm going to try.

In this article, I'd like to do several things. First, I'd like to help elucidate a better way to meet your goals by creating habits that stick. As James Clear writes in Atomic Habits, habit change has more to do with identity than anything else. To convince you just how much capability you have in rewriting your beliefs, I'll rely on some of the main ideas from existentialism. I then present an exercise for fleshing out the identities, values, and principles that'll lead you to your goals. Finally, we'll wrap this up with a computer science-y conceptual model and technique to start chaining habits together tomorrow.


In James Clear's research on habits in Atomic Habits, he argues that the critical way to build habits is not to try hard but instead to identify who we want to be.


To accomplish our goals, most people compose a set of habits that they'll follow until they meet them. Only after people achieve their goals do they declare that they are the person they want to be.

Outcome-based belief: "If I write this book and it sells 5000 copies, then I'm a writer."

Indeed, this is one way to go about it. To Clear, these are outcome-driven habits. The thing about outcome-driven habits is that we only feel motivated to continue performing them if we feel like we're getting closer to our goal. The downside of this approach is that any small failure - a step backward instead of a step forward - holds a lot of weight in our lives. Minor setbacks have the power to wreck our entire system. Minor setbacks in the outcome-driven approach to habits are the reason why people sometimes quit their dieting and weight loss routines when they notice that they've plateaued or put weight back on.

Instead, what Clear recommends is the identity-based approach to habits.


The identity-based approach to habits is to:

  1. Decide on who we want to be
  2. Prove that we are that person with small wins, over and over

According to Clear's research in behavioral science and psychology, actual behavior change comes from identity change. Therefore, if we want to write a book, work backward to that goal by seeing ourselves as writers. From there, we ask ourselves, "what are the types of values and principles that writers have"? Clear thinking, meeting deadlines, etc. And what types of habits do they have? They probably wake up and journal every morning, right?

Once we do this exercise and we start to believe that we are the person we want to be, the easier it is to stick to the habits.

Identity-based belief: "I am a writer, so I will do the things that writers do"


If you don't believe you can change your identity, your beliefs, and ultimately, your habits — well, my friend — existential philosopher Jean-Paul Sartre and his (less-buggy-eyed) antecedents have a different opinion on that.

Jean-Paul Sartre taught us that "existence precedes essence." That is, we exist, and then at some point, we recognize that we have a consciousness. And perhaps if we're introspective enough, at another point down the road — we also realize that we have free will, and thus the ability to determine our nature.

"Every action you take is a vote for the type of person you wish to become." — Jean Paul Sartre

While Sartre believed that animals have a sort of predefined nature — their own immutable, unchangeable state machines (a fancy term that we're going to dive into momentarily) — he believed that we have a more privileged concept of being.

Sartre and the other existentialists believed that we'd be lying to ourselves (committing an act of bad faith — as they say) by pretending that we don't have the freedom to choose who and what we are — to fall victim to social pressures (being-for-others) and to never take a moment to consider why one does what one does. You know, like going to college straight out of high school, going for the highest paying job, buying a house, getting married, etc. These are all well and good things if we consciously decide on them for ourselves. But to pretend we don't have a choice in the matter? That's a disservice to what it means to be human. We must choose our being (being-for-itself).

How to change your beliefs

If you have a couple of hours, here's an exercise I've personally applied to my life and found incredibly helpful to put all of this reading to practice:

  • Write down your biggest goals in life right now (write a book, finish my album, buy a home)
  • Ask yourself "who is the type of person that would accomplish that goal"?
  • Label that person as an identity you will believe is a part of you (i.e., "musician", "the entrepreneur", "the writer")
  • For each identity, write down the top five values they likely hold. You can look to your role models or others who live or have lived that possess the qualities you admire.
  • Lastly, for each value, write down the top five habits (principles) that those who possess each value are most likely to do. For example, "entrepreneurs probably write a list of todos for the next day so that they know exactly what they need to do when they wake up" and "health-minded people probably cook the majority of their meals using real ingredients".

Now you know who you want to be, you understand the virtuous action behind each identity, and you know why you're doing it. The next step is to prove to yourself that these identities are a part of you.

Relax on single-mindedly hitting your goals; instead, make like the stoics, and focus on nothing else but putting in the reps and sticking to your system. Eventually, you'll see results as a side-effect.

“We are our choices.” — Jean Paul Sartre

Optimizing our behaviour

Based on what Clear says about human behavior, cycles, and sequence, and what we know about existentialism, is it crazy to think that we get a chance to create our very own existential state machines?

For example, he says that going to the bathroom leads to washing and drying your hands, which then "reminds you that you need to put the dirty dishes in the laundry, so you add laundry detergent to the shopping list, and so on".

It's almost like there's an encoding built into our brains, a default set of next steps or state changes. Wait, state?

State machines

In computing, we use conceptual model called state machines to model the way that they should behave over time.


Your washing machine is actually a really great example of a state machine. It would be perfectly valid for the state of the washer to transition from OFF to ON and then perhaps to WASH before being PAUSED upon opening the door to sneak an extra sock or two in. Then, from PAUSED, back to WASH, before finally transitioning to DONE.


Based on what Clear says about human behavior, cycles, and sequence, and what we know about existentialism, is it crazy to think that we get a chance to create our very own existential state machines?

Since we get to decide what we do, is there a way to develop new state machine behavior for ourselves? Can we develop better automatic habits? Productive ones? That might be the key to some top-tier productivity if we can hack it.


If you want to add a new habit today, one of the best ways to do it is to identify a current habit and stack your new one right after it.


For example:

  • Relationships. After I sit down to drink my coffee in the morning, I will send my partner a good morning text.
  • Planning. After I turn out the lights in the living room before bed, I will write my todo list for tomorrow morning.

Imagine what your state machine could look like. This works because it's slotting in new things around what we currently already do.


The hard part is to stick to it — to train the synapses of our identities — to make it automatic. And to come back to it when life throws us curveballs. Clear says that the only way to make it automatic is to repeat it enough times. All the more reason to stick to the system. It'll fall into place.

"Before enlightenment, chop wood and carry water; after enlightenment, chop wood and carry water". — Zen proverb


If you can rewrite your beliefs (you can), you can build habits that stick and help you meet your goals. It's fun to think of your behavior as a state machine that you can frequently tune and work on. But it's even more fun to watch yourself accomplishing what you've set out to do by merely focusing on putting in the reps and making it as enjoyable as possible.


Liked this? Sing it loud and proud 👨‍🎤.

Stay in touch!

About the author

Khalil Stemmler,
Software Essentialist ⚡

I'm Khalil. I turn code-first developers into confident crafters without having to buy, read & digest hundreds of complex programming books. Using Software Essentialism, my philosophy of software design, I coach developers through boredom, impostor syndrome, and a lack of direction to master software design and architecture. Mastery though, is not the end goal. It is merely a step towards your Inward Pull.

View more in Philosophy

You may also enjoy...

A few more related articles

Why You Have Spaghetti Code
Code that gets worse instead of better over time results from too much divergence & little convergence.
Reality → Perception → Definition → Action (Why Language Is Vital As a Developer)
As developers, we are primarily abstractionists and problem decomposers. Our task is to use language to decompose problems, turnin...
The Code-First Developer
As you improve as a developer, you tend to move through the 5 Phases of Craftship. In this article, we'll discuss the first phase:...
Object Stereotypes
The six object stereotypes act as building blocks - stereotypical elements - of any design.