I wouldn't call it a bug either.
I quite often write 'useless' code, just to make the intent more obvious.
Int Foo,bar = 1,5
Int baz = foo+bar
I could just make baz 6, but then I don't know why it's 6.
I quite often write 'useless' code, just to make the intent more obvious.
Int Foo,bar = 1,5
Int baz = foo+bar
I could just make baz 6, but then I don't know why it's 6.
> The rule checks for comparisons (==, !==, etc) where the outcome cannot vary at runtime, and logical expressions (&&, ??, ||) which will either always or never short-circuit.
If you write if(baz == 6) then the if clause is useless and probably a bug.
I'd expect the compiler to optimise out
If(somedebugflag)
Not tell me off for writing buggy code.