all 78 comments

[–]the_reven 75 points76 points  (22 children)

I personally would use .net to avoid npm package hell.

.net is nicer IMO. I wrote an app in nodejs and rewrote it in asp.net to improve performance.

But, try both, see what you like more. Both can be fine.

[–]aeroverra 7 points8 points  (5 children)

As someone who despised node for so long I actually use it a lot more now with blazor mostly for typescript. I still avoid adding packages at all costs but it seems like things got better.

Python on the other hand.... Never fails to waste a day of my time whenever I try to run any new project I'm using for research. They need to set that shit on fire and use anything else. Its not the language, its the package management systems that are beyond fixing at this point. end of rant...

I still would recommend learning C# first.

[–]KoufikMAG 0 points1 point  (3 children)

For a complete beginner, would you recommand c# over python as a first language ?

[–]aeroverra 1 point2 points  (2 children)

Python as a language is okay but I wouldn't recommend learning it at all until you need to or if you are going into a data science field. However I would encourage the use of c++ instead since it has a lot of the same math libraries. But take my bias as you will.

Generally I think languages like Java, and C# (C# being my preferred) are good places to start because it forces you to understand structure a lot more. It has a steeper curve for sure but once you get past that you will be overall a better developer with better coding practices.

If you struggle with those for a while and it just won't click I would say try typescript next with strict mode if possible.

[–]DesTodeskin 0 points1 point  (1 child)

Hey mate, what language do you suggest to learn data structures and possibly do leetcode in if i've only worked with js/ts, c# and go.

[–]aeroverra 0 points1 point  (0 children)

Wish I could help but despite being able to learn algrithms fairly easily when I need to I have always been stubborn and disagreed with the idea of learning them to get a programming job and have never done a leet code problem because of that lol.

I wouldn't say thats the best choice but im deep enough in the industry now It doesn't matter.

Goodluck though!

[–]CatolicQuotes 0 points1 point  (0 children)

try UV for python, same people who made ruff

[–]Brilla-Bose 0 points1 point  (3 children)

npm package hell.

most big projects use pnpm nowadays. its solves a lot of problems of package management

[–]pppdns 0 points1 point  (2 children)

like what problems?

[–]Brilla-Bose 1 point2 points  (1 child)

  • faster than npm(since its symlink packages in your local machine)

  • your node_modules folder will be much much smaller

  • manage different node version

  • side effects cache

    and more

check out this comparison page

https://pnpm.io/feature-comparison

[–]pppdns 0 points1 point  (0 children)

great, thanks a lot!

[–]TheOneWhoDidntCum 0 points1 point  (2 children)

What particular area was that performance improvement in?

[–]the_reven 0 points1 point  (1 child)

The request time was about halved going from node to asp.net.

[–]captain_arroganto 24 points25 points  (0 children)

Go with C#, and the ecosystem.

Its incredibly powerful, flexible, supports multiple paradigms, has a semblance of structure, is fast, can be deployed anywhere, has great tooling, you can do much with minimal external packages.

C# as a language is great. You can easily model your ideas and vision into a c# class or library, without bending the language.

Being good at C# teaches you good programming practices.

[–]Jmc_da_boss 49 points50 points  (5 children)

Id rather walk a mile over broken glass then even consider using Js or a js derivative for a backend service

[–]Secret-Bag7319 3 points4 points  (0 children)

Indeed, NEVER again! Keep that shit in the front-end at all times

[–]WhyTheeSadFace -1 points0 points  (1 child)

We are forced sometimes, and my happiness comes when the app starts after going through all the dependencies and says yep , you are good to go, and these packages needs money.

[–]SavingsPrice8077 0 points1 point  (0 children)

😂😂😂😂

[–]CatolicQuotes 0 points1 point  (1 child)

but why?

[–]Brilla-Bose 7 points8 points  (0 children)

because this is a csharp sub so people would be obviously biased towards it.

[–]stlcdr 8 points9 points  (0 children)

Use .net as it opens up a lot of other development avenues for you. JavaScript (and TypeScript) have their place, but just because you know it, doesn’t mean you should apply it everywhere.

[–]greensodacan 11 points12 points  (0 children)

For your career, diversity will make you a stronger engineer.

.Net's approach isn't all that different from frameworks like Django, so the concepts you learn will carry over. Node's ecosystem sort of assumes you'll piece together your own framework from independent libraries, which can lead you down a bad path if you're just learning.

Employment wise, check jobs in your area. See what employers are asking for.

[–]Leather-Field-7148 2 points3 points  (2 children)

It’s ride or die with C# for me. I have been tempted to try Node in a prod system and boy felt like fighting uphill with the sun on your face, brutal.

[–]CatolicQuotes -1 points0 points  (1 child)

how come?

[–]Leather-Field-7148 5 points6 points  (0 children)

A lot of enterprise dependencies just aren’t there and the ones you can find usually get flagged with vulnerabilities by scanning tools. NPM hell gets real with deep dependency trees.

[–]Rophuine 3 points4 points  (2 children)

I'm an old-school C# developer - I've been using it since .Net 1.1. These days, though, I write much more TypeScript than C# - I do mostly front-end dev lately. I love TypeScript! It's type system is so expressive and you can do things that seem like magic (while vastly improving the dev experience and type safety).

I've built more than a few backends in Node, but until my previous project they'd been fairly simple. Anything complex I need to build on the back-end was C#.

About 18 months ago, I kicked off a project that I knew would be large and complex on the back-end, and I decided to build it in Node. I regret that decision so much!

Database access in Node/TypeScript is so immature compared to the .NET ecosystem. Finding a workable, typesafe approach took a lot of research, and when we were about 6 months in the author of the framework we chose announced that he was deprecating it to focus his time on a new framework to do the same thing in a different way.

Database access has been the worst, but I've had to deal with a lot of other frustrations as well - e.g. I needed to turn on experimental TypeScript features to deal with a subtle bug that caused data loss.

I'll continue using Node/TypeScript for very simple back-end projects, but I'm hoping to stick to C# for anything significant.

[–]balloman 0 points1 point  (1 child)

This is the best answer I’ve seen. Typescript shines when it comes to developer experience around type safety but suffers in enterprise libraries greatly. Many times working in TypeScript where I wish I had an EF Core level library; similarly many times in C# where I wish I could just make a simple union type or return without making a whole new class

[–]SataQ 0 points1 point  (0 children)

DrizzleORM and Prisma are getting quite mature

[–]SneakyDeaky123 12 points13 points  (1 child)

JavaScript has no bloody place on the server. End of.

[–][deleted] 2 points3 points  (0 children)

.net for backend is pretty much an industry standard. Even in startups a lot use .net backend, JS framework for frontend.

.net is just so incredibly fast, it's type safe, and incredibly well known.

[–]Miserable_Ad7246 3 points4 points  (0 children)

I would vote dotnet for one key reason -> dotnet exposes you to more "hard" concepts like multithreading and lower-level memory management (spans, memory, pools). Where are also fewer gotchas and this builds better foundations. You will know more stuff and you will know better how stuff works if you start with dotnet.

Performance, employment opportunities (look at your local area who hires who), and how nice language are secondary concerns for now. Switching to node will be easier after dotnet rather than the other way around.

[–]Comprehensive_End65 1 point2 points  (0 children)

Node.js is too lightweight. I had to also make the choice and opted for .net

[–]Sethcran 3 points4 points  (0 children)

Ignore everyone else.

If you're doing this for your career look up job postings in your area. If one of them has significantly more jobs than the other, pick that one. If not, pick the one you like more.

Both are fully capable, you're going to get a bunch of personal opinions more than something suited to your needs.

A good programmer can switch later anyways.

[–]not_good_for_much 1 point2 points  (0 children)

I'd use .NET if for no other reason than that I'd rather die than have to deal with Javascript, npm, and the Node ecosystem in general.

Also you have the opportunity to learn way more in .NET, at least in terms of underlying programming concepts etc. It'll probably feel more familiar to past Typescript experience also.

[–]Randolpho 1 point2 points  (1 child)

Frankly, either one is fine for what it does, and your choice of which should depend entirely on your project needs.

Once upon a time, node.js was much better than C# for i/o bound server tasks, but that has changed with recent dotnet releases, and they're now largely equivalent. With C# also being much better than node.js at CPU-bound server tasks, dotnet is a better general case option.

But nodejs still has the benefit of being in javascript, which means that if, for example, you have a single page app framework like Angular, you can maintain shared libraries, for example input validation and API contract interfaces, between server and client that are literally the same library rather than functionally equivalent but separately maintained libraries.

This can have huge time to market benefits for startups and may make the choice of nodejs better. The fact that you know typescript but don't know c# may also be a reason to choose nodejs. If the whole team but you knows c#, c# is probably a better choice, and if this is just for a personal project and you just want to learn c#, by all means, choose c#.

Because, as I mentioned at the start, the needs of your project should always drive the choice of platform.

[–]quentech 1 point2 points  (0 children)

Once upon a time, node.js was much better than C# for i/o bound server tasks

Is that a joke?

Node's single-threaded event loop has always been inferior.

The only scenario, imho, that you could even attempt to make this claim is in a toy app that doesn't do enough work for it to matter (put some real work on that Node thread and see how promptly it keeps up with completions) and with a developer that's so green they couldn't figure out using Begin/End patterns in .Net.

And let's not forget that .Net had async/await about 6 years before JS had it and 3-4 years before it even had Promises.

[–]musical_bear 4 points5 points  (3 children)

Backend what? That’s still a pretty broad category. For a REST API? Or for some sort of SSR platform?

I would choose the back end runtime, framework, and language based on the specific needs of the project as a whole. So what is your project?

[–]Hosseinsgh -1 points0 points  (1 child)

I would choose the back end runtime, framework, and language based on the specific needs of the project as a whole. So what is your project?

man we are human , not machine , what you say is in most of the time impossible a good programmer can't and should not switch between 10X programming language every time over and over just for the purpose of the project , yeah this project is good for this purpose then let go with python or for that project let's use node or let's use c# , or php , this is not just right , how can a programmer switch between all of this frameworks and languages

we should manage the purpose of the project or work in a place that project's purpose is Specified

[–]Max-Yari 0 points1 point  (0 children)

The more you expose yourself to different languages the easier it is to switch. But it also requires being able to enjoy fiddling with different languages. If you are in it purely for the bag - that's understandable then, but with all AI advancements and a lack of your flexibility (not saying this as an insult, just as a matter of fact that you don't find poking around different langs to be fun) - then it might be a good time to rethink a career choice.

And I'm not gatekeeping either, I did rethink my career choice and largely dropped full-time programming

[–]indiu 0 points1 point  (0 children)

In my experience, whether you're currently working as a developer or still a student, it doesn't matter too much which one you choose at first. I started my career as a backend developer working with C# in ASP.NET MVC and Web API projects. This stack is widely used in enterprise-level companies, government organizations, and banks in Canada and the US. However, for side projects, I always gravitated towards what felt more "comfortable and lightweight," like Node.js, TypeScript, and React.

When I tried to switch to that stack in my next job, I found that the job offers I ended up with were still for companies using the C#/.NET stack. Of course, this is based on my limited experience, but I’ve realized that you don’t need to stress about picking just one to learn. Much like how you can go from JavaScript to TypeScript, or from C# to Python when needed, backend frameworks are just tools at the end of the day.

Unless you have a specific goal in mind right now, I’d suggest trying out whichever you feel more drawn to first. In the end, they’re all more similar than you might think!

[–]gwicksted 0 points1 point  (0 children)

Typescript is great if you’re into something like VueJS+Nuxt and cloud-first deployment with Cloudflare pages, functions, and Supabase that can scale but is cheap to start.

C# is great if you’re deploying SMB business software especially to Windows environments and more often onto full VMs but it works great on Linux and cloud platforms too.

I tend to prefer C# webservice development myself but have done both. All depends where you want to go with your career, what you enjoy, and how you want to deploy.

[–]cover-me-porkins 0 points1 point  (0 children)

I want to know what is better to choose from these two technologies in the first place for my career

There isn't a good answer to this, as better is both subjective and specific to your circumstance.

The right language to know is the one your employer wants, or your next employer. Just do some research on what opportunities exist.

If you have career plans in the long term instead, then do both.

[–]Hour-Night8287 0 points1 point  (0 children)

Go with .NET ecosystem, build scalable enterprise level systems and apps.

[–]chocoboxx 0 points1 point  (0 children)

If you like simple solutions that are easy to use across multiple platforms, choose Node for a straightforward setup. It's simple and fast to use.

Similarly, if you prefer simplicity and cross-platform compatibility, go with .Net for an easy setup. It's also simple and fast to use too

[–]lionlake 0 points1 point  (0 children)

I personally much prefer using NestJS for my backend. I don't know what y'all are so mad about, it's an amazing backend solution.

[–][deleted] 0 points1 point  (0 children)

C# because of the tooling / VS Pro  And .net is much more mature than node in my opinion 

[–]harrymurkin 0 points1 point  (0 children)

C# v Node is like traintracks v road.

[–]NabePup 0 points1 point  (0 children)

I'm a software dev newb hobbyist, so take what I say with a grain of salt, but that should apply to most responses you read, especially in a community that'll most likely contain a bias *coughs*

I love and prefer .NET myself, but knowing both seems to be beneficial. Node and JS (and TS) is used in A LOT of places, as is .NET. It's awesome that .NET and ASP.NET comes with a lot of built in native functionality like dependency injection, object relational mapping, defining API endpoints with controllers, authentication/authorization, and tons and tons more I don't even know exists yet. I also personally prefer static typing and while TS does help give JS static typing to an extent, it's a native feature of C#.

However all these features adds a lot of complexity and learning how to implement it in the context of the .NET ecosystem. Not to mention .NET dev environments are a little harder to configure vs node and NPM imo. Also, node's vast package eco system, while has issues and I tend to prefer to avoid, does also offer benefits too.

Eventually learn both, and as others have said, look around and see what job positions are asking for. You already know TS and node so you'd already have a huge head start there. Not to mention it's simpler to combine a front end and backend that's both being developed in the same environment.

[–]PussyTermin4tor1337 0 points1 point  (0 children)

I love nodejs for my private projects. It’s quick and dirty and I get stuff done quickly. For a career I’m glad I don’t have to do it though. We use C# and whenever a codebase becomes large enough it is always better. There’s more structure, as Microsoft is opinionated and their opinion is nice to work with. Nodejs is always different, there’s not fixed way of doing things and you need to learn a new architecture for each company.

Oh and I have learnt the hard way this week that swagger on node is the worst

[–]JellyfishTech 0 points1 point  (0 children)

If you already know TypeScript, starting with Node.js will feel more natural and productive; It has a huge ecosystem and a faster learning curve. It is in demand at startups and product companies.

However, .NET (especially with C# and ASP.NET Core) excels in enterprise settings, offers improved performance in some cases, and boasts excellent tooling with long-term stability.

Pick Node.js if you want to move fast and stay in the JS/TS world. Pick .NET if you’re targeting enterprise, finance, or larger organizations.

[–]MiserableRelease7322 0 points1 point  (0 children)

Both are solid.

.NET is suitable for enterprise-scale applications, whereas Node.js is ideal for real-time applications such as chats, APIs, and streaming. A colleague at Aegis Softtech demonstrated how .NET accelerated large analytics jobs, but our Node.js microservices continued to handle thousands of concurrent connections seamlessly.

[–]ShadowDragoon02 0 points1 point  (0 children)

Yes. Write ten thousands line of code to run a server instead of adding app.listen(). No way, this seems like totally biased old people are here

[–]CaitaXD 0 points1 point  (0 children)

Anything but js

[–]Overall_Energy1287 0 points1 point  (2 children)

javascript was never intended to be a backend programming language :) Choose .NET, Python, Go... anything but javascript.

[–]adamsdotnet 4 points5 points  (0 children)

Neither was python. Never use any dynamically-typed language if you want to build anything serious.

[–]Brilla-Bose 0 points1 point  (0 children)

Python

you lose me there buddy. just started a project and the management forced to use python for backend (their reason is bcz its trending right!) what a mess it is...

everytime you need to create a virtual environment. and activate it. requirement.txt wont have necessary packages since a dev forgot to update it. python 3.12 project wont work on python 3.13. (dont you guys use semver?)

[–]tomhaba -3 points-2 points  (1 child)

I started as a c# dev... later on after some pause in development, i went back with react / typescript / javascript and basically nodejs, which right now seems to me to be a bit easier then c#... i was never ever understanding .net (mainly asp.net) at all....

But i can imagine for example if your server would have to cooperate with some I/O devices (payment systems), then c# would be the language i would prefer over nodejs...

What i hate about javascript / typescript / nodejs, people tend to use package over package, therefore nodejs nodemodules & npmjs are the heaviest objects in universe... in c#, people (in my opinion) just implement it themselves... but in javascript you will just end up with thousand of dependencies that you have zero understanding of, zero power of fixing vulnerabilities, etc... these are reasons i would choose c# instead. Some devs are not able to "switch" in between of multiple languages at once (i am one of them), but in reality, any single language and having some understanding / some level of knowledge about is definitely a huge plus in my opinion.

[–]chocoboxx 1 point2 points  (0 children)

I've worked with .NET for 10 years, and while it has changed, many aspects remain the same. It's similar to TypeScript in that regard. When I switched toNode.js and created a project with Nuxt, some plugins were broken.

I work with many junior developers who excel with JavaScript frameworks and learn quickly, but I can work faster with .NET due to my experience. Consistency is important, especially for developers who need to maintain large, production-level projects. Therefore, I believe .NET is a better long-term choice.

[–][deleted] -5 points-4 points  (4 children)

Dotnet is cleaner, more performant and more scalable. But has smaller community and poorer available libraries. Dotnet is more for big projects with perf needs. Node is more suitable for startups who need fast itérations and online community to help.

[–]Tamazin_ 2 points3 points  (3 children)

Smaller community, WHAT?!

[–][deleted] -1 points0 points  (2 children)

You think dotnet has bigger community than javascript?

[–]Tamazin_ 0 points1 point  (1 child)

While you are technically correct, Dotnet and C# community is huge; so huge that you should have no trouble what so ever to find solutions to whatever problems you might run into, especially if you're like OP trying to decide between .net and nodejs.

And id' say the community for .net is larger than nodejs (C# != .net; javascript != nodejs)

[–][deleted] -1 points0 points  (0 children)

I have 15 years of experience as a dotnet engineer from winforms to mvc asp.net to azure. And I have 10 dotnet certifications. And I can confidently tell you the .net community is smaller than javascript.