Live data from Hacker News

Writing node.js applications in C#

erik-kallen.se

21–30 of 38 posts

Re: Writing node.js applications in C#

#22
post #15

Earlier quoted context omitted.

can you elaborate on the quirks around returning JSON with asp.net MVC? its a pretty common usecase.

There's a load of little things that are gotchas, but an example that pops into my head is that it wasn't compatible with default jQuery for example. If you didn't ask specifically for a content-type of application/json, which jQuery didn't by default, it would throw a hissy fit. It meant mucking around with the ajax object meaning you couldn't use certain jQuery shortcut methods. Regardless of what you 'told' MVC to…

By default MVC 4 will return JSON so you don't need to specify the content-type unless you want something that isn't JSON.

Re: Writing node.js applications in C#

#23
post #18

I can't believe Javascrip is really that awful that anyone would rather go through all this trouble, rather than just write JS.. Maybe it has more to do with people being to reliant on IDE's, which he, kind of, admits to anyway.. I can't believe that any IDE is that great that anyone would rather go through all this trouble, rather than just use something else..

I think in this case, it isn't about being dependent on Visual Studio, but C#.

Re: Writing node.js applications in C#

#24
One of the key benefits of node.js is that people who are great with JS can write server code and you have one language stack less to worry about. You can with that (watch for security issues) also share code & objects between the server and browser.

Can't see how this fits into that.

Re: Writing node.js applications in C#

#25
post #16

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.

Currently, reusing code on client and server is far from the first selling point. Companies like Meteor and Groupon are pushing in that direction quite heavily, but for mere mortals it's still limited to reusing a few core libraries like underscore, async or templating. Reusing experience and knowledge, and reducing the cost of context switching, those are very clear and positive advantages. On the topic of sharing c…

As an aside, http://thatconf.chrisjpowers.com/ features what I will give my "Annoying Hipster Presentation Style Of The Month" award. Can't we just have information without all the JS supa-awesumness, just because we can?!?!

Re: Writing node.js applications in C#

#26

Earlier quoted context omitted.

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…

I would imagine he's referring to the non-blocking IO and evented model. ASP.Net and friends use threads for everything, which allows for heavier processing, but also is more restrictive in terms of concurrency.

Re: Writing node.js applications in C#

#27
post #18

I can't believe Javascrip is really that awful that anyone would rather go through all this trouble, rather than just write JS.. Maybe it has more to do with people being to reliant on IDE's, which he, kind of, admits to anyway.. I can't believe that any IDE is that great that anyone would rather go through all this trouble, rather than just use something else..

I think in this case, it isn't about being dependent on Visual Studio, but C#.

The two go hand in hand. Aside from a very small cross section of Mono users, most C# users are very dependent on Visual Studio.

Re: Writing node.js applications in C#

#29
post #18

I can't believe Javascrip is really that awful that anyone would rather go through all this trouble, rather than just write JS.. Maybe it has more to do with people being to reliant on IDE's, which he, kind of, admits to anyway.. I can't believe that any IDE is that great that anyone would rather go through all this trouble, rather than just use something else..

IMO JavaScript is that awful, but I still don't understand why you wouldn't just use Go or C# or whatever natively on the backend. There are lightweight frameworks similar in concept to node for virtually every language out there.

I understand why people write JavaScript translators for the browser -- there you're (unfortunately) stuck with JavaScript there is no other option. I also understand why people who do like JavaScript use node. Even though I'm not a fan of JavaScript, there is certainly some benefit to keeping a project all in one language. But if you're the type of person that wants to avoid JavaScript in the first place, why start off in a situation where you already have an overly complicated language-to-language transpiler situation on the backend?

Re: Writing node.js applications in C#

#30
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/q…

What's wrong with IPrincipal, which btw is a .NET, not MVC thing?
Post reply on HN