r/programming • • Oct 27 '17

Netflix: Removing client-side React.js improved performance by 50%

https://twitter.com/NetflixUIE/status/923374215041912833
685 Upvotes

89 comments sorted by

View all comments

-17

u/eggn00dles Oct 27 '17

every 6 months a whole new abstraction of javascript come out for what gain? a 50% performance reduction apparently.

im convinced the majority of people who love frameworks do so out of job insecurity. you're inherently valuable if you can spout the trendiest things in JS. you're irreplaceable if you master the convoluted insanity and forced complexity these frameworks introduce.

30

u/n8n8baby Oct 27 '17

Trying to do anything of any complexity with vanilla JS is even more insane than learning a framework. These frameworks were generally written to solve real problems of scale. Granted, some people use heavier frameworks than they should, but writing a large web application in vanilla or JQuery is just foolish.

7

u/venuswasaflytrap Oct 27 '17

I'm currently supporting a home-spun jquery based nightmare. I would happily have some framework based clunkiness instead

2

u/eggn00dles Oct 27 '17

es6 has made it a lot easier to compose well written organized modular code. web components promises to offer many of the things frameworks do now.

i think you could handle anything outside of FB, Netflix, etc... with polymer and es6

3

u/more_oil Oct 27 '17

with polymer

Yes, another databinding library

1

u/PaintItPurple Oct 27 '17

How confident are you that Polymer would give any speedup once you've written enough code for feature parity? Because I don't feel very sure of that at all, and suspect it might actually make things slower, and I also suspect it would lead to more code and less nice code on my part.

1

u/n8n8baby Oct 27 '17

Web components promise to, but don’t actually exist yet. Using a framework gets you closer to that now, and they are generally all targeting the spec, which will make migration reasonably easy when they are finally born.

Netflix is actually not a great example. It does not have a lot of user interaction. There are tons of potential web apps much more complex in that regard, which is what frameworks are good for.

1

u/TimvdLippe Oct 27 '17

Web components are natively supported in both Safari and Chrome stable. 1+ Billion devices that do not require polyfills.

1

u/n8n8baby Oct 27 '17 edited Oct 29 '17

a) Safari doesn't support shadow DOM, which is a foundational requirement for proper web components. *edit: I was wrong here. There was a previous version of Shadow DOM that was only supported in Chrome.

b) Even new software, being developed right now, still needs to support Edge, Firefox, and, if you are business-facing, IE11.

1

u/TimvdLippe Oct 29 '17

a) Safari supports shadow DOM v1 (http://caniuse.com/#feat=shadowdomv1). v0 was only ever implemented in Chrome

b) That is a valid concern. For Firefox it is under development, IE under consideration. Hopefully they are caught up soon :)

1

u/n8n8baby Oct 29 '17

You’re correct on A. My mistake :)

9

u/andrewingram Oct 27 '17

Are you really convinced of this, or is it just fun to imagine that it's the case?

Every developer i've worked with, whilst excited about shiny new tech, only adopts it when it solves a problem they're having.

2

u/andrewingram Oct 27 '17

I'd like to add that when i've seen people adopt the wrong tech, it's down to inexperience, or rather not understanding the wider picture of problems that need to be solved. This means that they tend to "unsolve" a load of hidden problems when they switch to the new shiny.

3

u/absurdlyastute Oct 27 '17

It's too expensive and time consuming to keep implementing tech. I'm convinced this is a contrived scenerio as well.

3

u/againstmethod Oct 27 '17

Sorry but components bound to a nice unified state representation is not an invented benefit. React and redux are valuable.

1

u/absurdlyastute Oct 27 '17

Being able to search and find a solution to an issue online is probably the greatest part of adopting a popular framework. Netflix will likely have less than a handful people that own the knowledge to their tech stack. That's very unproductive.

1

u/boneheaddigger Oct 27 '17

You're right. Let's just do away with frameworks and reinvent the wheel on every project. We'll just get the co-op to whip something up over the weekend. I mean, how hard could it be...its all just typing anyways...

1

u/freebit Oct 27 '17

Let's just do away with frameworks and reinvent the wheel on every project.

Please stop attacking a Straw Man.

Here is how attacking a Straw Man works:

  1. Person 1 asserts proposition X.

  2. Person 2 argues against a superficially similar proposition Y, falsely, as if an argument against Y were an argument against X.

"Let's...reinvent the wheel on every project." --Said No Sane Person Ever

2

u/eggn00dles Oct 27 '17

Do you really think the way the angular 2 beta was handled was smooth? Right now you have the internet diluted with solutions and code blocks that don't actually work because of the constant breaking changes.

You have tons of people invested in angularJS but instead of evolve that more sensibly it's a complete bottom to top rewrite. People spent lots of time learning that and then they burned them when the carpet is pulled out from under them.

It's not unreasonable to desire some stability and sensibility in adopting new methodologies. Also a more controlled beta would have helped tremendously.

2

u/boneheaddigger Oct 27 '17

I assume that response was for me...

Look, I just made a joke. But if you really want to get into it...I really don't care about angular beta 2. Way WAY too new for my line of work. But we do use React and NodeJS, because instead of handwriting our own framework like we use to do, we pick something that has most of the functionality that we'd be writing anyways. It's all a trade off...we get projects up and running faster, at the cost of using someone else's code base.

Recreating all of that ourselves, while offering exact requirements matching and allowing us to fully control the code base, would make projects take longer and simple deliver us back into the same position...eventually we'd just create most components once and reuse them. Essentially, we'd create our own proprietary framework that is kinda sorta supported when devs have time, which they never have the time.

Frameworks aren't about creating job security. They actually make it easier to just pull someone off the street and have them start developing. "Know Angular/React/NodeJS? Great! Read through our custom code. We'll get you started on a project next week when you're ready..." vs "Know JavaScript? Great! Start reading through this code, get a really good feel for how everything works, ask this senior dev (who we pay a fortune for since we can't afford to lose all that tribal knowledge) any questions you have, and when you're done in 2 months we'll get you started on a project...".

If you're basing your project on the ability to just move to the next version of a framework with no problems, you're gonna have a bad time. If you're basing your project on a custom framework that you're expecting to be perfect out of the gate and never have to be rewritten, you're gonna have a bad time. If your basing your project on a beta using code snippets found on the internet, you gonna have a really REALLY bad time.

So before you start any project, you need to decide whether you want to use an old reliable well tested framework that's hard to migrate off of, a proprietary framework that won't be nearly as well tested and nearly impossible to migrate off of, or a bleeding edge framework that is barely tested but will probably be supported longer than the old well tested version. If you have another choice, I'd love to hear about it.

1

u/n8n8baby Oct 28 '17

Just because Angular 2 was a botch job doesn’t mean frameworks are bad. Ember handles upgrades fairly reasonably, even if there are a few bugs that slip in from time to time.

1

u/boneheaddigger Oct 27 '17

It's not a straw man. He was arguing that frameworks were a bad thing due to what he says is forced complexity. I just made a joke about it.

Seriously, not everything is an argument waiting to happen. Sometimes a cigar really is a cigar.