Re:A better introduction to Objective-C
by billjings on Tuesday September 27, 2011 @07:26AM
(#3042794)
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.
I might even be convinced to go a step further and say that early on, it is far more important to actually get started and avoid hitting roadblocks, then it is to write nice and pretty code. You can figure that out later on, once you're comfortable with everything.