Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, immutability is a requirement. And if you think that's a "special style of coding" then you probably haven't run into situations where that is a necessity, like optimistic updates with rollback, or undo/redo systems.

Mutable code is code that destroys the paper trail of what happened.

>The point of UI framework is to do the optimization for me

No, the point of the UI framework is to allow you to build applications that work correctly and perform well. The React style of coding is designed to scale up to large applications of e.g. a Figma or Excel caliber, while eliminating entire categories of subtle bugs. If you've never coded something like that, React will seem like it is getting in your way.

>Also if "memo" optimization is that good why does one have to add it manually?

Because the compute vs memory trade-off isn't always free, especially in a world where CPU computations are much faster than accessing uncached memory.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: