There are idiot web developers who are using commas in place of semicolons because they need to be free to express their individual idiocy. It turns out there are consequences.
Moral: Don't forget to use your semicolons.
Moral: Don't forget to use your semicolons.
View 5 previous comments
Great quote from Jurassic Park: "Yeah, but your scientists were so preoccupied with whether they could that they didn't stop to think if they should."
They were talking about manipulating dinosaur DNA, not faulty programming styles, but it still fits, except for the part about scientists.Jul 17, 2012
Clearly, compilers/compressors do this to save space. There was seemingly never a concern about parsers being unable to handle it. I'm sure, now that it's been realised, the compressors will change their tacts.Jul 17, 2012
+James Padolsey Yes. It allows shortening statements like {if (x) { foo(); return y; } else { bar(); return z; }} by factoring returns and throws left: (return x?(foo(),y):(bar(),z)). The reason it's often done even when that or similar optimization aren't possible is an assumption that having mostly commas in the output source code and few semicolons will lead to better GZIP compression. That latter is an empirical claim that I can't provide data for, but the thinking tends to be that GZIP like Huffman performs better when the distribution of chunks in the input is spikier. (None of this is meant to excuse code-generator writers from failures to understand the limitations of code-consumers.)Jul 17, 2012
+Liam Carton I have yet to see one good reason to avoid semi-colons. Can you give me an example for a good reason?Jul 17, 2012
+Andrew Ray, The commas in question came from minifier, indeed. But twitter developers are "famous" for their hatred of commas. for example: https://github.com/twitter/bootstrap/issues/401
So, anger is justified, i think. Isn't it insanely stupid to break things just to get rid of semicolons because they are "bad"?Jul 17, 2012
No, it IS a JS developer issue.
Constraints like this exists in virtually all languages. C/C++ compilers have a limited number of cases in a switch operator, and have limits on template instantiation depth. MySQL cannot join more than 32 tables. There are limits everywhere. If some feature works in a clean room environment, it does not mean it will work seamlessly in a production environment. Everything should be used in a way it is supposed to be used. And semicolon operator should be used to separate statements, not comma.
Opera now is in Microsoft's hat, because when ms made new versoion of windows (say, Windows 95, 98 ...), they had a lot of hacks to support buggy software written for previous verions. It was error in a third-party software, but it was Microsoft's responsibility to make a workaround. Because it's they who will be blamed.
So, when twitter is not working, it's Opera who will be blamed by end-users, that's why they are striving to fix it (and cursing twitter devs at the same time, i suppose)Jul 17, 2012
Commenting is disabled for this post.