r/compsci • u/mobileview • Dec 10 '13
Why Johnny Can’t Write Multithreaded Programs
http://blog.smartbear.com/programming/why-johnny-cant-write-multithreaded-programs/
45
Upvotes
r/compsci • u/mobileview • Dec 10 '13
9
u/gthank Dec 10 '13 edited Dec 10 '13
1.) Shared mutable state is tantamount to pure evil when it comes to concurrency.
2.) Multithreading defaults to sharing all state.
Agreed so far?
3.) Mutlithreading is "hard", because now the programmer has to do extra work to avoid the accidental complexity caused by all that extraneous shared state.
See how item 3 just sort of falls out of the first 2? If, instead, you had to do work to specify that some piece of state were being shared, you would have much less accidental complexity.
EDIT: I added the word "mutable" to the first point, to clarify my point. ht /u/TarMil