Hacker News new | past | comments | ask | show | jobs | submit login

Do I need to save their return values to avoid calling them too many times? Am I reusing a stale value where I should have called it again, and how should I know that without calling too many times? Do these hidden states need to be visible across multiple cores, and if so how do I do that without imposing a memory fence and a pipeline stall on every call? How does every unit test rewind all these hidden states back to their initial values, so they don't pollute each others' results? This change should be large and even painful, because you're inherently making the program harder to reason about and probably breaking a lot of code without knowing it.



Yikes! This might be an ill-defined problem in some cases -- optimization based on referential transparency in the original functions means that you may not really know how many times these functions were called. Either you have that problem, or the functions were already stateful.




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

Search: