4 ms·
FTA: "Signs that you shouldn't be a programmer 1. Inability to determine the order of program execution Symptoms a = 5 b = 10 a = b print a You look at the
by aschobel 17y ago
FTA: "Signs that you shouldn't be a programmer
1. Inability to determine the order of program execution
Symptoms
a = 5
b = 10
a = b
print a
You look at the code above and aren't sure what number gets printed out at the end"
The answer is not always obvious. If the above code were in Java and print a was running in a different thread then it very well print 0, since a or b could be 0. JMM can really bite you if you don't understand within-thread as-if-serial semantics.
- olliesaunders 17y agoThat's a pretty extreme case don't you think? You're certainly playing devil's advocate here. We all know what the author meant by this.