Writing node.js applications in C#
erik-kallen.se
erik-kallen.se
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.
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.
The evented IO model is nice, but nothing earth shattering. Same can again be accomplished with async IO calls, which are trivially easy in .NET 4.5.
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.
Again, not saying you can't do these things in node. The two technologies can easily accomplish the same goal. But if your primary concern is avoiding JS, why would you choose a technology that is built entirely upon it?
Node.cs might make more sense, I agree. I have a feeling the existing ecosystem might bring its own problems with the author's approach, because your C# code may have trouble integrating with those existing libraries, if the underlying generated code does not behave as the Javascript library expects.
So there's a bunch of things it's doing you're not even aware that it is nor have asked it to do.
Think that was MVC 3? I've been using it since the first version, it's much better than it started (the original JSON support was awful), but you still every now and then get a WTF moment.
For example I still really have no idea the 'right' way to return 404 or 500 error pages. I swear they change their mind every release.
Even though they quite clearly don't understand and actually really don't get HTTP. For example take the fact that it's nigh impossible to get the actual request body in ASP.Net. Who's bright idea was that?
In reality every single interface, every single framework they've produced so far has shown a woeful lack of understanding about the web in general and pretty much how it's used outside their world. And I say this as someone who's primarily programmed in VBScript, VB6, C#, Silverlight, ASP.Net and ASP.Net MVC.
I keep almost jumping ship and then they just kinda fix it and I stick around hoping they're not going to make the same mistakes. But they do, jeesus, MVCs ajax stuff is unsurprisingly fucking awful.
But that's the problem with MVC and anything MS led, they don't get the web, they don't get javascript, they keep making incredibly silly decisions.
A good example. Every time I hear 'unobtrusive' js, I just want to scream. They're the cause of this made up problem. No-one else was doing js like that in 2010, no-one else needed unobtrusive javascript. Just MS. There's no such thing as unobtrusive javascript, there's just not writing idiotic magic code like a fucking retard like MS constantly do when it comes to javascript.
And don't even get me started on their 'web services' or WCF. Both deserve to die in a fire.
TL;DR; I love C#, think it's the best language available today by far. I hate asp.net though.
Hasn't been updated in a long time. Not sure why it isn't getting any love, maybe something better came along. Seems to me it should be more performant on equal hardware.
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 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?
Can't see how this fits into that.
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.
Reusing experience and knowledge, and reducing the cost of context switching, those are very clear and positive advantages.
On the topic of sharing code, these should be interesting: the 'pipe dream' ( http://keithnorm.com/spainjs-pipedream/ ) and the 'holy grail' ( http://thatconf.chrisjpowers.com/ ).