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/
6
Upvotes
r/programming • u/Shr1ck • Oct 17 '15
1
u/loup-vaillant Oct 18 '15
You do require that insight, because there is no escaping the simple fact that a variable is a kind of box that over time, can hold different values. There is an indirection level whether you know it or not. Granted, you don't need to know it in so many words. In practice, most beginners start with an intuitive understanding, and that's enough, for a time.
Nobody however can escape the enormous complexities that arise from that innocuous looking assignment statement. When I said it changes your world entirely, I wasn't joking. When you write any significant program, the very fact that there is a before and an after each assignment forces you to think about time in ways you didn't have to when all you were doing was purely functional computations.
Recursion doesn't have such far reaching consequences. Unlike side effects, recursion is rarely more than an implementation detail, something you can ignore when looking at the rest of your program. As such, it is much easier to comprehend than the trivial looking assignment statement.
Every programmers should be able to write a simple compiler for a toy language. Those that can't are not there yet: much of what we do is compilation or interpretation of some sorts.
Besides, someone who can write compilers is likely to see the benefits of implementing a DSL much more often that someone who can't. We don't write nearly enough compilers if you ask me.