The Blog
Notes on backend systems, APIs, and building things that hold up. Sort by the newest writing or by what is ranking highest right now.
Preetam Raj
Running several Claude Code sessions across terminal tabs? A notification setup for Cursor and VS Code that shows which one needs you, even when away.

Preetam Raj
A float can hold any number, which is exactly the problem. Primitive obsession is why the same validation keeps reappearing, and value objects are the fix.

Preetam Raj
The Single Responsibility Principle is the most misread rule in SOLID: it was never about doing one thing, but about having one clear reason to change.

Preetam Raj
The moment a class builds its own collaborators, it quietly turns untestable and rigid. Dependency injection is the small habit that fixes both.

Preetam Raj
A pure function returns the same output for the same input and touches nothing else. That single property is what makes code predictable and trivial to test.

Preetam Raj
Sometimes deciding which object to create is a job in itself. The Factory pattern gives that decision one home so the rest of your code stays simple.

Preetam Raj
A growing if/else chain that switches on a type is a design pattern in disguise. Here's how the Strategy pattern turns it into small, swappable pieces.

Preetam Raj
Inheritance looks tidy until the hierarchy fights you. Here's the concrete point where 'is-a' breaks and 'has-a' scales, shown with real code.

Preetam Raj
Deeply nested if/else blocks are hard to read and easy to break. Guard clauses flatten your logic with early returns so the happy path stays obvious.

Preetam Raj
A simple guide to setting up a clean and productive Mac terminal using iTerm2 and Powerlevel10k, with a few useful customizations to make your everyday workflow better.
