3 ms·
if you want to do something like if (foo) bar(); you might as well write if(foo) bar(); i personally prefer if(foo){bar();} the reason to be explic
by jdavid 17y ago
if you want to do something like
if (foo)
bar();
you might as well write
if(foo) bar();
i personally prefer
if(foo){bar();}
the reason to be explicit, is incase you are modifying your script via a compressor, sometimes you can not predict what line your code is going to be on, and its always best to be as explicit as possible.
if you go to one of Crawford's talks, he mentions how he used to love writing switch case statements with fall through, until he spent hours debugging something because of it. most of the stuff he has in there is a really good start to having fairly readable and reliable code. i recommend following the pattern.