
Moving from Node.js to ASP.NET Core - asp_net
https://thomasbandt.com/moving-from-nodejs-to-aspnet-core
======
untog
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
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.

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

------
muse900
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
"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
.NET core itself is actually very very stable. The TOOLING for .NET core is
what's in flux the most right now.

~~~
sundvor
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.

------
planetjones
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
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/](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
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
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
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

------
mmargerum
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
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
Just did the opposite. So far so good.

~~~
vyrotek
From Core specifically? Any additional insight?

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

~~~
cx1000
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://mobile.twitter.com/mitsuhiko/status/712624914071728128)

[https://www.reddit.com/r/programming/comments/4bjss2/an_11_l...](https://www.reddit.com/r/programming/comments/4bjss2/an_11_line_npm_package_called_leftpad_with_only/?st=J1182X6I&sh=d6f61965)

~~~
vmasto
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.

~~~
rogersach
Javascript is the reason WebAssembly came into existence.

~~~
vmasto
That statement is highly uninformed.

I would suggest starting reading from here
[https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...](https://github.com/WebAssembly/design/blob/master/FAQ.md#is-
webassembly-trying-to-replace-javascript)

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

~~~
tracker1
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.

------
igtztorrero
Are you crazy ??????

