Live data from Hacker News

Hard-won lessons: Five years with Node.js

blog.scottnonnenberg.com

11–20 of 365 posts

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

#11
Reading up on all these Node.JS posts I'm surprised at just how many gotchas the platform has and how there's no single standardized way to solve them.

It's not encouraging stuff. On paper the platform looks decent but aside from a few use cases it seems that there's more hype than it merits.

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

#12

Earlier quoted context omitted.

But you're still error handling with `.catch()`. Without that, you'd have an uncaught Promise rejection, which could take down your Node process.

It's common for people to complain about something like a syntax error taking down their whole process, so that's how I read it -- that you're trying to do "too much" catching.

Yeah, I'm happy to admit that I figured out how Node/Express work entirely by doing things wrong, and then fixing my mistakes :)

I came to this after building C#, Scala, and Java webapps, so it surprised me that this these class of coding errors could take down a site (both screwing up the try/catch or not handling promises).

There is probably some room for Node/the language/Express to make the experience better, either way it's something you'd need to know if you're new to the platform :)

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

#13

Earlier quoted context omitted.

It's common for people to complain about something like a syntax error taking down their whole process, so that's how I read it -- that you're trying to do "too much" catching.

I'm not an expert with​ deploying application servers but shouldn't part of handling lifecycle include the ability for a service to crash and be respawned? Ie. Be okay if a syntax error crashes your server.

If you're comparing to J2EE, ASP.NET, Apache, etc, application servers tend to be big monoliths with lots of features, but Node is much lighter / more modular, so you end up setting that up yourself (that also surprised me)

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

#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?

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

#16

Reading up on all these Node.JS posts I'm surprised at just how many gotchas the platform has and how there's no single standardized way to solve them. It's not encouraging stuff. On paper the platform looks decent but aside from a few use cases it seems that there's more hype than it merits.

Yeah. I've had production experience with node.

It's been the single least productive coding environment of my life. When you're taking care of large systems of backend servers, Javascript is pretty far down on the list of languages I'd pick to use. Add to that Node's explicit handling of asynchronous operations instead of just blocking and waiting.

Also, it seems to get worse the more code you have. I'm sure it's possible to write really good readable javascript in large codebases, and the same for Node, I just haven't seen it done.

Another subject the author brings up is "the ecosystem". Javascript has so many libraries that keeping up with them, their updates, and using them in a canonical way throughout a large codebase is a full-time job for at least one engineer.

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

#18
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?

There are a lot of negatives, but it is any easy language to make rapid progress writing code in, and ES6 or TypeScript have made it a lot better than it used to be. You can do a lot of prototyping in the browser REPL too (e.g. I like to go to the lodash docs, write out code on the site, then paste into my app).

It's nice to be able to do server side rendering (i.e. run React there). Also you can run all the build tools in your application server during development which can be super convenient - Probably the most compelling example I've seen of this is Next.js.

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

#19
> Verify All Assumptions

When you have to worry about the environment unexpectedly reusing internal variables, when is it considered foolish to use a framework where you have to question every relationship between every concept? Just stop using it.

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

#20
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?

I only know JavaScript (and I know it quite well). Why learn a whole other language, when Node gets the job done just fine?
Post reply on HN