Just Fucking Use React
41–48 of 48 posts
Re: Just Fucking Use React
#42it would be pleasing to read if you remove those cuss words.
Re: Just Fucking Use React
#43Why not Vue? Unlike React it doesn't recalculate everything on every mouse move event. Also I would like something that doesn't require to install Node.JS and unly packer like Webpack which invents its proprietary syntax instead of using standard EcmaScript. I like to make small apps that I run by clicking on HTML file and I don't have time to go to console and install things or type commands just to open a webpage.
Huh? People are still using Webpack?
Re: Just Fucking Use React
#44"sometimes, complexity is not a choice, it's a fucking requirement." Complexity is never a requirement, and almost always self-inflicted.
Re: Just Fucking Use React
#45Earlier quoted context omitted.
React can be very performant with little optimization if you apply FP principals to it, which makes sense since it was built with the goal of using FP to do frontend work. If your whole tree is recalculating on every mousemove event, that is a giant code smell to say the least. You’d have to architect the app to work that way.
FP principle is that functions are first-class objects and one can pass a function to a function. I don't see how it helps programming the UI. Maybe you meant using immutable data structures? I mentioned that and noted that they have their own issues and generally are a pain to use. > If your whole tree is recalculating on every mousemove event If you update a variable in the root component, that will happen. Am I wr…
Composition, my friend. That’s the key. If your whole tree is rerendering whenever your state changes, it’s a failure to compose your components properly.
FP includes strategies for limiting side effects, relying on architectural patterns that push side effects to the edges of your application. This is a very sane way of working in react.
And a lot of prop drilling can be reduced by passing down closure functions with curried values in them.
Re: Just Fucking Use React
#46Earlier quoted context omitted.
This is the virtual DOM mental model of react, and it is pretty much entirely wrong. - React doesn't really distinguish between DOM components and your own components in how it evaluates. It's all part of the same "VDOM" tree. Creating and updating HTML tags doesn't flow differently from updating the props on your own components. - React does sparse updates, starting at the topmost component(s) whose state changed. F…
> If a component is memoized with `memo(...)`, then a re-render will be stopped if it has the same props as before This works only with immutable data structures. Am I wrong? Because a modified array will pass the identity test (=== operator). If you are using mutable data structures, you cannot use identity operator to detect changes. Also if "memo" optimization is that good why does one have to add it manually? > I…
Re: Just Fucking Use React
#47So, I should just use vanilla JavaScript? Well if you say so.
Actually data-binding UIs (UIs that automatically update themselves when model variable changes) allow to do more in less time. So you just spend more time to reach the same result. For example, I don't want to use non-reactive UIs (like vanilla JS or GTK) anymore. And it's sad to see that many (or maybe even most of) open-source projects still manually write code to update the UI and lose time on this. It's like try…
Re: Just Fucking Use React
#48FUCK YOU I WON'T DO WHAT YOU TELL ME