return [self hasPrefix:@"http://"];
If so, I disagree. The way it was written in the tutorial is easier to read when going into a new language — and teaches you that Objective-C uses YES and NO, rather than true and false.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.
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.
Arguably, an ObjC programmer should know that booleans are YES and NO and not true or false, but so what? Code that can't be maintained isn't good code. Code that is developed within a team should be readable before it should be clever. if it is clever, or if it needs to be clever, then it should be commented to the degree that it is more easily understood.
I personally would rather write readable code than more comments.
It's just C. 0 is false, anything else is true.