Live data from Hacker News

Hard-won lessons: Five years with Node.js

blog.scottnonnenberg.com

31–40 of 365 posts

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

#31
post #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.

Yeah...I think we have to use some context clues in interpreting this particular piece of advice. Clearly, he's not suggesting you verify all assumptions as it would take millenia to verify literally all the assumptions that one makes when writing a complicated program.

Personally, I interpret it as meaning he believes that the average developer's baseline calibration for how much is to be assumed is too trusting and people should verify more assumptions than they do-- starting with the most dubious ones of course.

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

#33
post #28
post #27

Earlier quoted context omitted.

I actually have, but it doesn't alleviate my biggest issue with Javascript, which is its async story. Also I've had experiences with Typescript code compiling with an error then immediately recompiling without any errors. Then errors when I switch to my browser. The immediate recompilation is probably just webpack but it doesn't inspire confidence when errors are non-deterministic.

Typescript plus async/await is a beautiful solution to both the async story and typing story.

I don't think asnyc/await is a good solution to asynchronous programming. Lua, Go et al are more what I was thinking of as good examples of asynchronous programming. See http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...

And I addressed some concerns with Typescript in a sibling comment. It is much better than plain Javascript, though.

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

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

JavaScript is a scripting language. So is Python and Ruby. As a scripting language, excluding all bindings (files, networking, etc), JavaScript is substantially faster than Ruby or Python.

Now, in terms of bindings, bindings to libuv are also fast. So node is not so much of a problem in itself.

However the problem is how the language is being used:

To say you can write a serious library or server code because you know JavaScript, is the same as saying you can write a paper in cardiology research because you know English.

You will find a lot of people that completely disregard the domain knowledge required to write safe, workable code. While this happens in many languages, JavaScript is the lingua franca for those kind of people.

Because of this, be very careful of the libraries you use. You will most likely have to read the code to ensure there is some thought behind it.

Then if you are hiring node developers, prepare to receive an avalanche of resumes from people without a degree expecting to learn on the job at your expense while receiving a 6 figure salary.

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

#35
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've got over a decade of professional experience in C#, Python, and Java. I'd consider myself a Java developer before all else, yet I still turn to Node.js for proof of concept projects because certain things are just quicker to implement.

Here's the major caveat, out of, say 100+ PoC/prototype projects I've ever done, I've taken two to 'production'. I put production in quotes because they were actually internal services as part of our build and delivery pipeline. It's a major pain in the butt to monitor and keep Node.js running production-like in even remotely similar ways you would with Java, .NET, Python, or even PHP for that matter. I don't expect such drastically different technologies to be exactly alike for production workloads, but there's usually analogous ways to do X, Y, or Z.

You know where Node has been awesome? You land a project with a real tight deadline and its more of a fire and forget project (think interactive 'experience' at a major gaming conference for instance). It needs to run pretty well for a short period of time with a narrow scope of functionality, but some of that functionality is non-trivial. I absolutely love Node for that.

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

#37
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've used nodeJS at 3 of the past 4 startups I've worked at (currently using PHP). I had a hand in choosing it at all those 3 places and my main reasons boiled down to:

1. most devs know JS (so it's easier to hire & onboard new devs)

2. while everyone claims node's dependencies are hell, I love the choice available (although over time, it's tiring).

3. The community is generally awesome (helps during meetings, online etc.)

4. Developer Exp: With TS, Tslint etc, devx is not too bad IMO (and there's no dearth of opinionated articles around on the correct way to do things)

5. Finally - we can quickly churn out prototypes for features to production (but I guess that's more experience than the tools?).

6. In general, we'd be using JS on the frontend anyway (React), so it just made sense to use one language everywhere.

7. In general, most tools have JS SDKs and JS language support is always around (an exception I found was Tensorflow) - as an example, AWS Lambda supports Java, Python and JS.

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

#39

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 po…

> 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.

I love the language, but this is absolutely true.

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

#40
post #25

Earlier quoted context omitted.

So I'm curious as to the reasons people chose Node.js Javascript of course ;) You can leverage the same language for server side stuff and browser programming.

But how valuable is that? I hear this a lot but is it really that much of an inconvenience to write backend code in a different language? Especially if there are different engineers working on the frontend and backend.

Language is never the problem. Languages (mostly) are easy. Frameworks are hard. Tooling can be hard (pick a language).

Javascript is easy. Express, NPM, Bower, are tough.

Post reply on HN