Objects, Functions, and Thyroid Hormones
A while back, I was diagnosed with an autoimmune thyroid disease. In plain terms: my immune system decided my thyroid is the enemy and has been slowly attacking it ever since. Mine is "subclinical," which roughly means my body is still keeping up, but it's working harder than it should.
I'm a programmer, so naturally I tried to understand it as a system. It maps onto software way better than I expected. But first I have to tell you about my on-and-off relationship with two ways of writing code.
Two Ways to Organize a Program
Two camps dominate the conversation:
- Object-Oriented Programming (OOP)
- Functional Programming (FP).
I started with OOP like most people. It's what schools teach and what most jobs expect.
OOP organizes a program as a bunch of things. A bank app might have an Account, a Customer, a Transaction. Each thing holds its own data and knows how to do stuff with it. You tell the account what to do, and it changes itself:
flowchart LR
C["You"] -- "deposit $50" --> A
subgraph A ["Account (a thing)"]
D["data: balance $100 → $150"]
F["abilities: deposit, withdraw"]
endThen I stumbled on FP. And who wouldn't be curious when you have functional bros preaching FP as the cure to boring corporate OOP?

I took my time and tried OCaml, Clojure, and Haskell.
FP organizes a program as a set of definitions. Instead of telling anything what to do, you describe what something is. If you've ever written a spreadsheet formula, you've done this. Put your transactions in cells A1 to A3 (100, 50, −20), and the balance is just:
=SUM(A1:A3) → 130
That formula doesn't tell the computer how to add. It just says "this cell is the total of those cells."
Everything else in FP is built on one idea. Programmers call it referential transparency, which is a terrible name for a simple idea: if something always gives the same answer, you can swap it for that answer. 2 + 3 is always 5, and so is =SUM(2, 3). Anywhere you see it, you could type 5 instead and nothing would change.
OOP can't promise this, and the reason is time. Ask an account for its balance and you get $100. Ask again after a deposit and you get $150. Same question, different answers. To know the answer, you have to know when you're asking.
FP doesn't care when. Excel never asks you which cell to calculate first; it figures out the order on its own, because each formula only depends on its inputs.
Exceptions
The exceptions prove the rule: =NOW() and =RAND() give a different answer every recalculation, and spreadsheet veterans treat them with suspicion for exactly that reason.
Try it yourself. The account starts with $100.
OOP: tell the account what to do
Steps run top to bottom.
- Deposit $50→ $150.00
- Withdraw $20→ $130.00
- Add 2% interest→ $132.60
FP: describe what things are
Written in any order. Calculated by what depends on what.
total = balance + interest$132.60balance = SUM(100, 50, -20)$130.00interest = balance x 2%$2.60
Calculated as: balance → interest → total
Going deeper
Rich Hickey, the creator of Clojure, has a great talk on FP and time called Are We There Yet?
It's just elegant. Small, predictable pieces you can snap together like Lego. It felt like I had achieved nirvana...
...until I started building something in the real world.
I needed some niche, complex feature, only to realize nobody in that language's community had built it yet. What would've been a one-line library import in a popular language was now a weekend project. So I went back to mainstream languages, where writing code the FP way didn't feel as natural anymore.
That's when it clicked: OOP and FP aren't really properties of a language. They're conventions, ways of thinking. You can do either in almost any language; it's just a question of how much the language fights you.
What OOP Was Supposed to Be
Then I learned about Alan Kay, who coined the term "object-oriented." He famously said:
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.
Notice what's missing? Classes. Inheritance. All the stuff I was taught OOP is.
For Kay, the core idea was messaging: independent little things, each keeping its own state private, that only interact by sending each other messages. Nobody reaches into anybody else's insides.
Going deeper
There's a good post on how people misunderstand OOP if you want to go deeper.
I got hooked, so I tried Pharo, a modern implementation of Smalltalk, the language Kay's team built to embody this idea. I did this at a public library, which in hindsight was a mistake. It's not exactly easy to tinker with technology that has decades of history. The documentation isn't the friendliest. Might be a skill issue though.

If you were there and saw someone quietly losing their mind at a laptop full of colorful windows: hi, that was me. Sorry about the sighing.
But the messaging idea stuck. And here's the part that got me: Kay studied molecular biology before computing. He thought of objects as being like biological cells, only able to communicate with messages.
OOP, in its original form, was literally inspired by biology.
The Actor Model
Then I came across Elixir, and something called the actor model.
The easiest way to picture it is you and me. I can't read your mind, and you can't read mine. Whatever's in your head is yours. If I want something from you, I have to send you a message: "can you grab milk on the way home?" You read it, maybe change your plans, maybe text me back. That's the only way we can affect each other.
That's Kay's messaging, almost word for word. In the actor model, each of us is an actor. In Elixir, actors are called processes, and a single app can run millions of them.
Here's the twist. Once I hit send, I can't reach into your head and change what you read. In real life, the past works that way too: what happened stays happened. I can't un-send that text, and you can't un-read it. Imagine if someone could. They could quietly rewrite yesterday, and nobody would ever know when anything was true. Promises, plans and arguments would all fall apart. Life only works because the past stays put.
When your plans change, you don't rewrite yesterday. You make a new decision today that builds on it, and yesterday stays exactly as it was.
So each message and each moment of your past is like 2 + 3 = 5: it means one thing, forever. That's FP. But you, as a whole, are still one person who changes over time and talks to others through messages. That's Kay's OOP. Your life is your own little timeline, one fixed moment after another.
Joe Armstrong, one of the creators of Erlang (the language Elixir is built on), even joked that Erlang might be the only truly object-oriented language.
The two camps I'd been bouncing between were never really opposites. Here they were, living together, each doing the part it's good at.
My Thyroid Is an Actor System
And then it hit me: this is how my body works.
- The hypothalamus (in the brain) sends a message, a hormone called TRH, to the pituitary.
- The pituitary sends its own message, TSH, to the thyroid. Basically: "make more hormone."
- The thyroid releases thyroid hormones, which travel through the body and also report back: "we're good, ease off."
Each gland keeps its own state hidden. No shared memory, just messages and feedback loops.
flowchart TD
H["Hypothalamus"] -- "TRH" --> P["Pituitary"]
P -- "TSH<br/>(make more hormone)" --> T["Thyroid"]
T -- "thyroid hormones" --> B["Rest of the body"]
T -. "we're good, ease off" .-> P
T -. "we're good, ease off" .-> HIt's an actor system running on hormones.
Oversimplification
To be fair to the biologists: hormones go into the bloodstream, and any cell with the right receptor picks them up. That's closer to a group chat than a private note. Even so, it's still pretty Elixir: a process only picks up the messages that match a pattern it's looking for, and a cell only reacts to hormones that match its receptors.
It even handles time the same way. Many of your cells get replaced over the years, yet you're still you: one identity, constantly changing state, one fixed moment after another.
Now look at my condition through that lens. My immune system is another actor, and it's sending the wrong messages, attacking a perfectly healthy gland. Nothing is "broken" in the usual sense; one part of the system has the wrong idea about another.
And "subclinical"? My pituitary keeps sending more TSH, shouting louder to get the same work out of a thyroid that's slowly being worn down. The output still looks normal. The only sign something's off is how hard the messenger has to shout.
sequenceDiagram
participant I as Immune system
participant P as Pituitary
participant T as Thyroid
I-)T: attack (wrong message)
P->>T: TSH, make hormone
T-->>P: hormones (enough)
I-)T: attack
P->>T: TSH, MAKE HORMONE
T-->>P: hormones (still enough)
I-)T: attack
P->>T: TSH, MAKE. MORE. HORMONE.
T-->>P: hormones (just barely enough)A lab result is a snapshot: one value, at one moment, and each one can look normal. The real story only shows up when you line them up and watch the messenger getting louder.
At one point, my doctor described some of what I was dealing with as something like a software problem rather than a hardware problem. That stuck with me, and I think it fits the whole condition. The damage to my thyroid is physical, so in that sense it's hardware. But the reason it's happening is a software bug: one part of the system misreading another. And any programmer knows those are the hard ones. Every component checks out, every test comes back "normal," and the system still misbehaves. If you've ever debugged a distributed system, this is painfully familiar: everything looks fine until you notice one service retrying way too often.
Let It Crash (Please Don't)
Erlang and Elixir have a famous philosophy: let it crash. Instead of handling every possible error, you let a faulty process die. A supervisor, a process whose whole job is watching the others, starts a fresh, clean copy. It's one of the reasons these systems are so reliable.
I can't do that. For me, a restart would mean dying and being reborn. Hard pass. A restart is basically time travel, back to a clean state as if nothing happened, and bodies only move forward.
So I've ended up as my own supervisor. Check-ups are my monitoring. Lab results are my logs. Treatment isn't a restart. It's closer to another Erlang trick called hot code reloading: updating a system while it's still running, because shutting it down isn't an option.
flowchart LR
subgraph elixir ["In Elixir"]
S["Supervisor"] -- "watches" --> W["Process"]
W -- "crashes" --> X(("gone"))
S -- "starts a fresh copy" --> W2["New process"]
end
subgraph me ["In me"]
M["Me, as supervisor"] -- "check-ups and lab results" --> Body["My body"]
M -- "treatment<br/>(patching while it runs)" --> Body
endNo Perfect Approach
I still haven't found the perfect way to write code. I don't think there is one.
OOP and FP were never competing religions. They're different answers to the same questions: how do you organize state, behavior, and communication, and how do you deal with time? Elixir showed me they can live together by giving each part its own timeline.
And my body had been running that hybrid all along. Lots of parts, each with its own timeline, all talking through messages. Bugs included.
Maybe the goal isn't to pick a side. It's to understand the system you're dealing with, whether it's made of code or cells, and choose the model that fits.
