Hacker News new | past | comments | ask | show | jobs | submit login
Moving from Node.js to ASP.NET Core (thomasbandt.com)
98 points by asp_net on April 2, 2017 | hide | past | favorite | 32 comments



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.


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.


Thankfully Yarn is here to solve most (if not all) of these problems.


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.


"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).


.NET core itself is actually very very stable. The TOOLING for .NET core is what's in flux the most right now.


Hey, c'mon, we hit 1.0 on the tooling _weeks_ ago, with VS2017. Net Core has only been out since end of June last year. ;) /s

(I started working on a .net Core project in January last year, transitioning into it as a new language from PHP/Coldfusion - perhaps not the ideal learning path with all the changes between the betas/RCs yet quite exciting at the same time)

Now that we're here, though, we have e.g. NCrunch working with Core and from this point on it's becoming much more viable to develop in.


You can claim that it's very stable but the ecosystem (support, tooling, community, etc) is simply not there yet to make .NET core one of the most attractive techs in the market right now.


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.


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.


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.


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.


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


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.


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.


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.


Just did the opposite. So far so good.


From Core specifically? Any additional insight?


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.


I completely agree. The fact that there are so many abstractions that compile/transpile into javascript is also a big red flag. What other languages do you see that in? And then of course there is the horrible standard library, where the most obvious functions don't exist and require a package and maintainer.

https://mobile.twitter.com/mitsuhiko/status/7126249140717281...

https://www.reddit.com/r/programming/comments/4bjss2/an_11_l...


I find it extremely telling that both of the issues you linked are now included in the core language library, and what happened with left-pad will never happen again after amends were made by npm to make sure that it indeed never does.

If you want to critize JavaScript you can do better with something more substantial. If anything, the speed at which problems you linked get remedied is a plus for the language. Even more so if you take into account the extremely unique position JavaScript is in where you can simply never change an API after it goes public.

> The fact that there are so many abstractions that compile/transpile into javascript is also a big red flag

What did you expect? JavaScript is the only language browsers natively understand. If you want to write code in your favorite programming language you will have to transpile/compile it to JS.


Javascript is the reason WebAssembly came into existence.


That statement is highly uninformed.

I would suggest starting reading from here https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...


I never said it would replace it, I was saying that it was for those who didn't want to use javascript.


No, it really isn't... it's for code that absolutely must perform well, without the need for browser plugin/extension installation. Gaming logic, transcoding streams, etc.


Aren't there a lot of languages that compile to the Java platform? Also, there are several that build for .Net as well.


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/


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.


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_.


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.


[flagged]



Are you crazy ??????




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: