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.)
I don't get why people form such strong opinions about these things when software can automagically convert a list of variables into separate vars or convert one type of string quote into the other. Do what ever the hell you want and then convert your code to the team standard before commit.
So you'd even declare your loop iteration variables at the top of the function?
To be fair to your coworkers, hoisting is a crazy concept and the lack of a block scope is bizarre. Hoisting came from the same mindset that he gave us the dangerous with keyword.
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.)