How does Golang compare to ASP.NET Core 6.0 + EF Core 6.0 for backend web development?

I’ve been learning C# 10 and the .NET 6 ecosystem, however I feel that despite the large effort to minimize the “framework”, an application made with pure .NET BCL (even without ASP.NET Core) is somewhat bloated, slow and hard to configure. C#10 has a lot of new modern features for coding yet still preserve old features from 5 years ago for the sake of backwards compatibility, resulting in a somewhat bloated language that has 10 ways of doing the same thing without being clear which one is the most optimal way.

This is my first impression after learning C# 10 and the .NET 6 BCL for a week, I haven’t even gotten to ASP.NET Core yet, but with what I am learning now, I have a feeling that learning this humungous platform will take me years to have enough experience and knowledge for an entry level job as a backend .NET engineer.

Looking at jobs in my local area, Golang seems to also be used a lot for backend development. But it lacks the maturity that ASP.NET Core 6.0 has, the “framework” has a lot of integrated features that are coherent with one another and reduces a lot of the headache that comes with developing backend compared to other frameworks like Node.js. That’s the general consensus I got from the community.

What are your thoughts on it? How does ASP.NET Core 6.0 compare to Golang for backend framework? Does Golang have an ORM like .NET has for Entity Framework? I’m absolutely frustrated by the convoluted monster that is .NET, but not sure if I should drop everything that I’ve learned so far and switch to a completely new language or if I should stick with .NET because I have already been learning it for some time.

EDIT: I should clarify in this post context, I’m not just referring to “GoLang”, but rather the GoLang’s ecosystem and popular backend framework used in Go. It’s not clear to me which backend framework is used in Go, the community seems to be split on this. But on the C# side, there’s really only one framework for backend development (ASP.NET Core). It’s more easier to refer to ASP.NET Core specifically than it is to refer to C#.

I am rather new to Go and try to avoid frameworks. My experience of frameworks in general is that it creates limitations and adds much overhead. And creates a completely new language. As any type of ORM does. So far I feel comfortable without any framework. Just import what is needed for the task. I have seen no benefits yet using a framework. But now and then I hear about Gin.

Well, You can use framework if you feel comfortable with them. A web framework, an ORM, etc there many toosl to help you to develop with Go. Please check https://github.com/avelino/awesome-go

1 Like

I’ve been programming Go for more than a year. I’ve donemmany projects.
ASP.NET is a joke.
The guys out there are comparing Go’s performance to that of C/C++.
Just read Go’s case studies. I mean seriously read them.

What are your thoughts on it? How does ASP.NET Core 6.0 compare to Golang for backend framework?

As somebody who spent many years writing ASP.NET professionally and then switching to .NET Core when it came out, I feel like I’m pretty qualified to answer this question. Your assessment of how bloated/large the framework is seems totally fair. There are parts of the Microsoft.AspNetCore namespace I have never touched. It’s massive. I have never felt like I could easily spelunk through the source and find answers, whereas with Go I can always navigate to source and find answers when I need to.

I have always tried to be a bit more explicit when defining things like routes, so I always favored attribute routing over things like convention-based routing. So in that aspect, the utter lack of “magic” in Go’s various routing frameworks is a great fit for me.

There’s also just a lot less going on in Go back-ends in general, which is both good and bad. I’ve come in to existing .NET projects and had plenty of times where I had to ramp up to figure out what all the framework was even doing (different teams use many different paradigms). That has yet to happen to me when coming in on an existing Go project. Middleware is generally explicit and easy to grok, and as I mentioned routing strategies are as well. The negative about that is: you get less stuff for “free”. But in my experience, troubleshooting “free” stuff in large frameworks usually ends up taking more time than just writing simple, testable code to do the thing you’re trying to do.

Performance-wise, my Go back-ends have been rock-solid and sip memory compared to my .NET Core back-ends. Performance isn’t the only metric, and real performance issues almost always on a different tier (databases, man!), but I can deploy a Go API on a very small cloud instance and have great performance. So, it’s something to consider.

In terms of productivity, I am really productive when writing Go APIs. After only a few years I got to the point where I never had to think about what I’m doing with regard to the frameworks I’m using, and I just write code. Because, again, there’s just less going on there when compared to .NET. It’s less exciting in a way, but very productive.

For new projects without clients that have specific framework requirements, it’s hard for me to imagine reaching for anything OTHER than Go these days.

Does Golang have an ORM like .NET has for Entity Framework?

Check out GORM. It generates the cleanest SQL of any ORM I’ve ever used. When I was using Entity Framework and trying to do even semi-advanced queries, the generated SQL would be so nasty it wouldn’t even work sometimes. I generally build data-heavy applications so hand-coding SQL is a necessity for some queries. But for CRUD and simple joins (AKA the boring stuff that you don’t want to write over and over again)? GORM is great.

I’m absolutely frustrated by the convoluted monster that is .NET, but not sure if I should drop everything that I’ve learned so far and switch to a completely new language or if I should stick with .NET because I have already been learning it for some time.

I hear that! At the end of the day, it comes down to this: what will people in your area pay you to do? Are there a lot of Go jobs in your area? Are you planning on working remotely? I am lucky to have more Go work than I can handle, but if I needed work and somebody offered me a contract building a .NET Core app, I’d take it. :slight_smile: I don’t think it needs to be an all or nothing thing. You can learn both if you want to.

Anyway, my only other advice is: give it a try and build a weekend project for yourself to use. Build a task tracking app. A meal planning app. Whatever. I think you’re either going to love how easy it is to get started and be productive, and how fast your backend is; or you’re going to dislike how verbose certain things are. For me, it’s a great tool and one I reach for often. I enjoy the language, the community, and the ecosystem.

1 Like

Hi Dean!

Thank you so much for your answer! It has been insightful and although you were giving your POV from .NET Core rather than .NET 6, the amount of insight you put out is fantastic!

I’ve seen similar complaints in the community when working with .NET Core, but ever since .NET 6 came out, the framework size has reduced significantly and seemed a lot easier to work with as opposed to .NET Core. The current .NET ecosystem aims to be modular and unifies all of the different components and frameworks of .NET Core previously, so that may or may not reduce the amount of clutter you were speaking about.

I’ve already made a decision recently to continue learning .NET 6 and C#10 with the goal to ultimately learn ASP.NET Core 6.0 and its subset, ASP.NET Core 6.0 MVC with React as the frontend view. The main reason being that there are significantly more internship positions in my area for .NET developers than there are for Golang developers. I’m guessing the main reason for this is because Golang is a fairly new language that many businesses have yet to adopt.

I’ve set out a career plan following this pattern, to go from Backend Web Developer → DevOps Engineer (or QA or CI/CD Engineer) → Blockchain Developer (DApps) working with blockchain as my ultimate goal. I definitely plan to learn and work with Golang in the future. But given my situation and the market position of my local area, that’s not the best fit for me right now.

1 Like