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

Why do you need to keep state here? I can see calculating the prices dynamicly, but why save and the reuse the result?


They could be using some node.js framework they don't understand that is silently persisting data.


Especially if they are using isomorphic JS. Globals / singletons are very dangerous when the JS runs on both the server and client.


* Pull data from API for pricing, later add caching

* Modify value to give local amount, not realising it's modifying a cached value

* Never test refreshing doesn't change the price


Caching.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: