3 ms·
>However, we had a long discussion with one programmer who insisted it was a bad idea because of "premature optimization", the fact that React docs does not hav
by 000ooo000 2y ago
>However, we had a long discussion with one programmer who insisted it was a bad idea because of "premature optimization", the fact that React docs does not have recommendations about it, and "nobody does it that way". In my opinion, this was a clear case of a programmer resisting the system approach because he wanted to spend time fixing the same problems over and over and pretend to be working hard.
This article and advice is awful. The fact that the author ignores completely reasonable arguments made by the dissenting programmer, instead attributing their 'resistance' to some dubious, made-up notion that they would prefer to do meaningless rework, speaks volumes.
- grncdr 2y agoI think it’s worth also quoting the rule that the dissenting programmer objected to. > One of the solutions was to introduce a rule to memoize everything returned by hooks, to automatically prevent future problems with memoization. … which introduces a systemic performance penalty to prevent outlier performance problems. The article argues against “heroes”, but I think the more appropriate term is “experts”.
- dave1999x 2y agoIndeed, Dan Abramov is pretty expert at React and he has a compelling article which advises against memoize everything. Before you memo https://overreacted.io/before-you-memo/ https://overreacted.io/before-you-memo/
- sa46 2y agoReact will soon do it that way. React 19 will introduce a compiler that automatically memoizes all components and hooks.