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

For prototyping and simple things, instead of mirroring my state in the DOM, I use the DOM to store state. Yes, it isn't quite as performant, but for this sort of work that doesn't usually matter.


> For prototyping and simple things, instead of mirroring my state in the DOM, I use the DOM to store state.

I find it funny that people think mirroring the DOM will magically make your web app performant. I've visited plenty of React sites that are sluggish, bloated, load slowly and a pain to use. I've also visited plenty of plain ol' HTML/CSS/JS sites that are snappy, load quickly, and fast enough. No framework or clever algorithm will save you from crappy code ;)


I don't think it will magically make your code performant, but I've written things where using the DOM for state was pretty painfully inefficient. For example, multiple queries over a large amount of data where data is only represented as DOM notes. When working on small things and prototypes, though, this has been the exception, and I'm happy to mostly just use the DOM.




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

Search: