Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your code executes and is not useless.

> 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.



A general rule was extracted that 'useless' code is buggy code

I'd expect the compiler to optimise out

If(somedebugflag)

Not tell me off for writing buggy code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: