Actually, I agree with Chrisir... I totally adhere to what calsign wrote, which chose intently a neutral variable name, but to illustrate better the idea, it is also a good idea to use a good variable name, making the structure to look like an English sentence.
Beside readability (which is important) and the fact it is faster to type (which isn't to neglect in the PDE...), it avoids a common error: forgetting one = sign. With other kinds of variable, Java would complain, but for historical reasons, it is legal for a boolean. So, instead of making a test, you re-assign true to a (or playerIsAlive) on each loop, making an infinite loop... Or, in an if test, you pick always the same branch, etc.
I have seen this error enough times on this forum to think it is worth mentioning...
Leave a comment on PhiLho's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic