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

If your program has state, it doesn't matter if it's mutable or immutable state, you will still run into the same problems when working with concurrency. You either have to use locks, make sure functions are executed in the right order, or the preferred way: designate/central state.

So functions vs object orientated is mostly a matter of preference.

One advantage with functional programming though, is that it will be much easier so serialize the state.



> If your program has state, it doesn't matter if it's mutable or immutable state, you will still run into the same problems when working with concurrency. You either have to use locks, make sure functions are executed in the right order, or the preferred way: designate/central state.

What about using STM:

https://www.fpcomplete.com/school/advanced-haskell/beautiful...


I respectfully disagree. I also encourage you to take a look at http://clojure.org/state




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

Search: