4 ms·
Your first comment should say "until its equal to h" not z
by pilom 15y ago
Your first comment should say "until its equal to h" not z
- Tyrannosaurs 15y agoShouldn't it say until it ceases to be less than h? Your comment supposes that the loop will increment without interference. While you'd hope that was the case, it's not necessarily true. Obviously with the loop as coded your comment is correct (that'll be the first condition that terminates the loop) but it could raise a question about whether comments should reflect the routine as written or just the section they're immediately referring to. Or indeed whether comments for something so self evident are even useful or necessary... Something I'd definitely ask in an interview if I was presented with this code, not looking for a specific answer, just looking for some indication that the candidate had (or could come up with) some vaguely informed thoughts on the subject.