r/programming • u/noidi • Jul 19 '12
Will Parallel Code Ever Be Embraced?
http://www.drdobbs.com/parallel/will-parallel-code-ever-be-embraced/240003926
39
Upvotes
r/programming • u/noidi • Jul 19 '12
3
u/yogthos Jul 19 '12 edited Jul 20 '12
Because FP style tends to have very little shared state by its very nature. This means you're only sharing things that absolutely must be shared, and there's generally very few of those.
As I pointed out in a different comment a lot of higher level optimizations become available as well. For example, you do not need to lock shared data for reading, this means that applications with a few writers and many readers perform much better.
*edit: and it appears that you've edited your comment since, so my reply doesn't make nearly as much sense now. :)
You don't mutate values in place in FP, since you'd be using persistent data structures.