Quote:
|
Originally Posted by ApothiX
Simply put: You are an idiot.
The client/server is going to do the == true check regardless if you put it or not. It does not do it twice if you put it. I will say it one more time: There is no redundancy in that statement.
|
No, why would you make a statement true==true.
What if, for, and while statements do is interpret boolean values.
PHP Code:
//executes blah() always
if (true) {
blah();
}
//executes an infinite loop on blah();
while (true) {
blah();
}
//executes blah2(i) forever
for (i=0; true; i++) {
blah2(i);
}
//doesn't execute
if (false) {
blah();
}
//doesn't execute
while (false) {
blah();
}
//doesn't execute
for (i=0; false; i++) {
blah2(i);
}
By putting (onwall(x,y) == true), you're comparing a boolean value to a boolean value, which isn't necessary. onwall(x,y) already returns true or false, and then you're comparing it to another boolean value. Putting (onwall(x,y) == true) would be the same thing as putting (onwall(x,y) && true), just not necessary. The only reason anyone should put ==true or ==false is if they believe that it would improve readability, and it usually has negative effects on the readability of the code.