24 ms·
JavaScript is Eating the World
- randallsquared 9y agoVirtually contentless.
- linkmotif 9y agoUncontent
- chickenfries 9y agoLiterally just an excuse for a bunch of people (many of whom don't even write javascript) to rehash the same old complaints about flaws and tradeoffs.
- tjwds 9y agoFor anyone who's searching for more quantitative data, there's always the 2017 Stack Overflow Developer Survey [1] which seems to reflect that js (& node) are still growing. [1] https://insights.stackoverflow.com/survey/2017 https://insights.stackoverflow.com/survey/2017
- jerf 9y agoYes, in a survey that returned that 72.6% of the respondants consider themselves "web developers", it turns out that Javascript usage is going strong. It is the opposite result that would be surprising. Javascript isn't eating the world, it's just escaping from its multi-decade browser-only shackles and spreading its wings, which means JS is moving into some niches it previously had no access to. From 0, there's nowhere to go but up! If you're a primary-JS developer it may feel like suddenly the world is at your command, compared to where you could take your skills before. But it's not eating the world and it's not going to, because there aren't any niches anymore for it to conquer that aren't already colonized by other quite good competition. JS itself is nothing particularly fancy next to Python or Ruby. And there are a lot of very important niches that are simply unavailable to it. If Javascript were something other than a fairly standard dynamic scripting language, it might find itself with some new opportunities. But it's not, and while it was locked in the browser, the other dynamic scripting languages pretty much took over everything that a dynamic scripting language can. I'm sure JS will develop parallels to some of that stuff, it already has, but it isn't going to be growing into uncontested space.
- hood_syntax 9y agoThe 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.
- lunchables 9y agoI 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.
- alayek 9y agoYou should try. I come from a traditional Java shop, and a year ago wouldn't have thought of doing anything serious with Node JS. Today, I do front-end React stuff as well as back-end servers with Node JS. I have been happy with it so far. With some type-system like Flow or TypeScript, you can manage huge projects in Node JS. I happen to like the community, CLI tools written in Node, and the plethora of open source libraries built on top of Node. This also has a downside. Your libraries can get outdated quite fast, you would have to keep up with new language syntaxes etc., and remember which syntax is supported by which version of Node etc. But so far, I think Node is headed in the right direction.
- falcolas 9y agoIt honestly doesn't give me pause, since the impedance mismatch between JavaScript and backend programming is so great. To me, the fact that Node has to add a library with custom semantics just to allow a basic 'open' on a file handle is a huge warning flag to me.
- todd3834 9y agoWhat does it warn you about? Not trolling, honest question.
- drabiega 9y agoNot 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?
- jchw 9y agoNetflix uses Node.JS in the build process for their frontend. They also use React.JS inside of one of their TV applications, using a custom renderer (that isn't backed by HTML.) They are definitely heavy users of JS. When people say they use Node for frontend, it generally means for things like Webpack or Gulp, not something running on the end user's computer.
- bhalp1 9y ago"How Node.js Powers the Many User Interfaces of Netflix" https://thenewstack.io/netflix-uses-node-js-power-user-interface/ https://thenewstack.io/netflix-uses-node-js-power-user-inter...
- dslama 9y agoI 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/ http://samnewman.io/patterns/architectural/bff/
- agilebyte 9y agoNetflix 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 https://github.com/Netflix/falcor 2. https://www.youtube.com/watch?v=WL54eYbTJUw https://www.youtube.com/watch?v=WL54eYbTJUw
- alayek 9y agoOther than their front-end build process, Node is also used in their user-facing servers. Basically, when your Netflix app makes a HTTP request to fetch any data from its backend servers, the request first hits a Node JS server. Something like this: https://medium.com/the-node-js-collection/netflixandchill-how-netflix-scales-with-node-js-and-containers-cf63c0b92e57 https://medium.com/the-node-js-collection/netflixandchill-ho...
- nilved 9y agoWhat a depressing idea. I don't take JavaScript seriously at all.
- alayek 9y agoSorry to say this, but this kind of statements don't really add anything to the discussion. _Only a sith deals in absolutes_. Recently, JavaScript has adopted lot of language feature from C#, Ruby etc., that make it really useful for most common tasks. And the community moves really really fast, hence adoption of new language syntax is quite fast. JavaScript has some killer platforms / apps, that are being used in production by high-traffic companies. You can do cross-platform Desktop app in Electron (Slack, VSCode, Atom etc. are written with this). Front-end build tools are written in Node JS, and they do lot of heavy lifting as well. Babel is a transpiler, Webpack is a bundler. These days, native mobile apps (not hybrid apps) in JS are also gaining traction, via React Native. From open source communities to big behemoths are behind this. I would like to hear what about JS turned you off so much?
- deleted 9y ago[deleted]
- busterarm 9y ago> Recently, JavaScript has adopted lot of language feature from C#, Ruby etc., that make it really useful for most common tasks. And the community moves really really fast, hence adoption of new language syntax is quite fast. I wasn't aware that a platform's ability to move fast was now a feature. Sounds more like a moving target, honestly. I want stable tools that let me do things quickly. In the current JavaScript ecosystem, you have the "do things quickly" part without the stable part. It's really easy to get bogged down in the mud. My guess here is that with the increasing industry tendency to move on every <2 years, everyone is building their shaky house and then getting out before it crumbles with them inside.
- crimsonalucard 9y agoIt's not the technology surrounding the language, it's more of how the core language itself is flawed.
- voidhorse 9y agoI 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 there are negatives to its popularity but I think it has also probably done wonders in terms of lowering the barrier of entry to get into programming. It's honestly a great language to start out with these days imo. It's easy enough to learn the basics (excusing the quirks of the language that do remain), easy to practice it developing whatever project you want to work on, and, even though it has problems of its own, node is a solid and, again, easy to use (I think it might be becoming clear what aspect here I think is key to JS popularity) tooling system for the language. It still has its detractors, but all in all I'd say JS is pretty great. Now, does that mean so many companies should jump to using it right away? No, of course not. But you can see why they are tempted. Because JS code is typically easy to use, comprehend, and manage, and because of its ubiquity it makes sense to use it so that as the composition of a team shifts and changes it's fairly easy to pass work along or pick up where someone else left off.
- sametmax 9y agoTake away the web platform, would you still use JS for anything ?
- overcast 9y agoDoes that really matter? The web is the past, present, and definitely the future. There will be less, and less native apps, and more and more web apps. JS is here to stay, and I'm glad big companies are pouring tons of R&D into making it faster, and easier to use.
- sametmax 9y agoIt does: let's stop saying JS is great and be honest. The web is great. Despite JS.
- phaedryx 9y agoSummary: "Javascript is eating the world because 5 huge companies use NodeJS" Not sure I buy the argument.
- Brockenstein 9y agoJavascript is eating the world because so much stuff runs through the browser these days and javascript is a given to be available. That alone will effectively stop the world from migrating away from JS. More and more people will give NodeJS a whirl, confident at very least that JS isn't going anywhere for quite a long time. It just creates a cycle where you're going to see very little slippage in JS usage and most of the time ever increasing usage. It won't be this way "forever" but we're probably a decade away from peak JS.
- g00gler 9y agoRight. The following could be written as "Netflix uses Node to render React components" which is pretty much a given. > Java still powers the backend of Netflix, but all the stuff that the user sees comes from Node. In addition to Node, Netflix is also using ReactJS in their stack.
- fao_ 9y agoThe 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.
- Sacho 9y agoI tried your code snippet on my inferior Windows OS and inferior IE Edge browser. The tab stopped functioning. I opened a few other tabs and continued to work. Eventually IE showed a notice that the tab had stopped responding - I had the option to close the tab or recover the webpage. I clicked 'recover webpage', the page was refreshed and I could continue using it. Truly, Javascript is eating the world. Or perhaps the language has nothing to do with your problem.
- fao_ 9y agoDo you deny that implementations are part of the language? If the Javascript specification left this out, what other implementation gotchyas exist for them to exploit?
- nerdwaller 9y agoMost 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).
- jchw 9y agoJS 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.
- talmand 9y agoI'm beginning to think npm has joke potential like regex. "I had a problem. I started using regex and now I have two problems." Becomes... "I had a problem. I ran npm install and now I have 21,735 problems."
- falcolas 9y agoIt bothers me that I have to agree with this. I watched an NPM install once, and noticed that one particular library was downloaded and compiled somewhere around 40 times (and each compiled version was different). Think about that for a moment: one library, 40 versions downloaded and compiled to fill NPM dependencies. What if there was a vulnerability in a version of that library - how do I audit that? Can I even fix it myself without hosting my own NPM registry? Bandwidth? Computation costs (a thing again, with cloud computing)? Disk space costs? It makes me glad we just use Docker; so I don't have to try and make sense of the NPM madness from day-to-day. Just Docker's own brand of madness.
- edoceo 9y agoARG! The floating point handling in JS bites (bytes?) me almost daily. I code in JS every day but I hate this number "bug" the most. Having to frob back and forth with "int" to make it not totally broken. Am I the only one?
- frandroid 9y agoCrockford proposes DEC64: http://dec64.com/ http://dec64.com/
- combatentropy 9y agohttps://github.com/MikeMcl/decimal.js-light https://github.com/MikeMcl/decimal.js-light
- onion2k 9y agoWhat you build is infinitely more important than what you built it with. If someone writes a better Google the users won't care if it's using Javascript, Rust, or QBasic. They'd still be all over it.
- tomascot 9y agoI had a client that asked me to rewrite our software in JS. He didnt know anything about programming but said he preferred JS.
- infinisil 9y agoI haven't ever written professional software, but I just took a software engineering course and what I learned is that what technology stack to use is none of the clients business.
- tomascot 9y agoI know. I just wanted to share this because I find it amusing til the moment that client went with another company that had "patent pending tech" and AI, it was sad because I knew the other company was just a couple of guys loading data. I guess the lesson is that sometimes it's hard for people with a technical background to sell because we usually don't "hype" our tech.
- acuozzo 9y ago> what technology stack to use is none of the clients business Until your client is unable to find competent programmers to hire to do maintenance after you're gone because you chose to use something esoteric. A big reason why there are so many JavaJobs™ is that there are so many programmers with Java listed on their résumé/CV. Your client needs to look ahead and plan for the possibility of his/her entire dev team being poached on the same day.
- onion2k 9y agoThat problem has nothing to do with programming languages.
- cdnsteve 9y agoJavaScript has eaten my time. It's a really frustrating ecosystem to work in, all the deps, toolchains, build process is extremely fragile. I'm pushing everything to Python these days and some light front-end in JS where needed. Couldn't be happier!
- jonknee 9y agoThe best part is if you get off the treadmill for any length of time you get to re-learn it all over again with whatever the new hotness is!
- mmirate 9y agoPython is still dynamically typed, though at least it is less weakly-typed than JS. While the benefits of moving any distance away from JS's weak-typing are certainly obvious, why stop at Python rather than a language which is both strongly and statically typed?
- quacker 9y agoThey didn't mention anything about typing as reason for switching. They said "It's a really frustrating ecosystem to work in, all the deps, toolchains, build process is extremely fragile." They switched to python for the ecosystem and tooling.
- always_good 9y agoI don't understand the distinction. JavaScript tooling is notoriously complicated on the front-end, not the back-end. And I doubt they're saying that they switched to Python on the front-end.
- quacker 9y ago> I don't understand the distinction. The distinction was that cdnsteve was motivated to switch to Python due to issues with the toolchain and build system, not that JavaScript was weakly-typed. > JavaScript tooling is notoriously complicated on the front-end, not the back-end. And I doubt they're saying that they switched to Python on the front-end. You have a good point, though you still have to pull in dependencies and deal with NPM when running JS on the server-side (especially if the server is doing non-trivial stuff). Idk, maybe an approach with server-side rendering using Python did away with much of the JS usage which made things nicer.
- fundabulousrIII 9y agoWhat they don't say in this panegyric to node is that.. 1. The language (js) is absolutely horrific. 2. node is single threaded and non-blocking/async in I/O for some operations but when blocking requires libuv and gymnastics. 3. It moves too fast for stability. I've encountered huge memory leaks with node at various versions that are terrible to debug. 4. It is designed to the lowest possible specification for development: web developers. 5. js package mgmt and build tools are a running joke.
- deleted 9y ago[deleted]
- andrewstuart2 9y ago> It is designed to the lowest possible specification for development: web developers. This is not a productive comment.
- fundabulousrIII 9y agoSorry to offend but if you are seriously considering js on the backend then it becomes a valid concern. I don't want a meta-tag junkie with the ability to craft massive markup via whatever interface and IDE deciding what systems behaviors should be. That does _seem_ to be where we are going these days.
- woah 9y agoThere are languages that I like better than JS. However, JS servers power trillions of dollars of business. People who grasp for reasons to hate on JS are a little like people who get into flame wars about video game franchise rivalries. It's symptomatic of deep unmet emotional needs in that person's life.
- fundabulousrIII 9y agoherp-derp.
- lmm 9y ago
- heheocoenev 9y agoWe live in dark times.
- mark024 9y agonpm and the huge number of dependencies scares me, I remember in WordPress plugins would get hijacked and you would get an update that backdoors or inserts some vulnerability, other than this, I spend 3-4 hours 2 days ago, trying to merge 2 json datasets by doing some averages, and simply could not do it, the numbers were in string format, and it would work for some and get NaN for other, or would just concatenate them as string, I was working in typescript and using "number" was concatenating, weirdest thing ever, I just gave up.
- swiley 9y agoI stop reading READMEs as soon as I see npm.
- crimsonalucard 9y agoNode scales well in terms of performance. However does it scale well in terms of code complexity and readability?
- kin 9y agoBecause it's not opinionated, it all depends. IMO the code base where I work is very complex but it's very easy to onboard new engineers with it. This is due in part to enforcing documentation and code style guidelines.
- crimsonalucard 9y agoIs that a good thing? I would argue that enforcing guidelines can make any type of code base workable. The holy grail is a language that enforces guidelines itself, for example: a type system.
- kin 9y agoI think static vs. loosely typed both have their pros and cons but that's the thing that's great about the Javascript community. It's not opinionated on things like this. So if you want statically typed, then you can code in Typescript. This is in contrast to something like Rails which is super opinionated and doesn't give you much of a choice if you as a developer or even as a company as a whole were to disagree with these opinions.
- crimsonalucard 9y agoThis is counter intuitive but choice and freedom are the root of all errors. There is greater power in restriction. The current movement towards functional programming exemplifies this philosophy.
- crimsonalucard 9y agoAlso rails is not a language, it is a framework, aka an opinion. Languages should lean towards being opinion agnostic while frameworks by there very nature should be opinionated.
- krapp 9y agoI feel like it's less Javascript that's eating the world and more Node and NPM. It seems as if it's impossible to publish a Javascript project without taking for granted that the developer has, or even wants, a package manager with dependencies, arbitrary toolchain and transpiler along with it. Maybe I'm just a dinosaur for not wanting my "build process" for javascript to be more complicated than including a script tag. That's probably what it is.
- megamindbrian 9y agoIt gets easier once you get use to it. The output is a plain script tag include. Aot is one of the most amazing things I have seen. I can tell when an app uses it and when it is slow.
- ix-hispana 9y agoDo you mean to tell me my 5000 lines script is no longer acceptable?
- egeozcan 9y agoYou can use unpkg[1] or other similar services to download or even directly embed scripts from npm. Great for testing. [1]: https://unpkg.com https://unpkg.com
- deleted 9y ago
- megamindbrian 9y agoWe should all speak JavaScript.
- adamnemecek 9y agoJavaScript you say? What a fresh opinion. I'm just like wow, the thought leadership of this post is defo palpable.
- rdtsc 9y agoMaybe. Callback / promise hell in a language that needs a book like "Javascript the good parts" is probably not eating the world. Yeah it is cool, npm package system is (was?) one of the easier ones to use. It is a good starter thing for someone who has only learn or done frontend development before. But I have not had a good experience with it on the backend.
- cellis 9y agoAsync/await
- hacker_9 9y agoFunny, a lot of Javascript projects on GIT start off with 'to install using npm, first download <package manager X> because it is easier to use...'. I've got between 5 and 10 on my computer at least.
- flavio81 9y agoThe road to software hell is paved with ease to use.
- rdoherty 9y agoReminds me of a 'future' talk about how JavaScript took over the world as a language even though no one actually programmed in. This was because as long as you could transpile to ASM, you could get native performance via JS. https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death... (Worth watching no matter what your background is, it's funny and informative)
- markbnj 9y agoCertainly eating all my inodes, anyway.
- shados 9y agoThe fact that JavaScript and the web platform kind of sucks while at the same time being "unavoidable" is why it's so good. It forced a lot of very smart people and a lot of eyes onto the platform to try and find solutions within the extremely restrictive "box" to these problems. How do you solve the API issues when you don't control the platform? How do you solve for perf when things can't be installed? How do you solve the API when you can't force people to upgrade? How do you solve the language when you only have one language as a compilation target? Out of these we got React and other vdom style view layers. FP paradigms got into the mainstream. It exposed the mass to newer type system features We got a toolchain that while complex, can do almost anything. We got some test tooling that are ahead of other mainstream languages. And every last bit of these went through tons of iterations (sure, javascript fatigue, whatever), and have had an immense amount of eyes on. You totally can look at any of the things I pointed out and say "Language X did it first!", but no one forced Language X on so many people, while JS was, so these things got a lot more exposure. In short, I love the JS ecosystem precisely because it sucks so much.
- eloff 9y agoI think ES6 javascript is actually a decent language. But the way it's used is terrible. Slow transpilers that give all the disadvantages of a compiled language - but with the type safety of a dynamic language. Asynchronous code that is slightly better with promises and async/await, but horrifying to debug with stacktraces that are often completely useless. NPM with its plethora of low-quality packages - yet it's not uncommon for packages to have hundreds of dependencies. And when you try digging into those packages to understand what they do, because there's no documentation, you find a mess of javascript magic. Globals, nested closures, "coroutines" using yield and function references and a dozen magical libraries that are nearly impossible to untangle. I found the development experience to be slow and extraordinarily painful. I actually find PHP easier to work with (but more soul crushing to write.) I would much rather use Go or C# or C++ or Java (well Kotlin, because I don't like to write Java) the development experience is just so, so much smoother.
- thedonkeycometh 9y agoIs this post art?
- pards 9y agoUsing the same language on both the front-end and back-end is never a good idea. Java Applets, anyone? It may sound appealing to management, but the front-end and back-end are different paradigms requiring different skills and language features.
- YSFEJ4SWJUVU6 9y agoI think it's interesting in its own right to point out that the trendy editors of today implemented in JavaScript are able to edit (and even view) files larger than about a megabyte because they are not any more fully implemented in JavaScript says something – and I'm of course not talking about the framework.
- brandonmenc 9y agoDOS ate the world once too. Worse is better, installed base, etc etc...
- pyrophane 9y agoI think this is more reflective of the shift in how code and development teams are being organized rather than JavaScript "eating the world." Now that many shops have separate back-end and front-end focused teams, a lot of API development is moving to node so that the front-end focused JS developers can maintain the APIs they consume themselves. Also, while languages like Java are very good at helping large teams manage equally large codebases, deploying microserves and organizing code into smaller-more self-contained pieces make it easier to use things like javascript for individual services.
- holydude 9y agoMy personal opinion is that what applies to big companies offering "free" products applies in tech as well.I call it the good enough concept. The product is not exceptional but it is good enough when you consider all things involved (price in case of big companies (it being free) and performance in case of javascript. So for a lot of people web apps are good enough. They do not need native apps. The same applies to developers. Sure you can avoid transpiling to JS but JS also became good enough for people to just stick to it. And while they were at it they found out it is also good enough on the backend (nodejs) and on the mobile (react native) and also on the desktop (electron). Only time will tell if it is or was the right choice.
- adjkant 9y agoWe really need to stop putting Javascript on the back end when there are so many other great options that won't be any different to the front end in most (all?) cases. I think working on full fledged Javascript solutions for the front end that address load time and page size is great. It still amazes me why anyone would use Javascript on the back end willingly.
- pier25 9y agoAnd here I am desperately looking for an alternative to Node.
- thehardsphere 9y agoWhat's wrong with everything that came before it?
- pier25 9y agoPHP, Java, .NET, C++, Ruby, Python? No thanks. I'm looking at Go, Rust, Erlang, and Crystal. Go seems like the best choice so far.
- thehardsphere 9y agoThat's not actually an answer, but OK.
- xkcd-sucks 9y agoWhere "eating" means "turning resources into heat and poop"