Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2135847.KEoUBZbHTU@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 09 Jan 2013 21:03:06 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Request for opinions on my newbie approach Newsgroups: comp.lang.javascript References: <10136443.OnBuAidq6I@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 36 NNTP-Posting-Date: 09 Jan 2013 21:03:07 CET NNTP-Posting-Host: d9e86cbd.newsspool2.arcor-online.net X-Trace: DXC=e1TfLnR_Cdo>jlK2>IgHGdA9EHlD;3Ycb4Fo<]lROoRa8kFYBYU3JEomcGm;JCkQ1al X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:18037 Cezary Tomczyk wrote: > Jim T. pisze: >> Thomas 'PointedEars' Lahn wrote: >>> Leonardo Azpurua wrote: > [...] >>>> for (var i = 0; i < f.elements.length; i++) >>> >>> for (var i = 0, len = f.elements.length; i < len; ++i) >> >> Why? Because it's faster? First, modern JS interpreters will probably >> already do this optimization. Second, unless the form has a million >> elements it will make no noticeable difference. Cleaner code is better >> than pointless "optimization". > > I wonder: what is not clean in this code? > > for (var i = 0, len = f.elements.length; i < len; ++i) > > Maybe you can write it as (as you want): > > for (var i = 0, len = f.elements.length; i < len; i += 1) > > Still can not see what can be confused here for developer. It's just a > simple, one line begin of loop. Probably they are under the illusion that they have a shadow of a clue what they are talking about (which was “modern JS interpreters” – OMG), and that I would care very much about the humble opinion of address-munging nobodys. Or they are just a troll. Do not feed. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.