HACKER Q&A
📣 pier25

Node vs. .NET Core (2024 edition)


This same question was asked back when .NET Core was released in 2016.

https://news.ycombinator.com/item?id=13034904

How are things looking now after 8 years?


  👤 romanhn Accepted Answer ✓
Ten years ago I stepped away from the Microsoft ecosystem, in large part due to said ecosystem drifting away from industry best practices at the time, and also a conservative development culture formed around this ecosystem that did not want to acknowledge the outside world. So if I were starting a new project eight years ago, .NET would've been one of the last technologies I would've picked, despite big love for C#.

When I was starting a new project a couple of years back, I went with .NET 6 and never looked back. The Core branch (and subsequent versions) fixed a lot of the issues I had with the original .NET Framework. Happily developing with VSCode on a Mac and deploying to ARM-based Linux instances in AWS. To the original question, the only right answer is you should pick what you know unless there is some overriding reason (e.g. performance). When building a backend API, I'd personally pick C# over JS all day.


👤 Atotalnoob
Either. It really depends on your use case.

The developer experience is a lot better for .net, in my opinion, but it’s also expensive and usually requires windows (yes, Linux .net is completely possible). Microsoft invests heavily into building better, easier tooling from end to end. If you are an azure shop, it’s very easy to deploy.

I haven’t looked at the latest benchmarks, but when I did, c# was a clear winner in performance, multithreading, etc. nodejs isn’t slow by any means, either.

Nodejs excels at speed of development and in BFF patterns like next or other SSG. .net will steer you into better design patterns for maintainability in the future. There are also more gotchas around nodejs which is mostly due to the funkiness of JavaScript.

It’s quite nice if you use nodejs backend and frontend. It’s one language and if you use typescript you can share types!

Bottom line, there are tradeoffs to both. I would be more concerned about your team composition, skill set, and project type when picking between them.

If you held a hun to my head, I’d pick .net


👤 yodon
It's amazing how uninformed the comments are on the .NET ecosystem as of the time of this comment.

The OP states this is intended as an update to a 2016 question, but the responses are largely stuck pre-2016, full of nonsense complaints that haven't been true for the better part of a decade (including imagined OS dependent lock-in, imagined lack of CLI based tools, and etc).

The .NET Core variant doesn't even exist anymore, and hasn't since 2020. It's just .NET, after a difficult planned multi-year effort that .NET core was a part of, to unify into a single cross platform .NET


👤 neonsunset
Unless you use server-side rendering or JS-only dependency, in which case you do need Node.js, its usage cannot be justified as it is a massive downgrade in every way vs .NET (ASP.NET Core + EF Core/Dapper combo).

Examples of major considerations are security vulnerabilities and dependency hell (both solved long ago in .NET), performance and memory footprint (the average expected difference in application code performance is >10x), and ability to reach performance ceiling with additional optimization, supported deployment targets, the quality of the languages themselves (C# and F#), interop with C/C++/Rust, IDE support, static typing, quality of the libraries in the ecosystem (fewer but much better), etc.


👤 amarkdown
Just like the bias against C# we all share, in 2024 we should talk about something new when discussing Node.js. I think Bun should also be part of this conversation. Bun is designed to improve the Developer Experience (DX) in the JavaScript world.

In 2024, if you use TypeScript (strict mode) with Bun, Biome, and tRPC, you can get excellent types, a great toolchain, and all configurations become straightforward. Dependency installation is very fast, and you no longer need to worry about package managers; packaging and compilation are also simplified. Moreover, in the software industry downturn of 2024, we're most likely all full-stack developers. We can't escape the fact that JavaScript runs in the browser, and with the above setup, you can effectively share types between the front and back end.

Regarding database types, there's also Prisma or Drizzle (yes, the JavaScript world is always full of wonderful new things). They allow for the convenient creation of fully typed models, and we can easily use 'import type' to share types with the frontend.


👤 brigadier132
I use typescript because every single service that exists releases a first-party typescript or python library. I don't use python because the type system is just not nearly as well supported as typescript. The major problem I have with typescript is that the tooling is terrible but python has the same exact problem. For example, the entire node esm / commonjs disaster makes configuring projects extremely painful. Then throw in frameworks like Next.js that have their own custom workarounds to these problems and it's even more fragmented.

I would only use something like Golang or Rust in a self contained service where it solves a single specific problem and my primary apis would be in typescript.


👤 santoshalper
Both are very strong platforms. Even Java is great, though not to my personal tastes. We're in a golden age of frameworks and middleware.

👤 delfinom
You use the tool best fit for your application. That's the answer to any language debate.

That's how people make millions in profit even running just PHP ;)


👤 pluc
I know you're not asking about the personality behind the skills, but I'd sooner take a JS dev than a .NET one (even (and maybe especially) that Core runs on Linux), I'd even switch the entire stack to avoid having to deal with Windows talent. The ClickOps mentality in Microsoft-based ecosystems is astounding.

👤 alex_lav
Both/either. They're both widely used at scale. It doesn't really matter.

👤 craftoman
Node.js runs everywhere and has the most popular frameworks, which are still maintained by thousands of developers. You also get serverless functions and NPM with millions of public packages.

👤 rcarmo
I use .NET Core for AOT compiled binaries, which translate to trivial deployment workflows.

👤 dzonga
.net core is pretty cool. they even adopted a similar api to express if I remember well.

Yeah it's fast too. faster than node. typed etc. but C# is a complicated language. and it keeps adding features. the have awesome tooling in .net world etc.

but you know why javascript / node.js shines. JS is a simple language. of course lisps are simple i.e clojure. but only one other language comes close to the simplicity of javascript -- golang.

but is golang malleable as javascript ?

the only thing that might suck in the js world is tooling. but in terms of server things i.e consume json / transform json which is what informational based applications -- i.e the majority of the apps most of us work in. node.js is unmatched in terms of productivity

so yeah node.js gets you 80% of the results with 20% of the work.


👤 moribvndvs
I was a long time net dev (going back to 2001) who has since moved onto a lot of other things, including nodejs. However, I did take a long break from nodejs for about 2 years, and in my new position it is used heavily.

I used to be pretty excited about node. It’s stupidly cheap to get started and deploy anywhere, using one language for front and backend can be a boon for teams that mix junior talent or folks that just want to reduce complexity and maximize reuse, has a low barrier to entry and wide open community, and was surprisingly scrappy in concurrency, pound for pound.

Coming back to node, I’m fucking miserable, to be honest. The headless community has actually become a liability, where the lack of built-in solutions for essential tasks–particularly the toolchain– has led to something worse than design-by-committee, more akin to design-by-vibes or meme, because the core group is painfully behind the needs of the community and tends to fracture (see bun, demo, etc) rather than evolve. We can’t even decide on a god damned package manager, and all of them are a dumpster fire. Meanwhile your project’s dependency tree is a katamari ball of potential supply chain vectors or abandonware, and all you’ve done is fucking boilerplate a project! Which by the way, will break sometime in the near future and require you to painfully hand roll it back up or go through the expensive and arduous task of replacing.

So, about dotnet. I think the toolchain is good. The core libraries get you most of the way there. You can run it inexpensively almost anywhere these days. C# isn’t perfect but it’s a damned good OOP language. You can squeeze a lot of performance out of it, but even the default, basic approaches will get you far. I worry about the ecosystem as I’m not sure it’s as competitive or desirable as the competition, and I don’t feel great about Microsoft either. But my team expressed interest in dumping node for it and I would take it in a heartbeat.


👤 moomoo11
The correct answer is Go