Sitemap

Member-only story

Math Explained to Programmers — Group Theory

8 min readAug 13, 2025

--

Group theory helps build strong abstractions — the DNA of great software

Good software has strong abstractions

Me: “I’ve been wondering — why do some software systems like Unix or Git work so well? while most systems start breaking down as they grow? It’s more than just having good tests. There must be a deeper principle to follow, a different kind of design thinking.”

Math Friend: “Software is about ideas, connected by abstractions.Strong abstractions tend to follow group theory principles. Weak ones eventually break.”

Me: “Group theory? How does that relate to programming?”

Math Friend: “Group theory shows up everywhere in system design. The core ideas are in our daily work.”

Groups in Distributed Systems

Me: “Ok, let’s start with something in system design. See if group theory can simplify it — distributed transactions.”

Math Friend: “Saga is group theory in distributed systems:

// BAD: Breaks closure property
async function processPayment(amount) {
await chargeCard(amount); // What if this fails halfway?
await updateInventory(); // What if this succeeds but above failed?
await sendConfirmation(); // State is now inconsistent
}
// GOOD: Maintains group properties
async function processPaymentSaga(amount) {
const saga = new Saga()
.step(chargeCard…

--

--

LORY
LORY

Written by LORY

A channel which focusing on developer growth and self improvement