4 ms·
State is not the enemy. Encapsulated and managed state is just fine.
by ibash 2y ago
State is not the enemy.
Encapsulated and managed state is just fine.
- mrkeen 2y agoYeah but they're a statistical anomaly in the field. For every example of encapsulated state, there's probably 9 more examples of global state which is called encapsulated. And what is managed state? I can think of two examples that can effectively manage it - software transactional memory, and a good rdbms with the isolation level turned way up.
- z3t4 2y agoIt's not that easy, say for example if a over excited user clicks the purchase button 20 times, ending up in 20 simultaneous orders. What is the best way to handle it? Should the user get 20 orders shipped to him, or only one? And should the user get a message that says "order already processed" or "order processed successfully"? You can have a system that works correctly 99% of the time. The devil is in the 1% of time when things go wrong.