Live data from Hacker News

Gotchas from Two Years with Node

segment.com

51–60 of 125 posts

Re: Gotchas from Two Years with Node

#51
post #10

The switch from Node to Go seems quite popular right now and it honestly makes me thing there's something wrong with the general perception of Node. We are currently in a world where we have a huge amount of traffic on almost every web app with just a discrete success, but we still make the mistake to pick a technology that seems "good enough", instead to pick a "great one" because looks slightly harder to manage/lea…

> The switch from Node to Go seems quite popular right now TJ Holowaychuk desertion was a strong hit on Node troops' morale. https://news.ycombinator.com/item?id=7987146

When I read your post I thought "What? I'm using Koa right now and it's maintained by TJ" but the post says it's the only one haha.

Did anything of this change after IO.js was forked?

Re: Gotchas from Two Years with Node

#53

> Plenty of times, there will be an uncaught exception which–through no fault of your own–bubbles up and kills the whole process. Really? I'm just a beginner with node.js, and I've been deeply frustrated by error handling, but if this is true, that's pretty damning. In just about every other web framework under the sun, you can go wild with exceptions and the worst you'll get is a 500 response for that request. (Yes,…

Same happens with Java, C++, and many other languages. There are web server packages on node that do catch errors that happen in synchronous code. For async, you can use promises, which take errors into consideration. I'm not sure what happens on unhandled async errors on other languages, I guess in Java you could have a dangling request (happened to me before) or it could crash the app (also happened to me before).…

promises makes async error handling easier but it does not solve it yet. It is very easy to miss an error handling and end up with errors that goes to /dev/null leaving you with no trace of what happened. When the tools and the language evolve it will hopefully work better.

Re: Gotchas from Two Years with Node

#55

The root of the eventloop issue is not Node-specific. The real underlying issue here is that one CPU core is given too much work while others are more or less idle. Offloading some of the work to another process naturally solves this issue - It doesn't really matter that this other process is a Go program or a Node.js one - Both approaches would have solved the problem. Attributing credit to Go itself for solving the…

> If you ran Go as a single thread, you would also run into similar issues. Yes, if you hobbled yourself, you would be hobbled. The inability to do concurrency properly is not a feature, it's a missing feature. The whole point of node was to be a node .

I'm also unsure about this comment. It reads to me as "The main advantage of Go is.. that it makes it really easy to not have this problem." The OP talks about single core being an issue. It is not for Go due to the cooperative goroutine scheduling and function call pre-empting. You can still shoot yourself in the foot, but it's really easy to create an escape hatch by just making a function call or occasionally yielding to the scheduler...

Re: Gotchas from Two Years with Node

#56
post #41
post #32

Earlier quoted context omitted.

> It's surprising that Node.js is still outpacing Go in popularity in spite of all this slander. From the perspective of a JVM/.NET/C++ developer I find surprising that Node.js got adopted at all in the server space.

why? PHP/ruby/python are successful too in the server space. Javascript,especially ES6, isn't worse than the formers. Devs should know by now that the dumbest tool that is good enough has good chances of being successful today. All these tech won't replace enterprise techs, but enterprise dev is a tiny percentage of all devs outthere.

> PHP/ruby/python are successful too in the server space.

Again, from the perspective of someone that worked in a startup using TCL for server applications, I also don't get it.

Other than being attractive to developers without formal education, and after a certain scale it becomes too costly to re-write.

The work we developed at that company teached me never to use a technology stack without a JIT or AOT compiler for production code.

The amount of money that Facebook has poured into PHP AOT compiler and now JIT is a proof of it, because it is just cheaper to improve the stack than re-write the code.

Re: Gotchas from Two Years with Node

#57
post #6

Just curious though, I have seem quite a number of posts in the past year mentioned the switch from Node to Go, is there a pattern here?Why Go in particular?

because you can be productive in go in a couple weeks, whereas you will have spend a couple months w/ java/scala/erlang before you are productive.

Re: Gotchas from Two Years with Node

#58

The root of the eventloop issue is not Node-specific. The real underlying issue here is that one CPU core is given too much work while others are more or less idle. Offloading some of the work to another process naturally solves this issue - It doesn't really matter that this other process is a Go program or a Node.js one - Both approaches would have solved the problem. Attributing credit to Go itself for solving the…

> Most of the Node.js vs Go arguments are weak. It's surprising that Node.js is still outpacing Go in popularity in spite of all this slander. Thats a rather defensive position for node in what is a very rare use case for the language. It's unsurprising Node.js is still outpacing Go, given the large number of JS developers and the fact that Go is pretty much worthless for hosting front end web applications (you won't…

[deleted]

Re: Gotchas from Two Years with Node

#59
post #41
post #32

Earlier quoted context omitted.

> It's surprising that Node.js is still outpacing Go in popularity in spite of all this slander. From the perspective of a JVM/.NET/C++ developer I find surprising that Node.js got adopted at all in the server space.

why? PHP/ruby/python are successful too in the server space. Javascript,especially ES6, isn't worse than the formers. Devs should know by now that the dumbest tool that is good enough has good chances of being successful today. All these tech won't replace enterprise techs, but enterprise dev is a tiny percentage of all devs outthere.

>enterprise dev is a tiny percentage of all devs outthere

I don't have specifics to quote but enterprise dev is definitely not a "tiny" percentage

Re: Gotchas from Two Years with Node

#60
post #41
post #32

Earlier quoted context omitted.

> It's surprising that Node.js is still outpacing Go in popularity in spite of all this slander. From the perspective of a JVM/.NET/C++ developer I find surprising that Node.js got adopted at all in the server space.

why? PHP/ruby/python are successful too in the server space. Javascript,especially ES6, isn't worse than the formers. Devs should know by now that the dumbest tool that is good enough has good chances of being successful today. All these tech won't replace enterprise techs, but enterprise dev is a tiny percentage of all devs outthere.

"...enterprise dev is a tiny percentage of all devs outthere."

I may be terribly confused here, but I'm pretty sure this is the precise opposite of the facts. In terms of jobs, all the OSS languages TOGETHER are not as popular as Java alone, never mind adding in C#/.NET. It's a common misunderstanding, but one that seems unlikely to do a young coder any good...

Post reply on HN