Boolean and = - page 2

 
This is why I say: You would never write if( (2+2) == 4) == true) would you? if(2+2 == 4) is sufficient. So Don't write if(bool == true), just use if(bool) or if(!bool). Especially use readable names for self documenting code: bool isBuy = ...; if(isBuy) OrderSend.
 
ydrol:


Many compilers will not warn by default, but will warn when using the most recommended switches for assisting with code quality (eg 'lint' )

So its not a bug, and not a big problem, because MQL4 doesnt mix Booleans and integer types, like C does. its more of a problem with languages that acccept 0 and !0 as false and true.


Neither JAVA compiler warns you in this case. Assignment inside expression is not considered as a good programming technique, but it is part of the language specification. Nevertheless Languages like JAVA have powerful editors, which let you set custom messages coming from their parser.
Reason: