3 ms·
This isn't as bad as it could get because it's using magic numbers. If it read: if (status != SUCCESS) return ERROR; // return on error then you'd have a pr
by wk_end 8y ago
This isn't as bad as it could get because it's using magic numbers. If it read:
if (status != SUCCESS) return ERROR; // return on error
then you'd have a problem.
- sudhirj 8y agoThis is ideal, yes. Would also settle for a previous comment explaining what each int represented, if the language in question doesn't have enums.
- xg15 8y agoTo play devil's advocate (and be really nitpicky), it doesn't say "return an error" but "return on error" which does contain some useful information: That this method doesn't have any kind of sophisticated error handling but simply aborts on error.
- efdee 8y agoI don't think that's very useful - you see that it doesn't have any kind of sophisticated error handling simply by looking at the method's source code (which you need to do in order to see the comment).
- NullPrefix 8y ago0 and -1 as status numbers aren't that unusual to call magic.