Live data from Hacker News

JavaScript is Eating the World

dev.to

11–20 of 323 posts

Re: JavaScript is Eating the World

#11
post #5

Not sure I understand the usage attributed to Netflix? Sounds like the writer is saying that front end is node, but that can't be right? Can someone who knows what they're using node for go into a little more detail?

I believe the author is referring to using node.js for the backend part in the backend for frontend pattern => http://samnewman.io/patterns/architectural/bff/

Re: JavaScript is Eating the World

#12
post #5

Not sure I understand the usage attributed to Netflix? Sounds like the writer is saying that front end is node, but that can't be right? Can someone who knows what they're using node for go into a little more detail?

Netflix is behind and uses Falcor(1) for data fetching as an alternative to REST. The backend for this is in Nodejs(2). (There could be other backends in Java too though)

1. https://github.com/Netflix/falcor 2. https://www.youtube.com/watch?v=WL54eYbTJUw

Re: JavaScript is Eating the World

#14

The more time goes by the more I feel crazy for missing whatever would motivate people to use js for anything more than is strictly necessary. Single threaded server??? I mean come on man, I understand you don't need parallelism for a lot of use cases but even if that fits your situation why javascript? It can't be that hard using a different language. I refuse to believe that.

I just tell myself it's because the sales pitch is so appealing: learn, and use, one programming language on the front end and back end of your web site.

I've never written anything on node.js, but that's the only argument that's ever given me pause.

Re: JavaScript is Eating the World

#15

The more time goes by the more I feel crazy for missing whatever would motivate people to use js for anything more than is strictly necessary. Single threaded server??? I mean come on man, I understand you don't need parallelism for a lot of use cases but even if that fits your situation why javascript? It can't be that hard using a different language. I refuse to believe that.

Javascript as a language and ecosystem has evolved quite dramatically during the last years. Its not perfect though: it lacks features and ecosystem is still not in the level of maturity of other platforms, but is definitely going in the right direction. Regarding the single threaded server, its an architecture used before JS exists, and used by many other platforms/systems. Just to give you an example, Nginx workers are single threaded.

Re: JavaScript is Eating the World

#16

I think a few aspects of the language contribute to this: 1. It is relatively easy to comprehend and pick up and play around with. 2. With the advent of node.js, and later electron, it is incredibly relevant whether you're developing web apps, servers, or now, even desktop apps. 3. Some of the newer features, such as arrow functions actually make writing javascript a lot of fun! JS has come a long way. I do think the…

Take away the web platform, would you still use JS for anything ?

Re: JavaScript is Eating the World

#17
The other day I managed to freeze my computer -- such that I did not even have access to the SysReq key, by stupidly running

  while (true) { var d = new Date; e.textContent = d.toLocaleString(); }
I immediately realised my stupidity, and closed the tab. Shortly after, my mouse froze up, then my keyboard access, and eventually my entire access. Rather than just freezing Xorg as I had initially suspected, it froze my entire computer access. No SysReq, no switching to a tty, nothing.

I was an idiot, but at the same time, an unprivileged process should not be able to consume resources like that without a dæmon coming in and pausing/killing it. And the Javascript should not have been allowed to execute once I had closed the window.

Truly, Javascript is eating the world.

Re: JavaScript is Eating the World

#18

The more time goes by the more I feel crazy for missing whatever would motivate people to use js for anything more than is strictly necessary. Single threaded server??? I mean come on man, I understand you don't need parallelism for a lot of use cases but even if that fits your situation why javascript? It can't be that hard using a different language. I refuse to believe that.

Exactly. We got cancer on one major organ, why spread it ?

Re: JavaScript is Eating the World

#19
Most of these examples aren't "moving off Java to Node" as the post tries to conclude, it's simply breaking out the view layer to "a right" tool for views. If anything, it's simply adding a supplement to existing systems.

In many large orgs devs still use a homogenous tool for the existing systems (e.g. my guess is at Netflix all new business logic services are still Java based to plug into the Spring+NetflixOSS stack).

Re: JavaScript is Eating the World

#20
JS has the appeal that it's something a lot of people already have good amounts of experience with. And ES2015+ features add to the learning curve, but also give some much needed aid to existing problems; it's easy to pick up on async/await when you already know how promises work.

Meanwhile, trying to find Go developers can be a challenge. And the learning curve is low, but there's plenty of low-level gotchas like dealing with concurrency and memory usage. (Yes, even in a garbage collected language, this manages to be a problem.)

In Node, you run into less issues because if you have a problem to solve you just npm install something.

That being said, my enthusiasm ends there. Every experience I have with trying to tie a database into Node has been horrible. Also, I think event loop based programming is missing the mark even if it beats out previous methods; I think Go and other CSP based languages like Erlang have the real right answer. I think if we really start seeing huge core counts, it will become apparent that a single thread event loop eventually starts to become a bottleneck. Also, NPM has an insane number of packages, but the quality is extremely variable - much more than PyPI, though I'm not saying everything on PyPI is magically production ready.

I guess what I'm saying is, maybe I should start learning Rust.

Post reply on HN