It is a bug on JSMin. Minifying should never alter code behaviour.
Crockford on Bootstrap's semicolon omission: “insanely stupid code”
111–120 of 224 posts
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#112Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#113Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#114If there is a tool to insert semicolons in all the right places, you could use that before using jsmin. Would that help?
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#115Earlier quoted context omitted.
Jacob ("fat") comes off looking far worse than Crockford, to my eyes (and that Kit character seems to be 7 years old). It's the arrogance and stupidity of youth facing the crotchety crankiness of experience. Crockford has earned the right to have a strong opinion here IMO. But it's not just bike-shedding. It's more pernicious than that. It's actually something that looks like bike-shedding to uninformed observers, bu…
I have never written a line of JS in my life, which hopefully qualifies me as an unbiased outsider, but I don't agree that that Crockford's position here on JSMin is the right thing to do. Here is what I see: @fat is not inserting "!" needlessly as a statement separator. The "!" is there for its proper purpose, as a "unary not" operation, which will short circuit the second operand of the "&&" when isActive is false.…
Language lawyering is fine and dandy when you know exactly which compiler will be used and you know exactly how it works.
But on the web that isn't the case. You can write code, but you have no control over what browsers, past, present and future, it will get run on. And it is your responsibility to make that work. According to the spec, you may be right. But in practice you're the one who is wrong, because you're the one whose job it is to make your code work across browsers and future versions of the spec.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#116Earlier quoted context omitted.
! is already being discussed to be turned into an infix operator in a future version of JavaScript.
Future versions of JavaScript might also replace the 'function' keyword with a picture of a chicken, but I'm still going to keep typing the word 'function' for now.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#117Earlier quoted context omitted.
[deleted]
So you think it's ok for a minifier to break working code? Please explain.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#118Earlier quoted context omitted.
I have never written a line of JS in my life, which hopefully qualifies me as an unbiased outsider, but I don't agree that that Crockford's position here on JSMin is the right thing to do. Here is what I see: @fat is not inserting "!" needlessly as a statement separator. The "!" is there for its proper purpose, as a "unary not" operation, which will short circuit the second operand of the "&&" when isActive is false.…
Here is what you're missing. Language lawyering is fine and dandy when you know exactly which compiler will be used and you know exactly how it works. But on the web that isn't the case. You can write code, but you have no control over what browsers, past, present and future, it will get run on. And it is your responsibility to make that work. According to the spec, you may be right. But in practice you're the one wh…
That said, it's hard to program to a spec that does not (officially) exist yet, and doubly so if there's not clear "opt-in/out" path for future versions. Since, as a developer, I can't control what the committee adds or removes from the spec, or what they might break, I can only do the best I can with the language as it is -- not breaking existing code in future versions of the language is the committee's job.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#119There's something horribly wrong with everything about this. Why is such a smart person as Crockford wasting his time arguing about semicolons in 2012? Why is this at the top of the most popular hacker website? Why are people writing detailed opinions about semicolons in this thread (with surely more to come?) One would hope that at least over time the bike sheds being argued about would start to at least evolve into…
I found the whole discussion quite sad, the stupid animated GIFs in particular. I became even more sad when I noticed the discussion is being held on GitHub, not Reddit or 4chan. Scrolled through, won't participate. I'd much rather build interesting application.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#120Crockford is an idiot for writing an JS minifier which explicitly promises to not break legal code but actually does, and then refusing to fix it because he's proud of his reputation for being an asshole.
And everyone commenting on this post is an idiot for thinking that any of this is worth the pixels it takes to argue about it. And yes, that includes me.
sigh This whole thing just makes my head hurt.