That is the first JS style guide where there isn't anything stupid in it and I actually agree with what it says. The closest thing to a disagreement is single quotes only for strings, and that is only because I tend to mix them up myself.
They even got var right which says less about them and more about the state of "JS culture". (I would have expected one var per line to be an obvious no brainer which didn't need to be stated.)
I would have expected one var per line to be an obvious no brainer which didn't need to be stated.
Doesn't Crockford say to use a single var statement with commas in The Good Parts? I seem to remember thinking that was the gospel for a while before I started noticing how many times small bugs like they describe occurred:
var items = getItems(),
goSportsTeam = true;
dragonball = 'z';
40
u/sime Mar 27 '15
That is the first JS style guide where there isn't anything stupid in it and I actually agree with what it says. The closest thing to a disagreement is single quotes only for strings, and that is only because I tend to mix them up myself.
They even got
varright which says less about them and more about the state of "JS culture". (I would have expected onevarper line to be an obvious no brainer which didn't need to be stated.)