Value before variable coding
Lately I’ve been consciously reworking how I write one small chunk of commonly-used code. When it comes to comparisons I’ve always written them (and always seen them written) as:
if ( $variable == 10 )
{ doSomething(); }
However lately I’ve taken to writing these statements as:
if ( 10 == $variable )
{ doSomething(); }
Admittedly I find this second [...]
« go back