6 ms·
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,
by throwayedidqo 9y ago
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.
- taurath 9y agoWhat you stated IS the circle jerk. I can't come to a single thread mentioning node without 1/4 of the comments being your complaints.
- cx1000 9y agoI 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/712624914071728128 https://mobile.twitter.com/mitsuhiko/status/7126249140717281... https://www.reddit.com/r/programming/comments/4bjss2/an_11_line_npm_package_called_leftpad_with_only/?st=J1182X6I&sh=d6f61965 https://www.reddit.com/r/programming/comments/4bjss2/an_11_l...
- vmasto 9y agoI 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 9y agoJavascript is the reason WebAssembly came into existence.
- vmasto 9y agoThat statement is highly uninformed. I would suggest starting reading from here https://github.com/WebAssembly/design/blob/master/FAQ.md#is-webassembly-trying-to-replace-javascript https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...
- rogersach 9y agoI never said it would replace it, I was saying that it was for those who didn't want to use javascript.
- tracker1 9y agoNo, 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.
- tracker1 9y agoAren't there a lot of languages that compile to the Java platform? Also, there are several that build for .Net as well.
- throwayedidqo 9y agoIt's not the same. Those compile to the bytecode but not through generating code. The "transpilers" for JavaScript are glorified code generators, they don't perform most of work that true compilers do. Namely optimization and dead code elimination. The only true compiler for JS at the moment is google's Closure. Scala and the .NET family languages go straight from code to bytecode with their own compiler frontends
- jen20 9y agoI'm with you on NPM and the JavaScript language, but suggesting that Node debugging "sucks" is sure indicative that you've chosen to ignore the available tools - it is one of the only dynamic languages where post-mortem debugging is possible _at all_.
- PretzelFisch 9y agoI don't have a lot of love for node.js or depending on npm but debugging? I have not had a problem using webstorm.
- TheAceOfHearts 9y agoUltimately, it's because it's easily approachable and it mostly works. You can learn JS and do stuff on both node and the browser. That's incredibly powerful. Debugging node has gotten much better as of the last year. [0] You can use Chrome Dev Tools to debug node! I'll admit I've had limited experiences in this area, but so far Chrome Dev Tools has provided one of the best debugging experiences I've had. The killer feature is that it's easy to get started and gradually pick more stuff up as you go along. JS syntax sucks? That's subjective. After learning functional languages like Elixir and Haskell, I agree that JavaScript is lacking many nice features. I don't hate or dislike JavaScript, though. To help solve this, have you tried out macros? [1] I'll admit I've only looked lightly into the feature and I haven't given it a very serious try, but it looks quite promising. NPM is filled with a lot of junk. That's pretty accurate. You need to be incredibly diligent when pulling in dependencies. Make sure your dependencies are well tested and not bloated and overly complicated. Have you had a better experience with other languages? I can't say I've had any more luck with other languages. From an outsider's perspective, I think Go and Rust seem to be maturing quickly, but I haven't used either seriously enough to answer with confidence. If I'm hacking something together, I think using node is an amazing choice; if I'm looking for incredibly long-term support, I'd probably use Java (as much as I dislike it). [0] https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js https://nodejs.org/api/debugger.html#debugger_v8_inspector_i... [1] http://sweetjs.org/ http://sweetjs.org/
- throwayedidqo 9y agoI'm partial to Java for a lot of reasons. That aside I still think my criticisms of JS syntax, NPM, and debugging are valid. Let me explain a bit more though. The biggest problem with JS syntax is not dynamic typing, it's a startling lack of consistency. For example .ForEach vs "for in" vs "for as" vs manually looping over properties. That's at least 4 loop types made for looping over object lists/properties. Checking for undefined is convoluted, the crockerford privacy pattern is convoluted, Iffy syntax is convoluted, function scoped variables are convoluted, using Arrays.prototype and similar are convoluted because you cant trust built in functions to work properly. Even arrays are convoluted because there's a marked distinction between an array vs "array like" objects and certain things work on one but not the other. And don't get me started with double equals. I could probably go on for maybe 5-10 pages given some time, but I think that's enough of a point. I have read several JavaScript books cover to cover multiple times , and honestly half the books are "patterns" aka workarounds for things that usually "just work" in other languages. Yeah I understand they're working to fix this stuff but some of the cruft will remain with us for a long time. I haven't used a single other language with as many gotchas as Javascript, not even Perl. NPM is a mess and we seem to agree on that. I happen to have published packages on both C# and Java, and I'll say that especially for Java, the bar for "acceptable" is much higher. This is kicking a hornets nest but... I think a lot of the reason the quality of NPM packages is so low is because the average JS developer has a lot less experience. Still, some of the problem is the design of NPM itself. They need to ditch their module system for the new standard yesterday and they need to make it less trivial to publish a package. Both C# and Java scan your manifest to make sure you meet some minimum standards, such as a sane namespace. As for debugging, it might be a lot better now, but Chrome is still seriously underpowered as a debugger compared to a real IDE. It's main purpose is a web browser so this isn't too surprising. Java or C#(my two mainstays) have full debuggers built into the runtime plus tons of extras like profilers and processing/comparing process dumps and memory leak finding systems and all sorts of crap that becomes useful when you've got nasty bugs. JavaScript is still maybe half a decade behind on tooling, debugging, and IDE support. You're probably right that Node is great for hacking stuff together quicker than Java, but I don't think the language and tools around it are mature enough to support large applications expected to last a decade or more. To me Node feels like Python but with a much better performing runtime, and IMO should be treated as such. Good for quick stuff and "glue" applications. My angst with the JS community comes from their collective immaturity(or maybe it's just the hype train, or maybe both). Everything new in JS is the best thing ever and makes front page HN, even if it's existed forever. I remember a post about the Closure compiler in JS making the front page a few months back. The Closure compiler has existed for what... Ten years? Is it really that big a deal that google ran a JS codegen from the native Closure source? The JS community thinks so apparently. That and the JS community pooping on C#/Java because they have a big runtime when the runtime for JS is also huge. You need an entire web browser just to debug it! Anyways yeah JS is really approachable because you don't need to install anything to use it and it's being taught everywhere as a first language. But its badly designed and the ecosystem around it is busy but of largely low quality.