3 ms·
I think his point is that the code is written differently than it would be written in practice solely to make a pedagogical point. Tutorial code should exemplif
by billjings 15y ago
I think his point is that the code is written differently than it would be written in practice solely to make a pedagogical point. Tutorial code should exemplify well-written practical code in addition to whatever concept is being demonstrated.
This particular construct is debatable - I personally think it can read better to explicitly break out a boolean statement like that in some cases, especially in a simple method like in this example. I certainly wouldn't take a hostage over that opinion, though.