top | item 14019042

Moving from Node.js to ASP.NET Core

98 points| asp_net | 9 years ago |thomasbandt.com | reply

32 comments

order
[+] untog|9 years ago|reply
Just to throw out the obvious: it should be trivial to get some old Node code up and running, particularly if you don't mind using an old runtime version. If you've run npm shrinkwrap you have a log of the exact versions of each package used. You don't have to use ES6 or Typescript, you can keep on trucking the same as you ever did.

It sounds like the author was an ASP.NET developer, dabbled a little in Node, then worked with Xamarin (also .NET) then moved to ASP.NET Core. Nothing wrong with any of that, but it only stands to reason you'll find ASP.NET easier to work with than Node when you've used it extensively and Node not very much at all.

[+] CSMastermind|9 years ago|reply
As a node developer, I've learned the value of shrinkwrap the hard way. I imagine many companies don't use it until it comes back to bite them.

I've had to deal with downstream dependencies breaking things in our dev environments more than I care to admit. I'd suspect that most old node projects of any meaningful size won't just boot up and run without some tinkering.

[+] muse900|9 years ago|reply
I personally find the title could better be worded "Moving my blog from Node.js to ASP.NET" or "I just found out that ASP.NET got much better than it used to be"

When I first read the title I thought it was a node.js dev moving to ASP.NET.

TL;DR The poster of the blog found out that ASP.NET fits his needs better, since he seems more capable on that bit etc and he wants to highlight that ASP.NET has improved a lot towards supporting other platforms than Windows and other capabilities other than webforms etc.

[+] Avalaxy|9 years ago|reply
"very mature und stable"

Sorry but please don't spread these kind of lies. I love .NET Core to death, but the ecosystem is VERY immature. Just today I have been trying to authenticate with the Azure API for 8 hours because:

1) There is barely any support for .NET Core in the Azure SDK.

2) The documentation on the website is very outdated and does not take .NET Core into account. For example the documentation about Table Storage is talking about a TableQuery function that does NOT exist for .NET Core (and this isn't mentioned anywhere), the Azure Webjobs SDK does NOT support .NET Core (again, never mentioned anywhere).

3) .NET Core itself and the tooling surrounding it is full of bugs still. Yesterday I've been trying to reference the TableEntity class in my file, but VS couldn't find it anywhere. I've been trying really hard to get it working, even decompiling the source code to see what's up, but in the end apparently I just had to unload the project and reload it.

Developing for .NET Core is still very, very, very painful. So many things will break and will not be supported (yet).

[+] skrowl|9 years ago|reply
.NET core itself is actually very very stable. The TOOLING for .NET core is what's in flux the most right now.
[+] planetjones|9 years ago|reply
He moved from a dynamically served website using node.js backed by mongo DB to a website that reads markdown files in asp.net and renders them. The website is his personal blog. Alternatively the author could have used Hugo and generated his site statically before deploying it.
[+] git-pull|9 years ago|reply
There's absolutely nothing wrong with having a static website, but there are already tools like pelican, hugo, jekyll, sphinx and stuff that are better suited for it. So while I'm happy for the person's effort and that he got to use Azure, the more glaring thing is I suspect he could be happier using a static site generator.

Also Armin Ronacher released a new one late 2015, Lektor. https://www.getlektor.com/

Show me a team replacing their medium-sized django or rails website with ASP.net Core. Or a YCombinator startup huddling up to their screens late at night in Visual Studio pushing code to azure. And them shipping and making customer's happy.

[+] taurath|9 years ago|reply
Rather lacking in details on what actually went wrong. Then, instead of figuring it out the best solution is just to switch stacks? Seems a bit.. lazy to me.

Tons of breaking changes between 2 years ago node and current stable node.. that's like.. 0.12.x to 6.x? Is it a package issue? I've not had a problem as long as my package config was the same.

[+] YCode|9 years ago|reply
One critical thing I don't feel the article answers is why you would want to move to .NET, what the advantages are over Node.js, TypeScript et al.

I don't mean this as criticism, I'm working on some Node/TS projects and I'm very interested to hear the strengths .NET has over Node.

[+] Rapzid|9 years ago|reply
I've been working with TypeScript a lot over the past year and prefer it to some other languages now(like Python). I would still probably prefer C# and dotnet; all the way if it ran in the browser.

* .Net is faster * ASP.NET Core is faster * .Net uses thread pools for task scheduling; parallelism * Run time type information * An mostly complete task(async/await) based stdlib(node hasn't even started on this to my knowledge) * Linq -> fantastic * Entity Framework -> not without some quirks, but fantastic * Roslyn; feeding dev-time code generation back into your compiler/tools allows for some really cool IDE aware tooling. * Cool JIT/IL stuff like Jil * More number types than "number" * etc

[+] rbanffy|9 years ago|reply
I have the impression he used Node in 2014, never touched it again, didn't want to catch up and was already familiar with ASP.NET.
[+] mmargerum|9 years ago|reply
Do you really need to stick a an animated gif in the middle of the article?

The one thing I would say about JS on the server is writing EJS templates is much faster than something like razor.

Otherwise, go trumps node in every other way.

[+] jinglebells|9 years ago|reply
Why weren't they using nvm? Did they have a build server? I'm confused how it suddenly stopped working, but TBH I got a bit confused and bored.
[+] detay|9 years ago|reply
Just did the opposite. So far so good.
[+] vyrotek|9 years ago|reply
From Core specifically? Any additional insight?
[+] throwayedidqo|9 years ago|reply
I can't figure out the circle jerk around Node. Debugging sucks A LOT, JS syntax sucks, single thread sucks, NPM is filled with 95% junk.

Python, Java, golang, C#, and maybe even PHP have more mature and reasonable stacks.

[+] TheAceOfHearts|9 years ago|reply
Ultimately, it's because it's easily approachable and it mostly works. You can learn JS and do stuff on both node and the browser. That's incredibly powerful.

Debugging node has gotten much better as of the last year. [0] You can use Chrome Dev Tools to debug node! I'll admit I've had limited experiences in this area, but so far Chrome Dev Tools has provided one of the best debugging experiences I've had. The killer feature is that it's easy to get started and gradually pick more stuff up as you go along.

JS syntax sucks? That's subjective. After learning functional languages like Elixir and Haskell, I agree that JavaScript is lacking many nice features. I don't hate or dislike JavaScript, though. To help solve this, have you tried out macros? [1] I'll admit I've only looked lightly into the feature and I haven't given it a very serious try, but it looks quite promising.

NPM is filled with a lot of junk. That's pretty accurate. You need to be incredibly diligent when pulling in dependencies. Make sure your dependencies are well tested and not bloated and overly complicated. Have you had a better experience with other languages? I can't say I've had any more luck with other languages. From an outsider's perspective, I think Go and Rust seem to be maturing quickly, but I haven't used either seriously enough to answer with confidence. If I'm hacking something together, I think using node is an amazing choice; if I'm looking for incredibly long-term support, I'd probably use Java (as much as I dislike it).

[0] https://nodejs.org/api/debugger.html#debugger_v8_inspector_i...

[1] http://sweetjs.org/

[+] taurath|9 years ago|reply
What you stated IS the circle jerk. I can't come to a single thread mentioning node without 1/4 of the comments being your complaints.
[+] jen20|9 years ago|reply
I'm with you on NPM and the JavaScript language, but suggesting that Node debugging "sucks" is sure indicative that you've chosen to ignore the available tools - it is one of the only dynamic languages where post-mortem debugging is possible _at all_.
[+] PretzelFisch|9 years ago|reply
I don't have a lot of love for node.js or depending on npm but debugging? I have not had a problem using webstorm.