News for hackers. Stuff that matters.
Re:Zepto goes semicolon-free by slexaxton on Monday April 09, 2012 @02:15PM (#3818389)
Not using semicolons seems fine enough. Going through and removing the semicolons that you already used seems like you're just trying to start drama. Why not use that time to do something that effects the code positively or negatively?
Re:Zepto goes semicolon-free by madrobby on Monday April 09, 2012 @02:24PM (#3818433)
(Disclaimer: I'm the maintainer/author of Zepto.js)

FWIW, it took about 10 minutes to remove the semicolons from the codebase, with a simple grep: /;$/

For the few places where a ; is actually needed you can run a regexp based search as well, the rest is easily identified by unit tests.

We've also spend some 50+ hours on writing new code, tests, a new build and automated tests system, a completely new documentation site and answering countless issues on GitHub.

Re:Zepto goes semicolon-free by slexaxton on Monday April 09, 2012 @02:29PM (#3818464)
Fair enough, I'm not claiming that other, much more difficult work didn't go into the feature updates. What was the reasoning for switching to semicolon-less? Why wasn't that a concern when the project started? (Apologies if I missed it in the notes.) I have no problem with projects doing one or the other, the _switch_ just doesn't fit into my brain correctly. Perhaps your tastes just changed?
Re:Zepto goes semicolon-free by madrobby on Monday April 09, 2012 @02:35PM (#3818497)
Yeah, the semicolons where just there because "that's how you write JavaScript, right?". After reading Mislav's article and of course working with him on Zepto I realized that actually, the semicolons don't do anything; and I like the code better without them. (I'm also doing a lot of Ruby and CoffeeScript, so I'm biased, I suppose.)

So yes, you could say my taste changed, but there's good a good reason behind it—the semicolons are optional, and Zepto is all about concise code.

Re:Zepto goes semicolon-free by famousactress on Monday April 09, 2012 @03:02PM (#3818626)
The one argument I've heard from keeping the semi-colons is to make life easier for minification tools. Is this not an issue?
Re:Zepto goes semicolon-free by lvh on Monday April 09, 2012 @03:12PM (#3818678)
It breaks SOME minifiers. There was some inlining tool used by some mobile ISPs that basically downloaded referenced JS files in <script> tags and injected them inline to get rid of another HTTP request. They broke, because they are stupid, broken tools.

A correct minifier works on the AST of the code anyway (at least in the abstract). It works on the semantic meaning of the code, so it interprets semicolons or the lack thereof exactly the way any other implementation would.

The first case with the broken inlining tool is typically not actually an issue, because your semicolonless code gets put through a minifier which probably adds a bunch of semicolons again :)

Re:Zepto goes semicolon-free by madrobby on Monday April 09, 2012 @03:10PM (#3818670)
It is not an issue. Zepto uses UglifyJS and there have been no issues whatsoever.
Re:Zepto goes semicolon-free by mikeryan on Monday April 09, 2012 @02:22PM (#3818425)
I think an argument can be made that a consistent coding style is important to open source projects.

And honestly this is, intentionally, a tiny library. If it took more then 10 minutes I'd be surprised.

Re:Zepto goes semicolon-free by slexaxton on Monday April 09, 2012 @02:30PM (#3818477)
I agree consistency is key, but it _was_ consistent before (in it's use of semicolons), and is still (in it's non-use of semicolons).
Re:Zepto goes semicolon-free by jqueryin on Monday April 09, 2012 @02:20PM (#3818411)
I believe they'd argue the removal of semi-colons has a net positive effect on the code as Zepto.js is in essence a minimalists version of jQuery. This is particularly important for mobile sites which benefit greatly from site assets remaining in memory.
Re:Zepto goes semicolon-free by slexaxton on Monday April 09, 2012 @02:26PM (#3818444)
Naturally, the semicolons have always been stripped by the minifier. This makes the code no more 'minimalist.'