Abstractions and Regrets

Every Abstraction I Regret

The best code I ever deleted was a utility function called format_response. It accepted a response object, a format string, a fallback value, an optional transformer function, and a boolean for whether to strip whitespace. It was used in exactly one place. I wrote it because I thought I’d need it again. I didn’t. It sat in utils.py for eight months, collecting type: ignore comments and confusing every developer who opened the file. ...

February 20, 2026 · 7 min · Muhammad Hassan Raza
Production War Stories

I Shipped a Race Condition That Double-Charged Customers (And Other War Stories)

Nobody writes blog posts about the bugs they shipped. The internet is full of “how I built X” and suspiciously empty of “how I broke X and spent 14 hours pretending it wasn’t my fault.” Here are mine. The Race Condition: Two Cashiers, One Item This one happened in Polaris, the ERP system I built for retail businesses. Real money, real transactions, real angry shop owners. The setup: two cashiers at different terminals. Both scan the same product. Both hit “Complete Sale” within 200ms of each other. The inventory says there’s one left. ...

November 15, 2025 · 8 min · Muhammad Hassan Raza
LangChain production workflow diagram

LangChain in Production: What the Tutorials Don't Tell You

Every LangChain tutorial ends right where the real work begins. You see a neat 50-line script that queries a PDF, and you think, “Cool, I’ll ship this by Friday.” Three weeks later, you’re debugging memory leaks, wondering why your chain silently returns empty strings, and questioning every decision that led you here. I’ve shipped LangChain-based features to production at multiple companies. Here’s what I wish someone had told me before I started. ...

June 20, 2025 · 5 min · Muhammad Hassan Raza