Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26309

Re: jquery and hoi polloi

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: jquery and hoi polloi
Date Thu, 11 Dec 2014 03:16:22 +0100
Organization solani.org
Lines 41
Message-ID <m6aupe$esl$1@solani.org> (permalink)
References <svOdnVxF-e8OrePJnZ2dnUVZ8q2dnZ2d@westnet.com.au> <3e25f0fa-4c3f-4d51-a6a0-da69bd8b3677@googlegroups.com> <27938323-9eca-480c-8ead-2000865bcecc@googlegroups.com> <82684c28-b567-4b2c-8d2b-eb0c41376cd2@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace solani.org 1418264174 15253 eJwFwQkBACAIA8BKTHnjKLj+Ebyz7fAOdXM1GvtsZ1bMoV4oUVeegxmclQREFauHLwTV9gEnhhE1 (11 Dec 2014 02:16:14 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Thu, 11 Dec 2014 02:16:14 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
X-User-ID eJwFwYEBgDAIA7CXBNaC5wgr/59ggqBx8hA8WGzE5lVTXih479r1YU+wvN+jbs2nB2TSpB8sQBHL
In-Reply-To <82684c28-b567-4b2c-8d2b-eb0c41376cd2@googlegroups.com>
Cancel-Lock sha1:QRvFvrplgH5DigdcXeTAXYWsCec=
X-NNTP-Posting-Host eJwNwgERwDAIA0BLsATSyhkr+JfQ3X8gPT8xIxkT07JXa0rYuziNn+TwzUdmZ6Hcm1bOg2pcFG0QnQ==
Xref csiph.com comp.lang.javascript:26309

Show key headers only | View raw


RobG wrote:

> Yes, jQuery isn't so bad for performance if used judiciously.

However, there are some cases where the perfomance of jQuery is really
bad.  These cases might not be relevant for the overall performance, but
nonetheless I won't call avoiding them micro-optimizations.  See for
instance <http://jsperf.com/document-getelementbyid-vs-jquery/3>.
What's wrong with using document.getElementById()?

> However, because many who use it have no idea what it's doing, they
> don't understand the performance risk until it becomes an issue.
> Often it's the result of using selectors based on complex DOM
> structures, fixing that later means virtually re-writing the
> application.

From my limited experience, not seldom it's just the matter of repeating
yourself.  Apparently, jQuery enforces this technique.  For instance:

  $(".foo .bar .baz").do_something();
  // ...
  $(".foo .bar .baz").do_something_else();

instead of:

  var elems = $(".foo .bar .baz");
  elems.do_something();
  // ...
  elems.do_something_else();

(I'm aware that the two snippets are not necessarily equivalent, but too
often they are.)

> Also, the mantra of "do more with less" doesn't necessarily deliver.
> Many seem to think that if they use jQuery, the equivalent POJS must
> be more code when likely it isn't.

"POJS"?  Plain old JavaScript?

-- 
Christoph M. Becker

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

jquery and hoi polloi Andrew Poulos <ap_prog@hotmail.com> - 2014-12-03 08:30 +1100
  Re: jquery and hoi polloi "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-02 23:33 +0100
    Re: jquery and hoi polloi "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-12-04 21:46 -0800
      Re: jquery and hoi polloi "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-10 00:47 +0100
  Re: jquery and hoi polloi danca <cyberdanny@tiscalinet.it> - 2014-12-03 00:14 +0100
  Re: jquery and hoi polloi Erwin Moller <erwinmollerusenet@xs4all.nl> - 2014-12-03 14:47 +0100
  Re: jquery and hoi polloi Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 16:44 +0100
    Re: jquery and hoi polloi Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-12-04 22:06 +0100
  Re: jquery and hoi polloi RobG <rgqld@iinet.net.au> - 2014-12-08 18:39 -0800
    Re: jquery and hoi polloi Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-12-09 13:23 -0800
      Re: jquery and hoi polloi RobG <rgqld@iinet.net.au> - 2014-12-10 17:00 -0800
        Re: jquery and hoi polloi "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-11 03:16 +0100
          Re: jquery and hoi polloi RobG <rgqld@iinet.net.au> - 2014-12-10 18:37 -0800
          Re: jquery and hoi polloi Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-12-11 11:08 -0800
            Re: jquery and hoi polloi "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-11 22:52 +0100
  Re: jquery and hoi polloi Scott Sauyet <scott.sauyet@gmail.com> - 2014-12-16 12:56 -0800

csiph-web