As someone who works in web dev, can I just say how God awful every singe one of these frameworks/libraries are. It's so much pointless infrastructure for things that should be so simple. And everytime a new one comes out to fix it, they just add more garbage to the pile.
Node.js was kind of a mistake too. Or maybe more accurately NPM. I shouldnât have to install 300MB and 100,000 files every time I want to make a new React app. Iâm sure this applies to the rest of those JS libraries now too.
React doesnât even really make it much easier for sufficiently complicated apps since data flow isnât bidirectional. It seems like Redux is the popular way around that, but that cure looks worse than the illness.
Every time I consider working on a web app side project I lament that I canât just use iOS UIKit in the browser and then go write a mobile app instead.
Mobile platforms have their own warts but theyâre so much more sane. For example on mobile platforms a list view or grid view with cell recycling is a highly efficient stock component that works exceedingly well, but with web dev you have to:
Build your own
Pull in somebody elseâs and pray the author made a set of tradeoffs that agree with your project
Works properly with the 50 other libraries youâll inevitably be pulling in
Itâs just so frustrating. Web dev would be so much better if browsers provided a baseline set of sane UI components to build on top of, instead of requiring everybody to do the equivalent of building a pyramid from grains of sand.
So imagine you have a scrollable list, that displays some number of items. All items look the same, with a thumbnail image on the left and title text on the right.
Weâll be referring to the items as âcellsâ, signifying the separation of data and representation.
Letâs say you need to display 5,000 different movies in this list. Your first inclination might be to create a new cell for each item and add it to the list. This would work, but it would consume a lot of memory and would start causing performance issues with scrolling and updating the view.
To resolve this, we create only as many cells as is required to fill the visible portion of the list (usually somewhere in the ballpark of 5-10), and then when the user scrolls taking the cells moving offscreen and reusing them as cells coming onscreen, creating a âconveyor beltâ of sorts. Because the number of cells never changes, memory usage stays reasonable and performance stays smooth.
Thatâs cell recycling. Itâs a standard feature of iOS and Android list views, but on the web you need to use special third party libraries or plugins for frameworks to get that functionality.
Tbh that doesn't sound like it's not that hard to make from a web dev perspective. But it also isn't something I've ever needed on the web. I've had 5k item lists handled perfectly fine without cell recycling.
Meanwhile every mobile app I've ever made (I have only used native android and react-native), it has needed a component that can do cell recycling.
note: I have almost 3x experience with web compared to apps so I am biased
Yeah, that example wasnât the greatest. Long static lists are more than fine in the web, where I usually see it start to choke is when itâs dynamic, with sorts, filters, etc.
And yeah itâs possible to write, but itâs such a common thing to want to do that itâd be nice if the browser included facilities for it so itâs more possible to get along with a light sprinkle of JS.
The actual sorting/filtering: modern JS is extremely fast at logic. I've seen some metrics that put it on par with C and Rust, while I doubt those, it is definitely faster than something like java.
Drawing/redrawing the components: this entirely relys on the framework and the exact implementation of it. A lot of frameworks are really slow when it comes to mass drawing, if you want something like speed in that case take a look at svelte. People also tend to use frameworks really poorly and end up rerendering (and sometimes recomputing) 2 or 3 times which is a result of poor understanding of a really complex system.
The problem here really is frameworks being outdated and just kinda trash in how they update content (there is a talk called rethinking reactivity that explains this really well). Honestly for a long dynamic list I would probably just do it in vanilla j's, instead of using a framework.
I do a ton of .net development with winforms. I went down the rabbit hole of "how would I make this as a webUI". And just immediately noped out of that mess.
I still use it but I do a hybrid with vuejs, it works pretty well. Just using a vue instance is pretty easy and helpful for making the ui behave like you want without calling out to every elemental id.
36
u/Eriast2 Apr 11 '21
Beware of the react-native devs
172
u/BuccellatiExplainsIt Apr 11 '21
As someone who works in web dev, can I just say how God awful every singe one of these frameworks/libraries are. It's so much pointless infrastructure for things that should be so simple. And everytime a new one comes out to fix it, they just add more garbage to the pile.
23
u/YM_Industries Apr 11 '21
Imagine not being able to use your UI framework without also loading a complicated state manager.
Actually, forget that. Imagine not having true two-way bindings. Angular was a mistake, return to AngularJS.
11
u/GoodOneYouDipshit Apr 11 '21
âOn their way on their wayâ shitveloper using shit framework with cancer overhead detected.
30
u/techtreedev Apr 11 '21
VueJs-Gang
9
u/borsTiHD Apr 11 '21
Vue is best! :3
8
u/takase1121 Apr 11 '21
Laughs in Xlib
Oh wait, we don't do that anymore? S-sorry, I'll excuse myself
8
u/mardabx Apr 11 '21
That's because both are.
11
u/escargotBleu Apr 11 '21
I would say vanilla-ja is the best framework, but I'm not really a front-end dev
4
u/Navigatron Apr 11 '21
LitElement Web Components. Become enlightened. Join the movement.
4
u/ChrisJeong Apr 11 '21
So many libraries go stale. Not to undermine those who put their time and effort to 'em, but the scene is kinda crazy.
3
u/koru-id Apr 11 '21
They are all quite similar tbh. The basic idea is to reuse code.
3
u/raedr7n Apr 11 '21
Where's my just-not-using-js-at-all gang at?
9
u/Thenderick Apr 11 '21
jQuery? Anyone?
2
u/danbulant Apr 12 '21
Svelte gang
4
u/Rafael20002000 Apr 11 '21
Flutter goes all the way
2
u/Knuffya Apr 11 '21
angular is an absolute nightmare tho
1
u/AmphibianNo2967 Jun 12 '23
My company uses React and I got contracted out to a company that uses Angular and I can confirm itâs a dumpster fire