Posts

Modernize Your Code, Modernize Your Thinking

Image
  Why “One Class per File” Is Outdated—and What Modern C# Developers Should Do Instead For decades, C# developers have lived by a simple rule: “One class or interface per file.” This rule was so common that many of us (myself included) never questioned it. It became part of our coding DNA—just like putting braces on their own line (hello, 2005) or creating separate IService and Service folders. But today, we’re writing code in C# 12 , designing systems with Vertical Slice Architecture , navigating code with AI-powered tools , and building applications that emphasize features , not ceremony . Yet this ancient rule still lingers. Let’s be honest: ✔ It made sense years ago. ✘ It makes far less sense today. If you want to modernize your codebase , you must begin by modernizing your mindset . Let’s dive in. 🏛️ The Legacy of “One Class per File” This rule grew out of a different era—an era when: ✔ IDEs were primitive Early Visual Studio couldn’t n...
Image
  APIs Are More Than REST: A Practical Guide to How Software Really Talks Think for a moment about your daily digital life: You pay for coffee with your phone You check your bank balance Your smartwatch records your steps Your software talks to other software All of it works—even though none of these systems were built by the same team How? APIs. But if your first thought is “REST API, JSON, HTTP GET/POST” —you’re only seeing a small slice of the picture. APIs come in many shapes, sizes, and communication patterns. And understanding that broader landscape is one of the most valuable architectural skills we can build today. Today, let’s zoom out. 🚀 What Is an API, Really? API stands for Application Programming Interface , but that technical name hides the real purpose: An API is a contract that lets two pieces of software communicate without needing to know how each other works. It’s about clarity. About abstraction. About independence. APIs let softwa...

DotEnv for .NET: The Configuration Superpower You Didn’t Know You Needed!

Image
  Why DotEnv is PERFECT for both regular apps and the new .NET 10 file-based apps If you're building modern .NET applications—especially those new single-file .NET 10 apps —you need a configuration approach that’s simple, portable, secure-ish, and doesn’t require a full appsettings.json pipeline just to load two key-value pairs. Guess what? The DotEnv NuGet package is the hero we've been waiting for . 🎉 DotEnv brings the simplicity of JavaScript, Python, and Linux environments straight into .NET—no ceremony, no boilerplate, just clean environment variables in a .env file that you load with one line of code. Today, I'm going to show you why DotEnv is a game changer and why it's one of the BEST configuration choices for both full .NET applications and the new file-based apps introduced in .NET 10. 🚀 Why DotEnv? Because configuration shouldn’t hurt your brain. ✔ Perfect for simple apps Your console app doesn't need a full JSON hierarchy the size of a Tolkein nov...