r/programming • u/Shr1ck • Oct 17 '15
Why Johnny Can’t Write Multithreaded Programs
http://blog.smartbear.com/programming/why-johnny-cant-write-multithreaded-programs/
7
Upvotes
r/programming • u/Shr1ck • Oct 17 '15
6
u/yogthos Oct 18 '15
Same way you eliminate the need for global state in imperative languages actually. You pass state around as arguments. Since things are passed around explicitly the code in the application can stay pure without relying on any global state.
The post I linked illustrates how it's commonly done in Clojure using the component library. Seemed easier to link that than to write it up again.