https://news.ycombinator.com/item?id=13034904
How are things looking now after 8 years?
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.
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
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
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.
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.
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.
That's how people make millions in profit even running just PHP ;)
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.
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.