6 ms·
I had the exact opposite experience. I mean, first of all, people using "VanillaJS" get the DOM manipulation wrong a lot more often. And then I do hope you don'
by bayesian_horse 4y ago
I had the exact opposite experience. I mean, first of all, people using "VanillaJS" get the DOM manipulation wrong a lot more often. And then I do hope you don't conflate code size with complexity, because of course, direct DOM manipulation takes one heck of a lot more code (unless you create and maintain your own bespoke framework creating your own headaches). You are basically contradicting the whole reason Facebook, a pretty big and quite smart company, started React in the first place.
You also don't seem to understand what "rerendering" means. And that is often a problem in terms of performance. A React component only executes to determine if things have to be changed in the DOM. Not understanding this is creates a lot of pain.
- satvikpendem 4y agoAs well, people don't understand that React is an idempotent rendering framework. It's easy to reason about because of the same reason why functional languages are easy to reason about, it does not mutate but instead creates new copies.
- rcme 4y agoThis is a discussion about perf. Creating new copies is part of what makes it slow.
- satvikpendem 4y agoThe point is the same as functional languages, making immutable copies is what makes it easy to reason about, where reactive changes don't. There are ways to make VDOMs fast too, faster than reactive frameworks.
- bayesian_horse 4y agoUnderstanding that part means you know where to use memoization to speed up what needs to speeding up. Which isn't that much, usually.
- deleted 4y ago[deleted]
- rcme 4y agoAs I said, this project was about as complex as Figma: a feature rich collaborative editor. This designation has nothing to do with code size. Go hook up the React dev tools to Reddit and look how much each component renders. You see that components are constantly rendering even though nothing apparent has changed. I get that ideally React would only re-render when something has changed, but clearly it’s easy to create situations where react thinks something has changed even if it hasn’t. Another good example is the Facebook website itself. It’s just so slow. I get saying Reddit developers suck, but I don’t think you can say the same about FB developers given that FB made React. React is popular because it’s a good developer experience. It’s not the best choice if you want optimal performance.
- bayesian_horse 4y agoI have a hard time assuming you are not confusing network delays with rendering speed...
- rcme 4y agoYes, that seems to be a common theme: you have a hard time believing anything that doesn’t fit with your preconceived notions. Again, connect React dev tools to Reddit yourself. Given that you’ve been given a concrete example of a slow website, I have a hard time believing you can even differentiate a performant website from a slow one.