Symfony 7 vs. .NET 8 - Same-same but different?
Tags: php, dotnet, api, eventdriven
Published: 2024-05-04 06:16:20

## Intro

I've decided to widen my horizons and learn a new programming language. In my day job, I write the backend of various web-related applications. Almost 100% of that are API/event-based services. I write using plain PHP, some minimal frameworks, Symfony framework components, or the whole Symfony framework.

I had no particular reason for wanting to learn something new, but I probably wanted to gain another perspective.

I started with Rust a while ago. It's a beautiful language. My problem with it was the problem space it's good at addressing. I ended up not only trying to learn Rust but also wholly new paradigms related to writing low-level code, libraries, or even trying to write a PHP extension in Rust (that was way before https://github.com/davidcole1340/ext-php-rs). I learned a lot about PHP and Rust/C/PHP interoperability ;) But the learning curve was steep. In my opinion, it isn't easy to learn more than one thing simultaneously. A new language is enough. If, on top of that, you need to learn entirely new paradigms - it can be cumbersome.

I dropped the idea for a while and tried it with Golang sometime later. This time, I decided to learn a new language while doing something similar to my day job.
I went through the basic syntax/features of the language and some parts of the standard library. Then, I tried to write some API-based applications. I have to admit I didn't love it. Not that the experience was inherently bad or anything. Some things I did like and some I didn't. What was hard for me to get over with was the abstraction. Or, to be precise, the lack thereof. Whenever I looked at how to structure and modularize the code, it was utterly foreign to what I knew from PHP/OOP. Most of the examples I found related to network tools and utils. Anything web-service-related was rare, and the lack of abstraction discouraged me from diving deeper. Again, it may not be a bad language, but it was not something I wanted to learn in depth. I didn't have fun with it.

## C#, .NET, and Co

That brought me to C#. Modern PHP is very similar to other C++-like languages. Sure, some concepts are slightly different, and each language has something that others do not. But when I looked at it from the perspective of my day job, I realized I could probably do the same thing in C#/.NET as I do in PHP—API/event-based service.

Why C#? I have no particular reason. I could have picked Java, I guess. I already had some minor experience with Java back in the day and want my following language to be a different one.

So I bought RB Whitaker's book [The C# Player's Guide](https://csharpplayersguide.com/) (by the way, it's a great book if you are already familiar with programming in general) and realized that many concepts are very similar. I will dive into some of them while writing the following posts.

## Comparing Symfony 7 and .NET (Core) 8

This brought me to an idea. Because I already know Symfony and have been using it very often recently, I decided to see how significant the differences are between it and the (only?) .NET (Core) 8 framework (mind you, I didn't write ".NET Framework"—it is an older brother of .NET (Core)).

I will write a series of blog posts comparing various features of both frameworks, using Symfony as a reference point (since this is the one I already know).

I treat this experiment as documentation for myself, where I note down everything I learn about .NET. I don't know how deep I will dive into every possible topic, but I hope I will eventually get a comprehensive comparison. I will try to keep it objective for the most part. But because we all have our opinions, I may throw them here and there ;)

If this caught your interest, subscribe, leave a comment, and come back later for more :)

## Related posts:
1. [Symfony 7 vs. .NET Core 8 - web application; the basics](https://dev.to/awons/symfony-7-vs-net-core-8-web-application-the-basics-2ip8)
2. [Symfony 7 vs. .NET Core 8 - Routing; part 1](https://dev.to/awons/symfony-7-vs-net-core-8-routing-part-1-3djp)
3. [Symfony 7 vs. .NET Core 8 - Routing; part 2](https://dev.to/awons/symfony-7-vs-net-core-8-routing-part-2-1pdn)
4. [Symfony 7 vs. .NET Core 8 - Routing; part 3](https://dev.to/awons/symfony-7-vs-net-core-8-routing-part-3-n6)
5. [Symfony 7 vs. .NET Core 8 - Controllers](https://dev.to/awons/symfony-7-vs-net-core-8-controllers-31o7)