Earlier quoted context omitted.
Sure the "raising the skill level" bit is just trolling. Omitting semi-colons is about removing ambiguity, and making it easier to spot inconsistencies. As a bonus, code looks cleaner. In this case, the minifier is breaking the code, regardless.
Can you parse this expression without parentheses? a && b && c || d || e + f > g && h The parser sure can. Do you have all the operator precedences memorized, or do you use superfluous parentheses because you're not always sure? It's true that the semicolon is not needed, and it's true that the minifier is breaking code. It may even be true that Crockford should fix it. But that doesn't change the fact that the omit-…
Crockford on Bootstrap's semicolon omission: “insanely stupid code”
71–80 of 224 posts
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#72I'm sure this thread is going to be a good, old fashioned flame war. Let the games begin.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#73Earlier quoted context omitted.
Why the hell people are refusing to use semicolons? I don't get it
I've seen a few reasons. The main ones I encounter are: raising the skill requirement to contribute (you have to know JS better than average to never use a semicolon, and do so correctly), aesthetic (fewer characters looks better), and minimalism (don't use what you don't need).
Great idea! I propose some additional strategies for pruning the contributor pool:
- All numbers in hexadecimal (every idiot knows decimal!)
- No strict equality tests (too easy to reason about & uses extra character!)
- Variable names must consist entirely of unicode ideographs (even my grandmother knows ASCII!)
That should keep the idiots at bay!
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#74Earlier quoted context omitted.
Why? This unfortunate behavior is well described by Wadler's Law: http://www.haskell.org/haskellwiki/Wadlers_Law
This is great, thanks. The only logical conclusion is that engineers should be choosing tools that have the least syntactical surface area to argue over. :)
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#75Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#76There'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…
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…
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#77There'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…
Whatever the next disruption is in software engineering, please dear God let it be immune-by-design to this type of distraction. While your sentiment is positive, wouldn't this mean either designing things in a rigid, unambiguous manner (think C's semicolons) or changing human nature? Ambiguous choices plus human nature equals debates. An argument about semicolons does seem silly and your proposed outcome sounds nice…
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#78Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#79Earlier 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…
[deleted]
The infix “!” operator: An eventual analog of “.“, for making eventual requests look more like immediate requests.
[1]: http://wiki.ecmascript.org/doku.php?id=strawman:strawman [2]: http://wiki.ecmascript.org/doku.php?id=strawman:concurrency
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#80Crockford's stance is annoying purely because it's pedantic and because there are many libraries that embrace this style. We use django_compressor and found bugs from the compressor that uses Jsmin. So I have to use something else to compress them before hand. Are there compressors that use the syntax tree rather than transforming the source?
Is there any particular reason why you refuse to put in the semicolons in Javascript?