Live data from Hacker News

Writing node.js applications in C#

erik-kallen.se

1–10 of 38 posts

Re: Writing node.js applications in C#

#2
When I read about Node.js, the first selling point people mention is how you can reuse code on the client and server sides. For me, the main selling point is that it's Javascript. When I see new variants of js, developed to "fix" js, it makes me want to cry.

Re: Writing node.js applications in C#

#4

When I read about Node.js, the first selling point people mention is how you can reuse code on the client and server sides. For me, the main selling point is that it's Javascript. When I see new variants of js, developed to "fix" js, it makes me want to cry.

Cry me a river

Re: Writing node.js applications in C#

#5
What exactly is the point here? If you want to write C#, just use ASP.NET and MVC 4. You will certainly save yourself a lot of headaches, and you can still do everything async, etc. From what I can tell, the purpose of Node.js is to reduce the number of technologies that a web dev has to use and understand. You already need to use JavaScript on the client side, so using the same thing on the server side allows code reuse, knowledge sharing, etc.

It seems like what the author really wants is ASP.NET on the server, and Script# on the client side. Then the whole stack is C#. Or perhaps he would find TypeScript an acceptable middle-ground on the client. But I don't understand why you would choose Node.js on the server if you hate JavaScript, does not compute.

Re: Writing node.js applications in C#

#6
post #5

What exactly is the point here? If you want to write C#, just use ASP.NET and MVC 4. You will certainly save yourself a lot of headaches, and you can still do everything async, etc. From what I can tell, the purpose of Node.js is to reduce the number of technologies that a web dev has to use and understand. You already need to use JavaScript on the client side, so using the same thing on the server side allows code r…

Reason to use Node.js on the server without liking Javascript: I like the framework. Framework != language (or at least it should be).

Re: Writing node.js applications in C#

#7

When I read about Node.js, the first selling point people mention is how you can reuse code on the client and server sides. For me, the main selling point is that it's Javascript. When I see new variants of js, developed to "fix" js, it makes me want to cry.

I think there's a difference between languages designed to compile down to JS (e.g. CoffeeScript) and wanting to convert a completely different language (e.g. Ruby or C#) into JS.

JavaScript has a lot of good and bad parts, and given we don't really have an option of choosing to use something else in its place I strongly believe that (some) languages that compile to JS have their place. While I don't believe all of them are useful (i.e. dart, typescript) they're specifically targetted as an alternative to JavaScript.

If you're trying to convert a different programming language, that isn't based around the way JavaScript does things then I firmly believe you're doing something wrong. JavaScript isn't just remembering that the semi-colon is optional and that JSON is wonderful. While other languages support event driven behaviour, JavaScripts implementation is (probably) different meaning there's still a learning curve. The documentation for Node.js is, unsurprisingly in JS. The libraries are JS. The whole ecosystem is JS. At least with CoffeeScript quite a few libraries have their source as .coffee, and the style of programming is identical to the compiled JS.

Re: Writing node.js applications in C#

#8
post #5

What exactly is the point here? If you want to write C#, just use ASP.NET and MVC 4. You will certainly save yourself a lot of headaches, and you can still do everything async, etc. From what I can tell, the purpose of Node.js is to reduce the number of technologies that a web dev has to use and understand. You already need to use JavaScript on the client side, so using the same thing on the server side allows code r…

MVC is actually pretty damn clunky. It has a lot of built-ins which are just frustrating (like IPrincipal, ugh). Also there are loads and loads of weird quirks that pop up as soon as you start trying to do anything like returning JSON.

MVC was a huge step forward from the old ASP.Net, but it's still making a lot of frankly odd decisions or suddenly bizarre behaviours in the background (e.g. http://stackoverflow.com/questions/1975983/how-can-i-disable...)

I think one of the reasons node.js is so great is that it just cuts out almost everything and gives you direct control over what is returned. MVC still mucks around with everything trying to be 'helpful' as it's really built on ASP.Net in the background.

To many of us, javascript is still one of the worst mainstream language around today.

Still, why not just make node.cs instead one wonders? Perhaps the existing ecosystem.

Re: Writing node.js applications in C#

#9
post #5

What exactly is the point here? If you want to write C#, just use ASP.NET and MVC 4. You will certainly save yourself a lot of headaches, and you can still do everything async, etc. From what I can tell, the purpose of Node.js is to reduce the number of technologies that a web dev has to use and understand. You already need to use JavaScript on the client side, so using the same thing on the server side allows code r…

Reason to use Node.js on the server without liking Javascript: I like the framework. Framework != language (or at least it should be).

Sidenote: Node.js isn't a framework, it's a platform.

Re: Writing node.js applications in C#

#10
post #5

What exactly is the point here? If you want to write C#, just use ASP.NET and MVC 4. You will certainly save yourself a lot of headaches, and you can still do everything async, etc. From what I can tell, the purpose of Node.js is to reduce the number of technologies that a web dev has to use and understand. You already need to use JavaScript on the client side, so using the same thing on the server side allows code r…

Reason to use Node.js on the server without liking Javascript: I like the framework. Framework != language (or at least it should be).

I'm genuinely curious which feature(s) of node you like better than ASP.NET. I have used both and find them quite similar as far as "raw" capability. ASP.NET however has all of the things you were asking for: great Intellisense, great tooling (for instance integration with Entity Framework), great libraries available (such as SignalR), code in C# or any .NET language (including F#), rich async support...

I like node too, but to me, the reason to choose it is either if you want to remain platform-neutral, or if you really like Javascript.

Post reply on HN