bootstrap-dropdown.js when minified with JSMin::minify produces error in Firefox error console saying clearMenus()needs ;
on line:
clearMenus()
!isActive && $parent.toggleClass('open')
if in source code this is corrected -- no error in minified version
Activity
fat commentedon Apr 15, 2012
nope - that's a bug in jsmin. Probably should let @douglascrockford know about it though. thanks!
edit: The code had already been changed to an
ifwhen i suggested the jsmin issue be filed as a bug. Bootstrap and jsmin play very well together.douglascrockford commentedon Apr 15, 2012
That is insanely stupid code. I am not going to dumb down JSMin for this case.
douglascrockford commentedon Apr 15, 2012
TC39 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.
fat commentedon Apr 15, 2012
i have learned to use them, that's why there isn't one present.
ghost commentedon Apr 15, 2012
Zzzzing!
backspaces commentedon Apr 15, 2012
Any language with syntax arguments is clearly broken, compilers deal with this. Dart, I guess.
stephenhandley commentedon Apr 15, 2012
http://www.youtube.com/watch?v=rrPosTPSXxw
adrusi commentedon Apr 15, 2012
if you really wanted to get rid of the semicolons (though I really don't see the point of that, is it really that bad that it's worth worrying about it?),
! ... &&in this context an be replaced with... ||.coolaj86 commentedon Apr 15, 2012
coffeescript ftw?
otherwise, if you're doing real javascript, do it right?
p.s. (I'm not a coffeescripter yet, but it looks more and more like the right tool every day)
zacstewart commentedon Apr 15, 2012
Wow. I've read @fat's reasoning for not using semis, but when it comes to actual problems cropping up in the real world, why does "aesthetic" preference take precedence? Why write something like
just to avoid placing a semi a the end?
!is clearly not meant to do this job. It's a bool operator. Does the fact that the symbol looks prettier really matter?I am well aware that you can hack your way around this and keep saying "nuh uh!" instead of admitting that it's ill conceived and improving, but seriously: making a snippy response like that just makes you look like an immature hipster smarting off to a battle worn professional. @douglascrockford is on the technical committee for fuck's sake.
dubcanada commentedon Apr 15, 2012
This has nothing to do with being a hipster, and I have no idea why anyone seems to think it does. The simple fact is this code runs on ALL browsers without issue. Regardless if the fact that X version of javascript somewhere in the Y future will stop supporting it (maybe) does NOT give a reason for a javascript minifier to NOT correctly minify it.
Also if Crockford thinks this is insanely stupid code and he is on the technical committee then why is this insanely stupid code even possible?
ghost commentedon Apr 15, 2012
I know who @douglascrockford is but who is this @fat fellow?
zacstewart commentedon Apr 15, 2012
Being on the technical committee in 2012 for a language initially created 16 years ago probably doesn't grant him authority to radically change things like that.
275 remaining items
greg0ire commentedon May 25, 2013
Relevant: We use semicolons everyday
vpatryshev commentedon Jun 27, 2013
"The only true law is that which leads to freedom" (R.Bach)
Any style question starting with "why don't you..." has an easy answer: "because this is my style".
If you like semis, you use them; if you don't, you don't use them. What can be easier?
chrisharrison commentedon Jun 27, 2013
Vlad,
That would be perfectly true if this was just a style issue. And I'd be
100% behind you if that was the case. Unfortunately this is about much more
than styling. JavaScript needs the semicolons to function logically.
On 27 Jun 2013 06:02, "Vlad Patryshev" notifications@github.com wrote:
j1n6 commentedon Jun 30, 2013
There might be something else we want to focus on, leave the semicolons alone.
MathRobin commentedon Jul 24, 2013
Please use semicolons. Readbility is important. Maybe, you, @fat, know how and when using semicolon but it's not the case for all. Rookies, kiddies and even experts could need semicolon to read the code. So, please, add it for readability...
torifat commentedon Feb 24, 2014
Why don't we just get rid of indentations too??? It's really
OPTIONAL. And, alsoMINIMALISTIC.All the current IDE's are doing it wrong. Either they should give diff background colors to the different scopes or show them
AII (AUTO INDENT INSERTED).Merge pull request #15 from kevinvincent/master
Dealing with programmers who leave out semicolons because it’s pretty t…