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


Groups > comp.lang.javascript > #18129

Re: lazy loading

Message-ID <26652061.r6ho1VWPFL@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-01-17 17:00 +0100
Subject Re: lazy loading
Newsgroups comp.lang.javascript
References <dfKdnY2PqMKkHWrNnZ2dnUVZ_uadnZ2d@westnet.com.au>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


Andrew Poulos wrote:

> A job I recently considered applying for required a person knowledgeable
> about lazy loading.
> 
> Googling for "lazy loading" I found this page
>    <http://ajaxpatterns.org/On-Demand_Javascript>
> which claims:
> 
> "...because her new website requires lots of Javascript. She refactors
                                               ^^^^^^^^^^
> the application, extracting out a few Javascript modules. The initial
                                        ^^^^^^^^^^^^^^^^^^ wannabe alert
> page load is now much faster, because only a bare-bones initialisation
> module is pulled down, with the other modules loaded only when they're
> needed."
> 
> I'm at a loss as to how this gives any real benefit to users.
> 
> If the goal is to increase the user's experience by shortening the
> apparent load time what happens when the user clicks a button that
> requires some javascript to be there and the user needs to wait for the
> javascript to be downloaded? Haven't you just moved the time delay from
> the page load?
> 
> Wouldn't it be better to have a, say, 5 second page delay for page load
> and to then have the page operate smoothly rather than five 1 second
> delays during the use of the page?

It depends.  However, “lazy loading” as it is understood there is based on 
the misconception that you can fix the problem of bloat code by (AFAIK) not 
yet proven to be reliable execution of script code through deferred addition 
of script elements, instead of reducing the amount of bloat code by 
intelligent software engineering (more modular code) in the first place.

A feature that would actually help there would be the “defer” attribute of 
“script” elements, if it was universally implemented:

<http://caniuse.com/#search=defer> pp.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

lazy loading Andrew Poulos <ap_prog@hotmail.com> - 2013-01-17 15:38 +1100
  Re: lazy loading "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-01-16 23:50 -0800
  Re: lazy loading Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-17 17:00 +0100
    Re: lazy loading Andrew Poulos <ap_prog@hotmail.com> - 2013-01-18 07:24 +1100
      Re: lazy loading Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-17 22:00 +0100
        Re: lazy loading Osmo Saarikumpu <osmo@weppipakki.com> - 2013-01-21 09:49 +0200
          Re: lazy loading Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-21 11:54 +0100
  Re: lazy loading Danny <dann90038@gmail.com> - 2013-01-18 13:26 -0800
    Re: lazy loading Andrew Poulos <ap_prog@hotmail.com> - 2013-01-19 13:34 +1100
  Re: lazy loading Danny <dann90038@gmail.com> - 2013-01-19 11:12 -0800

csiph-web