4 ms·
Why do people hate Node so much?
by sunwooz 14y ago
Why do people hate Node so much?
- jmspring 14y agoI don't hate node However, the tools around using Node and JS are inferior to other languages (C/C++, Java, C#, even PHP and Python). Further, the language doesn't have the cleanest history in terms of design, so in a project with multiple people on it, you are leveraging coding guidelines, linters, and the like to have any real consistency. A colleague raised an interesting question which I will paraphrase -- given the desire to build a project that exposes webservices from the ground up, what language would you choose? My first response was, it depends on the platform. If you are using Azure, for instance, C# is the first class candidate, Node and other languages are tier 2/3. EC2, sky is the limit. Heroku, probably start with Ruby. If all things were equal, I would personally choose Python over Javascript. Python and Twisted give a lot of the same benefits as Node in terms of async development. Python is more consistent and has a more mature (and featureful) standard library. Node and modules are plentiful, but a lot (even socket.io) still show some signs of being young. For me, the choice is - right tool for the platform, group, and project you are working on. Personally, I will err towards the more mature when you are talking about scripting languages. (PHP doesn't count, it's super easy and I've used it a lot, but I always feel dirty afterward :) )
- deleted 14y ago[deleted]
- wpietri 14y agoIt often happens. E.g., when you are starting a new project on your current infrastructure. Which is where most new projects happen.
- jmspring 14y agoIf you are working at a bigger company, sometimes there is a "standard platform" for the company. I was just covering multiple scenarios.
- fletchowns 14y agothe tools around using Node and JS are inferior to other languages (C/C++, Java, C#, even PHP and Python) You are comparing a language that is like 2 years old vs languages that are pushing 20 years old. the language doesn't have the cleanest history in terms of design It is certainly no worse than several of the languages you just listed. Personally, I will err towards the more mature when you are talking about scripting languages. Psssst, JavaScript is a year older than PHP.
- jmspring 14y agoJavaScript for server side is much younger than PHP, yet inherits the client side warts. :)
- niggler 14y agoGoogle, through Closure Tools, and other groups and people have built tools around javascript. For example, JSHint is a pretty good linter and fixjsstyle is a nice little tool to fix formatting. Certainly JS isn't as amenable to static analysis as C, but with time we'll see more.
- jmspring 14y agoWhat you outline is my gripe. Typical NodeJS dev setup amongst those I know: Sublime JSHint JSFormat (or fixjsstyle) To get code to some basis of style consistency. Debugging - node-inspector or console.log In the last six months, node-inspector has gotten a lot better, but a lot of times inserting console.log is just faster (mmm...printfs).
- niggler 14y agoIn many ways it parallels what people do in C: until you get to the scale where precise logging and style enforcement matters, you just forge ahead in the path of least resistance. So like you said, they printf or console.log, use lint or jshint, use -Wall or "use strict" etc. Btw I prefer console.error :)
- voidlogic 14y agoI'll take a guess- A lot of people I know think Javascript is a horrible language- you can read blogs and blogs about arguments for why this is true and not true. But I think it comes down to people who hate JS lamenting it escaping from client side into the server side.
- niggler 14y agoNode as a technology is misunderstood. Most people from other languages hear that it is javascript and scoff without digging into the source or into libuv. As a platform it made a certain set of trade offs which make it ideal for certain use cases, but some zealots see it as a panacea and suggest using node for everything under the sun. (Not to mention the general arrogance of some vocal proponents -- the core people are relatively humbled but there are a lot of pseudo rock star developers who think its cool to write JS instead of using the best tools for the job) The traditional complaints of javascript were summarized well by Crockford http://www.crockford.com/javascript/javascript.html http://www.crockford.com/javascript/javascript.html Most of the people writing in JavaScript are not programmers. They lack the training and discipline to write good programs. JavaScript has so much expressive power that they are able to do useful things in it, anyway. This has given JavaScript a reputation of being strictly for the amateurs, that it is not suitable for professional programming. This is simply not the case. reply
- jmspring 14y agoNode inherits the warts of Javascript. Node the framework is quite good and handles abstracting out threading/async incredibly well. Node the community is still young, but growing. On two recent projects, I tried two different http auth related modules (digest auth). Both had been active for awhile and recently updated (within a month or two). Yet, despite digest auth being pretty established/spec'd out, had some serious flaws (I didn't have the time to offer back feedback, but it is on my list to submit patches). Friends have mentioned similar, though more complicated issues w/ socket.io for production use, one of THE modules used to highlight Node. Node, JS, and the node environment have their warts, just approach them knowing that. Don't advocate them as awesome rockstar tech.
- niggler 14y agoOutside of some very low-level modules that wrap C calls, most of the node modules are either very specialized or incomplete. I definitely find it easier in most cases to just rewrite functionality than to fallback on the recommended modules. Fortunately the C++ API isn't too far abstracted from the V8 API
- fleitz 14y agoBecause javascript has a number of serious flaws. And because when you bolt everything back on to node to get a decent webdev environment it's really not that fast. And because callbacks are a really shitty way to write async code. Like most things node is a tool with a very specific use case, as is typical with anything that is particularly fast at one task people assume that it's fast at all tasks. (C anyone?) And also because unless you are running a free service your code really has to be absymally slow to not make money. Therefore you should program in the environment that is most pleasurable rather than the environment that is 'fastest', whatever that means. But mostly because most of the people who talk about how great node is really don't have a clue what it actually excels at. Basically, for all the same reasons people hate PHP.
- rdtsc 14y agoI don't hate it I just won't use it because I don't like its characteristics at the moment: * Javascript : don't like it. This "[3,1,10,2,].sort()= [ 1, 10, 2, 3 ]" is broken. Don't care about the historical explanations or philosophical arguments about strong or weak typing. It's broken and that's that. * Nested callbacks. I don't like that. I like green threads and/or processes for handling concurrency. I'll take Go, Scala, Rust, or Erlang's (processes|channels|actors) instead, if not I'll take any green threads. * Single threaded : server sits there with 16 cores, it's nicer to use something that can automatically scale across them. This also means if any deeply nested callback functions ends up blocking the whole node process stops. Not trying to upset anyone at Joyent or others who put effort into, just my personal preferences. It is not that Node is bad, it's pretty good, it is just that I don't see a reason to use when they are much better tools out there.
- camus 14y agono matter what people say , async programming is hard. + Async + closures makes things even harder , you need to watch for context mutation etc ... + in my opinion nodeJS is a great idea , the problem is javascript doesnt help developers do async programming the right way. Async programming should feel as natural as writing sync programs, the language should do the heavy lifting.