VOL.08 — FIELD NOTES · ENTRY 18/23

▲ 8,200M

EngineeringJanuary 27, 20247 min read

What Game Theory Taught Me About Software Architecture Decisions

I took a game theory course on Coursera back in 2023, mostly out of curiosity. I expected it to be abstract math with no bearing on my day job. Instead it quietly rewired how I think about architecture, clients, and the slow-motion negotiations that make up most of an engineer's real decisions.

Software is full of games

Game theory studies decisions where your outcome depends on what other people choose. Once you see that frame, you see it everywhere in software. The way different services in a system interact. The way you and a client negotiate scope. The way today's engineering decisions constrain tomorrow's. These are all games, in the technical sense: strategic situations with players, choices, and payoffs.

Most architecture decisions are not technical problems. They are games being played by people who do not realize they are playing.

Nash equilibrium and API design

A Nash equilibrium is a state where no player benefits from unilaterally changing their strategy, given what everyone else is doing. Stable, but not necessarily good. APIs reach these equilibria all the time. Two services settle into a way of talking to each other that is stable but ugly, and neither team wants to be the one to change first, because the one who moves first pays the cost while the other coasts.

Recognizing this helped me. When an integration is stuck in a bad-but-stable state, the fix is rarely technical. It is changing the payoffs, usually by getting both sides to move together so nobody eats the cost alone. The equilibrium will not break itself.

Zero-sum versus positive-sum clients

This one changed how I pick clients. A zero-sum relationship is one where the client believes that every dollar they save is a dollar they win from you, and vice versa. We are fighting over a fixed pie. These relationships are exhausting and they end badly, because someone always feels robbed.

A positive-sum relationship is one where we both understand that good work makes the pie bigger. The client succeeds, refers me, comes back. I do better work because I am not constantly defending my time. The same hours produce more value for both of us. I have learned to spot the difference early and to walk away from the zero-sum ones, because no rate is high enough to make a fixed-pie fight worth it.

  • Zero-sum client: haggles every invoice, treats your gain as their loss, churns.
  • Positive-sum client: invests in the relationship, pays fairly, both sides compound over time.
  • The math says the positive-sum relationship wins over any long horizon. The trick is surviving long enough to be in long relationships.

The prisoner's dilemma of technical debt

Here is my favorite application. Technical debt is a prisoner's dilemma played against your future self and your team. In the short term, cutting corners pays off. You ship faster, you look good this sprint. If everyone cooperates and writes clean code, everyone wins long term. But each individual is tempted to defect, to cut the corner, because the cost lands later and on someone who might not be them.

The classic result is that without something changing the payoffs, rational players defect and everyone ends up worse. The cure in software is the same as in game theory: change the game so that cooperation is rewarded and defection is visible. Code review, shared ownership, and a culture where the person who left the mess is the person who cleans it. You cannot win the dilemma by willpower. You win it by redesigning the incentives.

Why this stuck with me

Because it gave me a vocabulary for things I was already feeling but could not name. The stuck integration, the draining client, the tempting shortcut. They are all games with structure, and structure can be changed. Game theory did not give me new technical skills. It gave me a clearer view of the human systems my technical work lives inside, and that view has been worth more than the code in the course ever was.

Saroj Prasad Mainali

Full-Stack Engineer · Kathmandu

WHAT I AM DOING NOW

MORE IN ENGINEERING

02