All postsAll posts
Jan 5, 20266 min read

From .NET to Next.js: Lessons from Switching Stacks

At my day job, I write C# and .NET. My personal projects are all TypeScript and Next.js. Switching between these two worlds daily has taught me more about software development than sticking with either one alone.

Two Different Philosophies

.NET is opinionated and structured. You get dependency injection out of the box, strong typing everywhere, and a clear way to organize your code. The framework makes decisions for you, and that's mostly a good thing in a team environment.

Next.js (and the React ecosystem) is the opposite. You choose your state management, your data fetching strategy, your styling approach, your folder structure. The flexibility is powerful but can lead to decision fatigue.

What .NET Taught Me About JavaScript

Working with C#'s type system made me appreciate TypeScript on a deeper level. Once you've experienced the safety of compile-time checks catching bugs before they reach production, going back to untyped JavaScript feels reckless.

.NET's middleware pipeline also gave me a mental model for understanding Next.js middleware and API routes. The concepts transfer even when the syntax doesn't.

What Next.js Taught Me About .NET

React's component model changed how I think about UI code everywhere. The idea of composable, reusable pieces of UI that manage their own state is universal. I've started applying similar patterns in Razor components.

The JavaScript ecosystem's speed of iteration also pushed me to stay current with .NET updates. Both worlds are evolving fast.

The Polyglot Advantage

The biggest lesson: learning multiple stacks makes you better at each individual one. You start seeing patterns that transcend any single language or framework. Error handling, state management, authentication flows — the concepts are the same everywhere. Only the syntax changes.

If you're early in your career, I'd strongly recommend working in at least two different tech stacks. It'll accelerate your growth more than going deep in just one.

Practical Tips for Stack Switching

  1. Don't fight the conventions. Use C# naming conventions in C# and JavaScript conventions in JS. Trying to write C#-style JavaScript (or vice versa) just creates confusing code.
  2. Leverage the type system. TypeScript and C# both have great type systems. Use them fully — they catch bugs for free.
  3. Learn the debugging tools. Visual Studio's debugger is incredible for .NET. Chrome DevTools is incredible for JS. Master both.
  4. Keep a cheat sheet. When switching contexts, having a quick reference for common patterns saves time and reduces mental load.