Reasons loopback0 shouldn't listen to SO about JavaScript (or anything probably)
-
In the spirit of the gold topics, if everyone else did something different, is this really rational or sensical?
they did though.
IE implemented a nonstandard DOM extension. then Opera and webkit copied it badly (neither behave like IE nor like each other) and FF never implemented it.
so there are four "standards" all behaving differently.
-
But tell me, how did the standards become standards in the first place, eh? Bet you can't do that!
-
But tell me, how did the standards become standards in the first place, eh? Bet you can't do that!
in this case: http://www.w3.org/
-
But tell me, how did the standards become standards in the first place, eh?
Because a group of people with nothing better to do decided to try and impose their will on everyone else, but in a very limited and specific way?
-
But that's irrational!
-
To me, this point alone is like shooting your leg off with a shotgun and then saying "look, it's only one wound".JS itself puts up a pretty damn good fight in the "poorly-designed and stupid" competition
Only three things spring to mind:Type coercion; sometimes feels too lenient
i recommend pickung up a copy of this book:
The problem is that can only go so far. For example, you can recommend===
over==
, but that's only one operator; there's no "use this instead and things will behave sanely" alternative to such other infrequently used operations as+
or.
. If anything, I'd guess type coersions at==
time are almost less problematic than those that happen on other operations, orobj.missing
evaluating toundefined
.Being aware of those problems helps, but it only goes so far. If I know that a field has a lot of poop in it, I can watch out for it, but it's still easy to step in a pile that's covered by grass.
Anyway, I should probably stop trying to turn this into an "Evan complains about JS" thread...
-
infrequently used operations as
+
or.
Aren't they two of the most commonly-used operators in JS?
Whooooooooosh. -bz
-
Aren't they two of the most commonly-used operators in JS?
It's almost as if I was being sarcastic ;-)
-
-
Type coercion; sometimes feels too lenient
That's because it is too lenient. Type coercion should be explicit.
Automatic creation of variables; call me crazy, but that's just
askingbegging for bugs (and it's hit me before)FTFY
-
Aren't they two of the most commonly-used operators in JS?
Self flagged, but so obvious, and nice on this hot June day.
-
Type coercion should be explicit.
You actually can have it explicit as well, if that's your cup of tea:
Number("42") === 42
-
OK, I'll rephrase:
Type coercion should be required to be explicit.
-
Whooooooooosh. -bz
-
Self-flagged
-
Self-flagged
-
on this hot June day.
O_o
i.e. rain and high winds for the past couple of hours (prevalent wind direction is generally westerly)
-
Automatic semicolon insertion; can you guarantee it'll always be right?
99.99999999999999999% of the time there will be no problem from missing the semi-colon.
0.00000000000000001% of the time, your missing semi-colon will cause one of the minimizers out there to shit brix and not work right.
Lesson? Use the damn semicolons.
-
Type coercion should be required to be explicit.
I disagree. Type coercion questions make for an excellent alternatives to FizzBuzz for JS developers.
-
0.00000000000000001% of the time
At those odds, it's like saying you should review your compiler's generated assembly for compiler bugs.
-
which is why the guy that wrote that minimizer told the jackass dev that found the 0.00000000000000001% broken-by-missing-semicolons case that he could go suck a big one because he wasn't going to make his minimizer handle the ambiguity that arose from the missing semi-colon abuse.
wish I could remember where i saw that debate (that's where i originally saw the office space image above)
-
Use the damn semicolons.
QFTOf course, if JS interpreters/JITters enforced mandatory semicolons…
-
I just couldn't resist having a dig at both JS and PHP, given their general iness ;)
But PHP can do format strings as well!
-
IE implemented a nonstandard DOM extension. then Opera and webkit copied it badly (neither behave like IE nor like each other) and FF never implemented it.
Are we talking actual Presto engine? I don't have a copy of Opera 12 laying around any more to check...
-
Unless my recollections very much misguide me, yes we are.
-
-
-
-
No, but someone used that term a lot... Spike?
Well, he was English, not sure about specifics though.
-
Drusilla maybe?
-
Drusilla maybe?
Can't remember if he called her pet, or she used the term? Maybe both? I'm pretty sure it's one or both of them.
-
Wikiquotes suggests it's both of them.
-
Well, he was English, not sure about specifics though
Didn't sound like a Geordie accent, more Mancunian to my ears and memory (several years since I've watched it). Of course, being a soft Southern ponce, I'm not entirely up on which parts of the country use "pet", so it might have still been valid with a Manchester accent
-
Manchesteraccent
Manchester rings a bell, I think it was mentioned? So maybe?
I still make no claims on validity of them using that expression.
E_NOT_ENGLISH
.
-
-
I could be a 'murican, or Canadian, still wouldn't have enough data to understand.
-
Yeah, but you are actually an ESL speaker aren't you? My error obviously inherits from yours
-
-
Of course, being a soft Southern ponce, I'm not entirely up on which parts of the country use "pet", so it might have still been valid with a Manchester accent
'Pet' I think has always been a Geordie thing
-
Doesn't ring a bell as a Manchester (or North Western) thing.
-
i.e. rain and high winds for the past couple of hours (prevalent wind direction is generally westerly)
We got that later in the day. Quite cool today with some drizzle. Thanks @RaceProUK!
-
'Pet' I think has always been a Geordie thing
Mackem as well - possibly NE England in general?
-
wish I could remember where i saw that debate (that's where i originally saw the office space image above)
Found it! https://github.com/twbs/bootstrap/issues/3057 <aside class="quote">englishextra commented on Apr 13, 2012:bootstrap-dropdown.js when minified with JSMin::minify produces error in Firefox error console saying clearMenus()needs ;
</aside> <aside class="quote">on line:
clearMenus() !isActive && $parent.toggleClass('open')
if in source code this is corrected -- no error in minified version
douglascrockford commented on Apr 15, 2012That is insanely stupid code. I am not going to dumb down JSMin for this case.
</aside><aside class="quote">douglascrockford commented on Apr 15, 2012TC39 is considering the use of ! as an infix operator. This code will break in the future. Fix it now. Learn to use semicolons properly. ! is not intended to be a statement separator. ; is.
</aside>
-
Found it! https://github.com/twbs/bootstrap/issues/3057
Aha! And with finding that, here's where @cartman82 pointed this out last summer:
http://what.thedailywtf.com/t/there-should-be-a-programmers-license/1355/184?u=boomzilla
-
Learn to use semicolons properly. ! is not intended to be a statement separator. ; is.
Stupid idea: REMOVE THE FUCKING ASI FROM THE LANGUAGE THEN!
-
-
GopherJS has templating that also prevents XSS.
-
Stupid idea: REMOVE THE FUCKING ASI FROM THE LANGUAGE THEN!
Or redefine newline to be semantically equivalent to a semicolon.
-
unix newlines, mac newlines, or windows newlines?
-
Why choose when you can have all three at once?