3 ms·
A while back I think there was a github issue where the authors of some popular library refused to use semi-colons and it was causing all sorts of problems for
by WorldWideWayne 12y ago
A while back I think there was a github issue where the authors of some popular library refused to use semi-colons and it was causing all sorts of problems for people. I can't remember what library, but it was funny watching hundreds of people comment on the issue to say "Just use the damn semi-colons!"
- swang 12y agoBootstrap. The flamewar wasn't over semicolons initially, the minifier used by Bootstrap was wrong but a work around was to add semicolons.
- tedunangst 12y agoThe first link from the article in question?
- WorldWideWayne 12y agoHaha, yeah I guess should have followed that link :)
- slig 12y agoI believe this is what you're talking about https://github.com/twbs/bootstrap/issues/3057 https://github.com/twbs/bootstrap/issues/3057
- dsp1234 12y agoThis has never really struck me as a good argument for using or not using semi-colons. 1.) The non-use of semi-colons was perfectly valid JavaScript in that case. 2.) The parser portion of the minifier from Douglas Crockford did not account for this particular case. 3.) It became a flamewar because Douglas Crockford called it out as an error in a very ham fisted way, and the developer responded in kind. If a c++ compiler chokes on valid input, then a bug is sent to the compiler maintainer, and the developer rewrites their code until the bug is fixed. 4.) And that's exactly what happened. The minifier parser was fixed, and the Bootstrap code was updated to work around the parser error. 5.) The reason for not using semi-colons was legitimate. This is a library with a large audience, and not everyone has a minifier/compresser available. It was an easy win for something that wasn't needed. That's exactly the type of stuff that I want when I lean on 3rd parties. So for me this could have gone a completely different way had the two parties been more civil: BS: Hey DC, can you fix your minifier, it looks like it's busted on this valid input. DC: Hrm, looks like your right. I'll fix it up, why don't you add a semi-colon in there until I can get it fixed BS: Hey, no problemo. Done. I look forward to your fix! So this is really more of a story about being professional to your fellow developers than anything that has to do with semi-colons or not.