5 ms·
Web development is going to come full circle once everyone comes to terms with the fact that web development has been overcomplicated and you don't need 1000 pa
by 10xDev 3y ago
Web development is going to come full circle once everyone comes to terms with the fact that web development has been overcomplicated and you don't need 1000 packages and abstractions on top of abstractions just to interact with some DOM elements.
- onion2k 3y agoyou don't need 1000 packages and abstractions on top of abstractions just to interact with some DOM elements I don't think many developers believe that you do. Most of the complexity around 'modern web dev' isn't about achieving the basics of moving DOM nodes around. If that's what you're doing then it's hard to argue that a framework adds much benefit. Frameworks bring two benefits: Firstly, they push you down a specific path around the shape of the code. When you're on a team of 20 working on part of an app that shares data across n other components then you need something to keep the code from turning into a swamp. Frameworks bring that experience. You don't need it on a small app or if you're a lone dev, but even then it kind of helps if you're not especially disciplined. If you want an example, have a look at some of the demos from the react-three-fiber team. It's so much nicer to work with a declarative API than imperative vanilla Three.js code. Secondly, frameworks used well enable you to eek out additional perf. Building an app that renders a complex page in under 16ms isn't that easy if there's a lot going on, and leaning on a scheduler like the one in React makes it simpler. It's still far too easy to get it wrong and kill all your perf even in a framework though.
- smarkov 3y ago> Building an app that renders a complex page in under 16ms isn't that easy if there's a lot going on We struggle to render a few boxes and some text under 16ms while games with vastly more complex sound, network, physics, UI and whatever else systems render frames in < 8ms at 4k.
- onion2k 3y agoWe struggle to render a few boxes and some text under 16ms Only if a dev has screwed up. Most simple sites are fine. You have to push the DOM quite hard for the browser to be the bottleneck. I've worked on apps that have DOM trees with 60,000+ nodes that remain under 16ms (because very few were actually changing at any given time..) games with vastly more complex sound, network, physics, UI and whatever else systems render frames in < 8ms at 4k The Servo project is bringing a lot of what makes game UIs fast to browsers. It's a massive shame that it's not a Mozilla/Firefox backed idea any more but it's still going. Hopefully it'll get a bit more mainstream one day.
- smarkov 3y ago> Only if a dev has screwed up. Most simple sites are fine. You have to push the DOM quite hard for the browser to be the bottleneck. I've worked on apps that have DOM trees with 60,000+ nodes that remain under 16ms (because very few were actually changing at any given time..) You mentioned that frameworks like React make it simpler to get better performance but based on my observations it's quite the opposite and React is often a double barreled gun where one of the barrels is constantly pointing at your feet. With vanilla JS (not the one from this post) you have to put effort to get everything to update properly. With React you put effort to get the least amount of things to update. It's not even about DOM size but about managing state and how much code gets run on state change. To give you an example - Reddit is a simple website. You have a list of posts which are either text, image, or a video and each of them has comments. Absolutely nothing complicated about that, yet the performance on their React frontend, even with all analytics JS and ads blocked, is horrendous. You would assume that at Reddit's scale they'd be able to hire competent React developers.
- onion2k 3y agoFWIW the app that pushed 60,000 DOM nodes around at 60fps was entirely in React. I keep seeing an advert for a Principle Frontend Dev at Reddit on LinkedIn. Maybe I should apply...
- purerandomness 3y agoAlready happening, see the current popularity of htmx [1] [1] https://htmx.org/examples/infinite-scroll/ https://htmx.org/examples/infinite-scroll/
- giancarlostoro 3y agoThe day they make native web components as useful as using Vue or React without needing a single third party library, that is when this might happen. Until then, I dont think its happening any time soon.
- zamalek 3y agoBut that's only because the frameworks guided the direction of the specifications. You couldn't use vanilla in this way 10 years ago.