Live data from Hacker News

Hard-won lessons: Five years with Node.js

blog.scottnonnenberg.com

351–360 of 365 posts

Re: Hard-won lessons: Five years with Node.js

#351

Earlier quoted context omitted.

You just described my experience with npm, except there aren't any useful tracebacks, just a note absolving npm of all blame and advising me to contact some random module author. Edit: and of course with npm the annoying downloads happen every time for each project, instead of once per dependency version...

Not excusing any crashes for npm (having those for any package manager sucks), but `npm init` doesn't download anything or make a project that needs to, it has readable config files and `npm --help` at least gives you a list of commands. A lot of the small stuff goes a long way to making things more approachable.

That's apples and oranges. You would have to set up some Express project or something to do what the Dropwizard archetype is doing.

Also package.json and pom.xml are equally (un)readable. At least Maven project files have a schema to help editors out.

Re: Hard-won lessons: Five years with Node.js

#352
post #75

Earlier quoted context omitted.

NodeJS has a handful of things that tend to get brought up. Callback soup and difficult error handling. Both are resolved by promises. Once you get the hang of promises, you are capable of doing concurrent asynchronous tasks in a manner that would be significantly more difficult in any other language. On top of that, NodeJS is very, very fast. Compared to Python or Ruby, straight computing is significantly faster, bu…

Love this. This is precisely why I love Javascript too, I find these douchey condescending comments on Javascript/Node.js from people who've not grasped the language and it's philosophy deeply, extremely annoying. There's a lot a capable developer can accomplish with Javascript, with it's first order functions, collection operations, generators, promises and now, async /await. Granted JS is not idiot-proof, but I'd a…

Or maybe they just don't share the philosophy. Or are opposed to it. A lot of Node enthusiasts also come across as douchey and condescending as they claim that people just haven't grasped the language or its philosophy.

I think Node is absolutely fine. But I see why someone who values robustness and error-reduction as primary goals or someone that has a firm grasp on other asynchronous models might not see many advantages to Node. Just as some people value stability higher than progress, neither is necessarily evil, just beliefs.

People have different priorities and Node delivers on some and is not geared towards others.

But I don't find Nodes async, single thread model very interesting or revolutionary. It is very pragmatic and definitely useful but I found the Erlang VM and Elixir a much more compelling solution for example.

Re: Hard-won lessons: Five years with Node.js

#353
post #15

I can't imagine choosing to write Javascript on the server, but considering its popularity I'm wondering if I'm wrong. So I'm curious as to the reasons people chose Node.js and whether you would recommend it, anybody willing to share their experiences?

You're not wrong. InterSystems Caché is easily the worst tool I've ever used. A typo in your code often caused the compiler to bork your entire runtime. Not kidding. Node is almost that bad. Stately as nicely as possible: it's syntactic vinegar for a type hostile flow of control obfuscation framework. If you have some irrational need to use libuv (callback hell vs actors, CSP, multithreaded NIO, or AIO thread per con…

A bit flame-baity but I liked your point for the description. Syntactic vinegar was new to me and type hostile felt novel.

Also a good example of how it needs to be okay that some people just don't like Node. While also illistrating that they could also, arguably, be nicer about it ;)

What area do you generally work in? That often influences the view of which tools are suitable.

Re: Hard-won lessons: Five years with Node.js

#354

Earlier quoted context omitted.

The default error middleware built into my framework caught it and responded with a 502.

...and almost certainly left a bunch of dangling state in your app that, at best, is a memory leak.

... or almost certainly was correctly dereferenced, logged, and garbage collected.

Re: Hard-won lessons: Five years with Node.js

#355

Earlier quoted context omitted.

Can you elaborate on the "major pain in the butt to monitor and keep Node.js running production-like" What sorts of issues did you face? Certainly .NET and Java have more tooling, but I haven't noticed a difference between keeping a Node process up as opposed to a Python one. Hard to compare to stateless PHP.

The default behavior for Node when there is an uncaught error is to crash the process, killing all requests in flight. Even if you go out of your way to stop this default behavior, errors still likely leave the process in an inconsistent state. Node can't just unwind a few stack frames like synchronous platforms. Do you read JSON from ajax post bodies? Do you access fields in that JSON without sanity checking it? Try…

> The default behavior for Node when there is an uncaught error is to crash the process.

What language doesn't do that?

Re: Hard-won lessons: Five years with Node.js

#356

Earlier quoted context omitted.

I would watch it with that "large talent pool". As is typical in the language du jour, there are tons of worthless imposters going around selling Node.js skills. However, it's even worse in the case of JavaScript because since it uses the "same language", some people assume that light front-end scripting qualifies as real backend development experience. "Tons of modules" is also a misnomer, because a much larger than…

I've had some trouble finding explicit node backend jobs, as someone who'd consider themselves a relative specialist in it. Most places want a full stack developer well versed in common frontend frameworks and maybe a tiny bit of services on the backend. Most backend focused jobs (rightly, probably) focus on more traditional stacks or go. There's amazing things one can do very quickly with node exp (serverless/Faas s…

Same, almost all JavaScript job postings are front end only. It's quite a shame.

Re: Hard-won lessons: Five years with Node.js

#357
post #97
post #75

Earlier quoted context omitted.

NodeJS has a handful of things that tend to get brought up. Callback soup and difficult error handling. Both are resolved by promises. Once you get the hang of promises, you are capable of doing concurrent asynchronous tasks in a manner that would be significantly more difficult in any other language. On top of that, NodeJS is very, very fast. Compared to Python or Ruby, straight computing is significantly faster, bu…

> Once you get the hang of promises, you are capable of doing concurrent asynchronous tasks in a manner that would be significantly more difficult in any other language. FYI, anyone who has worked with Elixir or Erlang views these sort of statements about Node as completely ridiculous. The only languages right now that are making a serious effort to bring real concurrency to modern programming are Go and Elixir. Node…

When they say node has great ease of asynchronous non blocking IO, they are certainly not talking about vs golang or erlang. As much as the concurrency is fake, as long as _real concurrency_ is not a fundamental business requirement, it's way better than literally no concurrency.

Re: Hard-won lessons: Five years with Node.js

#358

Earlier quoted context omitted.

Can you elaborate on the "major pain in the butt to monitor and keep Node.js running production-like" What sorts of issues did you face? Certainly .NET and Java have more tooling, but I haven't noticed a difference between keeping a Node process up as opposed to a Python one. Hard to compare to stateless PHP.

Love it or not, at least Python has uWSGI, which certainly helps keep things running through errors, and gives you more robust logging at a higher level, etc. if you lose your Node process it's just poof with no guarantees you'll get a good trace to pinpoint the fault.

Huh, that's weird, I've never had a Node process silently die in production without a good trace or robust high level logging. Are you sure you're​ not just making stuff up?

Re: Hard-won lessons: Five years with Node.js

#359
I'm seeing a lot of Node hate here, especially for large projects in Enterprises, but I've been watching a lot of Node Interactive talks, and companies such as Walmart, Netflix, GoDaddy, Paypal are switching. so why are they happy with it?

Re: Hard-won lessons: Five years with Node.js

#360
post #352

Earlier quoted context omitted.

Love this. This is precisely why I love Javascript too, I find these douchey condescending comments on Javascript/Node.js from people who've not grasped the language and it's philosophy deeply, extremely annoying. There's a lot a capable developer can accomplish with Javascript, with it's first order functions, collection operations, generators, promises and now, async /await. Granted JS is not idiot-proof, but I'd a…

Or maybe they just don't share the philosophy. Or are opposed to it. A lot of Node enthusiasts also come across as douchey and condescending as they claim that people just haven't grasped the language or its philosophy. I think Node is absolutely fine. But I see why someone who values robustness and error-reduction as primary goals or someone that has a firm grasp on other asynchronous models might not see many advan…

Hey, more power to you if you want to use more expressive/functional languages than Javascript like Erlang or Clojure. However claiming that a language that allows nothing beyond the Object oriented model of computation like Java or Go is more robust or allows you to have less errors would not be accurate (see the comments above).

The primary reason anyone would use Javscript over say Erlang would be the ubiquity of the language and the availability of libraries or strong familiarity with the language. But my point is Javascript provides you the tools to write functional code that is robust (if you are disciplined) and generators + promises (and async/await) makes the single threaded async model painless. I certainly did not claim that it was a silver bullet or a revolutionary model of computation.

Post reply on HN