<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Best way to load your JavaScript</title>
	<atom:link href="http://ajaxian.com/archives/loadingjs/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/loadingjs</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: BenGerrissen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274955</link>
		<dc:creator>BenGerrissen</dc:creator>
		<pubDate>Mon, 10 Aug 2009 10:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274955</guid>
		<description>@ThomasHansen.
EitherYou&#039;re going on a sidetrack again to shamelessly promote RaAjax OR you&#039;re defending RaAjax whilst THAT is not being attacked.

I&#039;m not arguing with you, I am putting you in your place since ALL of your ramblings have been offtopic and is generally considered rude.

Also, consider this, without people posting about snippets of javascript, RaAjax would not have existed AT ALL. You NEED those &quot;so called frontend developers&quot;  else your framework grinds to a halt since what I see in RaAjax is NOT original, and NOT innovative, it&#039;s just a rehash of something that has been done before with other languages and surfs on the ingenuity of frontend developers experimenting with javascript.</description>
		<content:encoded><![CDATA[<p>@ThomasHansen.<br />
EitherYou&#8217;re going on a sidetrack again to shamelessly promote RaAjax OR you&#8217;re defending RaAjax whilst THAT is not being attacked.</p>
<p>I&#8217;m not arguing with you, I am putting you in your place since ALL of your ramblings have been offtopic and is generally considered rude.</p>
<p>Also, consider this, without people posting about snippets of javascript, RaAjax would not have existed AT ALL. You NEED those &#8220;so called frontend developers&#8221;  else your framework grinds to a halt since what I see in RaAjax is NOT original, and NOT innovative, it&#8217;s just a rehash of something that has been done before with other languages and surfs on the ingenuity of frontend developers experimenting with javascript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274936</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Thu, 06 Aug 2009 23:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274936</guid>
		<description>@BenGerrison
Oh yeah, almost forgot those links are also developed with a framework which (yes) have Dynamic Loading automagically, but in practice it&#039;s seldom used...</description>
		<content:encoded><![CDATA[<p>@BenGerrison<br />
Oh yeah, almost forgot those links are also developed with a framework which (yes) have Dynamic Loading automagically, but in practice it&#8217;s seldom used&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274935</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Thu, 06 Aug 2009 23:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274935</guid>
		<description>@BenGerrison
http://ra-ajax.org/samples/Viewport-Calendar-Starter-Kit.aspx
http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx
http://ra-ajax.org/Docs.aspx
http://stacked.ra-ajax.org/
Profile those websites with e.g. YSlow and check out thsize of the JS...
.
And those websites are actually developed *WITHOUT* a so-called &quot;front end developer&quot;. They&#039;re purely written in &quot;server-land&quot;...</description>
		<content:encoded><![CDATA[<p>@BenGerrison<br />
<a href="http://ra-ajax.org/samples/Viewport-Calendar-Starter-Kit.aspx" rel="nofollow">http://ra-ajax.org/samples/Viewport-Calendar-Starter-Kit.aspx</a><br />
<a href="http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx" rel="nofollow">http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx</a><br />
<a href="http://ra-ajax.org/Docs.aspx" rel="nofollow">http://ra-ajax.org/Docs.aspx</a><br />
<a href="http://stacked.ra-ajax.org/" rel="nofollow">http://stacked.ra-ajax.org/</a><br />
Profile those websites with e.g. YSlow and check out thsize of the JS&#8230;<br />
.<br />
And those websites are actually developed *WITHOUT* a so-called &#8220;front end developer&#8221;. They&#8217;re purely written in &#8220;server-land&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrGregor</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274882</link>
		<dc:creator>MrGregor</dc:creator>
		<pubDate>Tue, 04 Aug 2009 13:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274882</guid>
		<description>@ThomasHanson
...and i hope he does it asynchronously!</description>
		<content:encoded><![CDATA[<p>@ThomasHanson<br />
&#8230;and i hope he does it asynchronously!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrGregor</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274881</link>
		<dc:creator>MrGregor</dc:creator>
		<pubDate>Tue, 04 Aug 2009 13:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274881</guid>
		<description>@ThomasHanson
I dont know where you are! But if you are outside, I hope a big bird takes a shit in your face!</description>
		<content:encoded><![CDATA[<p>@ThomasHanson<br />
I dont know where you are! But if you are outside, I hope a big bird takes a shit in your face!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrGregor</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274880</link>
		<dc:creator>MrGregor</dc:creator>
		<pubDate>Tue, 04 Aug 2009 13:32:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274880</guid>
		<description>@ThomasHanson
You are an idiot!</description>
		<content:encoded><![CDATA[<p>@ThomasHanson<br />
You are an idiot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BenGerrissen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274879</link>
		<dc:creator>BenGerrissen</dc:creator>
		<pubDate>Tue, 04 Aug 2009 12:17:56 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274879</guid>
		<description>@ThomasHansen
Then you have no idea how rich RIA enteprise websites can really get ;)
For example, the following can be contained in a single website:

- Accordion (vertical, horizontal, different modes and extra options)
- Google Maps (adapters, and extra addons specific for the customer)
- Auto Suggest (different modes, complete or suggest)
- Flash placing, interaction.
- Popup/in window/modal mechanism
- Funky arse navigation system some designer came up with...
- Ajax Application Presentation layers (plural)
- Font-size script (gracefully degrading)
- Site trackers
- Unobtrusive GUI techniques
- Runtime Form Validation presentation layers
- Canvas (SVG) applications
- Text editors

And many more tidbits and applications a full blown enteprise website can harbor, all unobtrusive, gracefully degrading and ofc with business logic relayed to the backend.

Frontend presentation technology is becoming huge as clients demand more RIA and the audience becomes more spoiled. This all results in either a huge ammount of kb&#039;s worth of javascript libraries loaded per page, a maintenance hell when including only the needed libraries per page or backend developers wasting their precious time working with an MVC or a frontend code compiler like GWT.

And even if you only have like under 100kb worth of javascript, dynamic loading still makes your pages load faster and can reduce server traffic (= savings on $) on very busy sites.

And I haven&#039;t mentioned the fact you can let frontend developers and backend developers work side by side and independant of eachother instead of one team waiting for the other, finishing websites sooner and using the right people for the right jobs creating higher quality websites.

Little technology posts can make for huge innovative leaps and can inspire futher for example, XMLHTTPRequests is only a few lines of code when you get to the jest of it... I&#039;m sure some people much like yourself dissed Ajax when it was in it&#039;s infancy as well ;)</description>
		<content:encoded><![CDATA[<p>@ThomasHansen<br />
Then you have no idea how rich RIA enteprise websites can really get ;)<br />
For example, the following can be contained in a single website:</p>
<p>- Accordion (vertical, horizontal, different modes and extra options)<br />
- Google Maps (adapters, and extra addons specific for the customer)<br />
- Auto Suggest (different modes, complete or suggest)<br />
- Flash placing, interaction.<br />
- Popup/in window/modal mechanism<br />
- Funky arse navigation system some designer came up with&#8230;<br />
- Ajax Application Presentation layers (plural)<br />
- Font-size script (gracefully degrading)<br />
- Site trackers<br />
- Unobtrusive GUI techniques<br />
- Runtime Form Validation presentation layers<br />
- Canvas (SVG) applications<br />
- Text editors</p>
<p>And many more tidbits and applications a full blown enteprise website can harbor, all unobtrusive, gracefully degrading and ofc with business logic relayed to the backend.</p>
<p>Frontend presentation technology is becoming huge as clients demand more RIA and the audience becomes more spoiled. This all results in either a huge ammount of kb&#8217;s worth of javascript libraries loaded per page, a maintenance hell when including only the needed libraries per page or backend developers wasting their precious time working with an MVC or a frontend code compiler like GWT.</p>
<p>And even if you only have like under 100kb worth of javascript, dynamic loading still makes your pages load faster and can reduce server traffic (= savings on $) on very busy sites.</p>
<p>And I haven&#8217;t mentioned the fact you can let frontend developers and backend developers work side by side and independant of eachother instead of one team waiting for the other, finishing websites sooner and using the right people for the right jobs creating higher quality websites.</p>
<p>Little technology posts can make for huge innovative leaps and can inspire futher for example, XMLHTTPRequests is only a few lines of code when you get to the jest of it&#8230; I&#8217;m sure some people much like yourself dissed Ajax when it was in it&#8217;s infancy as well ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274876</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Tue, 04 Aug 2009 07:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274876</guid>
		<description>@BenGerrison
Ref; &quot;You used the “business logic” card on the dynamic scriptloading technology/ideas of the OP. Out of place, futile nonsense argument.&quot;
.
Not really since when using a library which doesn&#039;t create Business Logic on the client you often end up with only a fraction of the JS, and hence the whole &quot;dynamic loading&quot; argument becomes obsolete...</description>
		<content:encoded><![CDATA[<p>@BenGerrison<br />
Ref; &#8220;You used the “business logic” card on the dynamic scriptloading technology/ideas of the OP. Out of place, futile nonsense argument.&#8221;<br />
.<br />
Not really since when using a library which doesn&#8217;t create Business Logic on the client you often end up with only a fraction of the JS, and hence the whole &#8220;dynamic loading&#8221; argument becomes obsolete&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: indiehead</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274860</link>
		<dc:creator>indiehead</dc:creator>
		<pubDate>Mon, 03 Aug 2009 12:28:23 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274860</guid>
		<description>nice to see this, it&#039;s something similar to a piece of work I did for moveme.com to simultaneously load all the javascript and css files required in a stream rather than waiting for the browser to render it step by step.

helped our end, reduced our loading times from 25sec to 6!</description>
		<content:encoded><![CDATA[<p>nice to see this, it&#8217;s something similar to a piece of work I did for moveme.com to simultaneously load all the javascript and css files required in a stream rather than waiting for the browser to render it step by step.</p>
<p>helped our end, reduced our loading times from 25sec to 6!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadedecho</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274858</link>
		<dc:creator>shadedecho</dc:creator>
		<pubDate>Mon, 03 Aug 2009 00:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274858</guid>
		<description>@spocke - the demo on LABjs is specifically aimed at loading 3 large scripts (~500kb each), and making sure to wait for all 3 to load before calling functions on them. I&#039;ve extensively tested this demo in various browsers, including IE6. 

I&#039;d be very interested if you can get the demo to break. But as of now, I think this script is strong enough to work in all relevant browsers.</description>
		<content:encoded><![CDATA[<p>@spocke &#8211; the demo on LABjs is specifically aimed at loading 3 large scripts (~500kb each), and making sure to wait for all 3 to load before calling functions on them. I&#8217;ve extensively tested this demo in various browsers, including IE6. </p>
<p>I&#8217;d be very interested if you can get the demo to break. But as of now, I think this script is strong enough to work in all relevant browsers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ck2</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274854</link>
		<dc:creator>ck2</dc:creator>
		<pubDate>Sun, 02 Aug 2009 15:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274854</guid>
		<description>I have an easier way:
defer=&quot;defer&quot;
on all your script tags

I know Firefox 3.5 finally supports it
http://bugzilla.mozilla.org/show_bug.cgi?id=28293

Not sure about webkit or opera but IE6,7,8 always had it.</description>
		<content:encoded><![CDATA[<p>I have an easier way:<br />
defer=&#8221;defer&#8221;<br />
on all your script tags</p>
<p>I know Firefox 3.5 finally supports it<br />
<a href="http://bugzilla.mozilla.org/show_bug.cgi?id=28293" rel="nofollow">http://bugzilla.mozilla.org/show_bug.cgi?id=28293</a></p>
<p>Not sure about webkit or opera but IE6,7,8 always had it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spocke</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274852</link>
		<dc:creator>Spocke</dc:creator>
		<pubDate>Sun, 02 Aug 2009 10:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274852</guid>
		<description>Is it still only me that have managed to get errors when loading scripts using the readyState == &quot;loaded&quot; on IE 6. This state is set after the script has been downloaded but some times before it gets parsed and evaluated. I made some tests where I loaded large scripts and then hogged the CPU by making a loop in an external process. It would then some times fire the &quot;loaded&quot; event before the actual script evaluation and that would break script dependencies in other words it wouldn&#039;t be blocking correctly. So I don&#039;t think it&#039;s possible to make reliable blocking script loading using that event you need a callback function in the actual script.</description>
		<content:encoded><![CDATA[<p>Is it still only me that have managed to get errors when loading scripts using the readyState == &#8220;loaded&#8221; on IE 6. This state is set after the script has been downloaded but some times before it gets parsed and evaluated. I made some tests where I loaded large scripts and then hogged the CPU by making a loop in an external process. It would then some times fire the &#8220;loaded&#8221; event before the actual script evaluation and that would break script dependencies in other words it wouldn&#8217;t be blocking correctly. So I don&#8217;t think it&#8217;s possible to make reliable blocking script loading using that event you need a callback function in the actual script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadedecho</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274850</link>
		<dc:creator>shadedecho</dc:creator>
		<pubDate>Sat, 01 Aug 2009 23:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274850</guid>
		<description>@souders LABjs *will* load any scripts in parallel if the author specifies as such. It will similarly &quot;block&quot; if the author specifies that. Whether to do so or not is the author&#039;s choice, and is based on them having a basic understanding of the dependencies involved in what they are adding to their page. 

(And let&#039;s face it, if you DON&#039;T understand simple dependencies between scripts, you probably shouldn&#039;t be trying to optimize your site like this anyway).

If a site has several scripts from different locations that are unrelated, they can load *all* of them in parallel. If they have one script that must load before 3 others load, they can do that do, by inserting one &quot;block()&quot; into the chain after the first script. It&#039;s author&#039;s choice on parallel loading vs. blocking, and IMHO that&#039;s the best way, to let them organize loading order and behavior for most optimum for their conditions.

Consider:
&lt;code&gt;
$LAB
.script(&quot;script1.js&quot;)
.script(&quot;script2.js&quot;)
.script(&quot;script3.js&quot;)
.block(function(){
   script1Func(); script2Func(); script3Func();
});
&lt;/code&gt;

That chain loads all 3 scripts in parallel, and then executes whatever code you want afterwards.

You can also have, even in the same page, this kind of chain code:
&lt;code&gt;
$LAB
.script(&quot;script4.js&quot;)
.script(&quot;script5.js&quot;)
.block()
.script(&quot;script6.js&quot;)
.script(&quot;script7.js&quot;)
.block(function(){
   script4Func(); script5Func(); script6Func(); script7Func();
})
.script(&quot;script8.js&quot;)
.block(function(){
  script8Func();
});
&lt;/code&gt;

In this chain, 4 and 5 load in parallel, then 6 and 7 load in parallel, then functions from 4-7 get executed, then 8 loads by itself, then finally a function in 8 is called.

The point is choice and flexibility, and balancing loading in parallel versus blocking where necessary. LABjs gives you just that, no more, no less.</description>
		<content:encoded><![CDATA[<p>@souders LABjs *will* load any scripts in parallel if the author specifies as such. It will similarly &#8220;block&#8221; if the author specifies that. Whether to do so or not is the author&#8217;s choice, and is based on them having a basic understanding of the dependencies involved in what they are adding to their page. </p>
<p>(And let&#8217;s face it, if you DON&#8217;T understand simple dependencies between scripts, you probably shouldn&#8217;t be trying to optimize your site like this anyway).</p>
<p>If a site has several scripts from different locations that are unrelated, they can load *all* of them in parallel. If they have one script that must load before 3 others load, they can do that do, by inserting one &#8220;block()&#8221; into the chain after the first script. It&#8217;s author&#8217;s choice on parallel loading vs. blocking, and IMHO that&#8217;s the best way, to let them organize loading order and behavior for most optimum for their conditions.</p>
<p>Consider:<br />
<code><br />
$LAB<br />
.script("script1.js")<br />
.script("script2.js")<br />
.script("script3.js")<br />
.block(function(){<br />
   script1Func(); script2Func(); script3Func();<br />
});<br />
</code></p>
<p>That chain loads all 3 scripts in parallel, and then executes whatever code you want afterwards.</p>
<p>You can also have, even in the same page, this kind of chain code:<br />
<code><br />
$LAB<br />
.script("script4.js")<br />
.script("script5.js")<br />
.block()<br />
.script("script6.js")<br />
.script("script7.js")<br />
.block(function(){<br />
   script4Func(); script5Func(); script6Func(); script7Func();<br />
})<br />
.script("script8.js")<br />
.block(function(){<br />
  script8Func();<br />
});<br />
</code></p>
<p>In this chain, 4 and 5 load in parallel, then 6 and 7 load in parallel, then functions from 4-7 get executed, then 8 loads by itself, then finally a function in 8 is called.</p>
<p>The point is choice and flexibility, and balancing loading in parallel versus blocking where necessary. LABjs gives you just that, no more, no less.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BenGerrissen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274838</link>
		<dc:creator>BenGerrissen</dc:creator>
		<pubDate>Fri, 31 Jul 2009 20:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274838</guid>
		<description>@ThomasHanson
You used the &quot;business logic&quot; card on the dynamic scriptloading technology/ideas of the OP. Out of place, futile nonsense argument.

Then you go into that DHTML libraries can create business logic where it doesn&#039;t belong. Which is a whole other topic alltogether and does nothing to debunk the tech writeup of the OP.

Shamelessly promoting Ra-Ajax again in a unrelated topic?

Seriously, write a good blogpost about Ra-Ajax and send it in, I&#039;m sure Ajaxian will post about it. The way you are going about it now only harms your cause as yer being a bleep for doing it like this.

As for your indepth points about business logic ending up where it shouldn&#039;t, you&#039;re right, it&#039;s all true, except for the point where frameworks like Ra-Ajax are the best solution. Ra-Ajax is a choice and like GWT is a choice to make when you don&#039;t have the right skillsets inhouse. If you got a crackerjack ninja frontend developer or two, GWT/Ra-Ajax won&#039;t ever come close to the creative possibilities at your disposal.

Again, write a blog post on the terrors of business logic ending up where it shouldn&#039;t and make a name the RIGHT way. Instead of riding on other peoples ajaxian posts.</description>
		<content:encoded><![CDATA[<p>@ThomasHanson<br />
You used the &#8220;business logic&#8221; card on the dynamic scriptloading technology/ideas of the OP. Out of place, futile nonsense argument.</p>
<p>Then you go into that DHTML libraries can create business logic where it doesn&#8217;t belong. Which is a whole other topic alltogether and does nothing to debunk the tech writeup of the OP.</p>
<p>Shamelessly promoting Ra-Ajax again in a unrelated topic?</p>
<p>Seriously, write a good blogpost about Ra-Ajax and send it in, I&#8217;m sure Ajaxian will post about it. The way you are going about it now only harms your cause as yer being a bleep for doing it like this.</p>
<p>As for your indepth points about business logic ending up where it shouldn&#8217;t, you&#8217;re right, it&#8217;s all true, except for the point where frameworks like Ra-Ajax are the best solution. Ra-Ajax is a choice and like GWT is a choice to make when you don&#8217;t have the right skillsets inhouse. If you got a crackerjack ninja frontend developer or two, GWT/Ra-Ajax won&#8217;t ever come close to the creative possibilities at your disposal.</p>
<p>Again, write a blog post on the terrors of business logic ending up where it shouldn&#8217;t and make a name the RIGHT way. Instead of riding on other peoples ajaxian posts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kean</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274837</link>
		<dc:creator>kean</dc:creator>
		<pubDate>Fri, 31 Jul 2009 18:26:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274837</guid>
		<description>@souders I am sure the callback won&#039;t fire twice, read the Zakas&#039; code again.</description>
		<content:encoded><![CDATA[<p>@souders I am sure the callback won&#8217;t fire twice, read the Zakas&#8217; code again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274836</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Fri, 31 Jul 2009 17:05:56 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274836</guid>
		<description>@BenGerrison
I realize that you&#039;ve got your opinion and that no matter what I say it is highly unlikely that I can make you change your mind, I do however feel the urge to answer you so that others reading what you just wrote don&#039;t get the wrong impression...
.
Different Ajax Frameworks do to an extreme extend promote and &quot;dictate&quot; placement of code and functionality. And while it is (unfortunately) way too easy - all though not impossible to avoid I agree - to put business logic in the client layer (JS) with client side DHTML libraries like jQuery and such. This is way more difficult in GWT and in some frameworks like Ra-Ajax - virtually *impossible*. An example follows; Imagine you&#039;ve got a &quot;register new user form&quot;. Then you need to verify that the username is not taken before submitting to the database for insertion. In jQuery et al I suspect many developers would create some JSON backend behaving kind of like a WebService or something which would return a boolean value indicating whether or not the username was already taken or not, and if not proceed with the submission towards the database insertion logic of the &quot;insert new user&quot; logic, if not for anything else then because of the simplicity of the code. Now the stuff that happens on the client in that scenario might have many names, be it technology, code, JS code or logic. But I suspect most seasoned developers will disagree with you if you choose to not define this as business logic. Sure the checking of whether or not that username is taken or not happens physically on the server, but how to proceed in the application workflow is 100% happening purely on the client.
.
There are many things that may go wrong here, first of all the application now has a way larger attack surface and you need to check another time just before inserting the new user into your database if the user exists or not and thereby duplicating code - some other dude might have taken that username in the meantime you know, hence DRY goes out the window, not to mention what do you do if the &quot;checking&quot; goes through while the &quot;insertion&quot; says that the name has been taken already? It might pass many seconds before the insertion, after the checking... Some other user might have in that window taken that same username...!
.
Or if you&#039;re a little bit sloppy and trusts your JS a little bit too much and some user hacks your JS, modifying your variables after the checking but before the insertion...
.
Now seasoned jQuery developers will of course say that; &quot;We don&#039;t do that&quot;. And thank you Lord for that! But most developers aren&#039;t &quot;seasoned&quot;, and still if you do this operation in one &quot;atomic operation&quot; you&#039;ll still need to have logic in the client layer as to what&#039;s supposed to happen when the username is already taken...!
And this logic is what&#039;s refered to as the &quot;application workflow&quot;, or Business Logic if you wish...!
.
In a purely server-side framework, like Ra-Ajax yes, this is impossible and none of those problems are even relevant since you&#039;d be able to do the checking, insertion and potentially error reporting in one chunk of code, without any needs for doing anything in the client layer.
.
When that is said it is still possible in Managed Ajax Frameworks (like Ra) to combine Business Logic with UI code, which is sub-optimal and bad practice, but at least that &quot;bad practice code&quot; is on your server, where nobody can hack it, test its attack surface utilizing robots and JS snippets. And your &quot;dirty laundry&quot;, all though still &quot;dirty&quot; lives in a Blue Pill environment where nobody can mess with it and figure out &quot;just how dirty it actually is&quot;...
.
And the result is that your stuff is far more DRY, far easier to maintain, far more flexible to modify and extend and far more safe. And the reason is because you don&#039;t have *Business Logic* in your client layer...!
.
Fat is that DHTML libraries reduces the server to nothing but a fancy relational database implementation with support for triggers and stored procedures, while a real Ajax Application Framework - yes like GWT and Ra-Ajax - will make it possible to make your server far more capable then just push data back and forth between your database and your JavaScript...!
.
You might refer to potatoes as tomatoes, or even (falsely) claim that I am the one doing just that, but that doesn&#039;t change the facts...</description>
		<content:encoded><![CDATA[<p>@BenGerrison<br />
I realize that you&#8217;ve got your opinion and that no matter what I say it is highly unlikely that I can make you change your mind, I do however feel the urge to answer you so that others reading what you just wrote don&#8217;t get the wrong impression&#8230;<br />
.<br />
Different Ajax Frameworks do to an extreme extend promote and &#8220;dictate&#8221; placement of code and functionality. And while it is (unfortunately) way too easy &#8211; all though not impossible to avoid I agree &#8211; to put business logic in the client layer (JS) with client side DHTML libraries like jQuery and such. This is way more difficult in GWT and in some frameworks like Ra-Ajax &#8211; virtually *impossible*. An example follows; Imagine you&#8217;ve got a &#8220;register new user form&#8221;. Then you need to verify that the username is not taken before submitting to the database for insertion. In jQuery et al I suspect many developers would create some JSON backend behaving kind of like a WebService or something which would return a boolean value indicating whether or not the username was already taken or not, and if not proceed with the submission towards the database insertion logic of the &#8220;insert new user&#8221; logic, if not for anything else then because of the simplicity of the code. Now the stuff that happens on the client in that scenario might have many names, be it technology, code, JS code or logic. But I suspect most seasoned developers will disagree with you if you choose to not define this as business logic. Sure the checking of whether or not that username is taken or not happens physically on the server, but how to proceed in the application workflow is 100% happening purely on the client.<br />
.<br />
There are many things that may go wrong here, first of all the application now has a way larger attack surface and you need to check another time just before inserting the new user into your database if the user exists or not and thereby duplicating code &#8211; some other dude might have taken that username in the meantime you know, hence DRY goes out the window, not to mention what do you do if the &#8220;checking&#8221; goes through while the &#8220;insertion&#8221; says that the name has been taken already? It might pass many seconds before the insertion, after the checking&#8230; Some other user might have in that window taken that same username&#8230;!<br />
.<br />
Or if you&#8217;re a little bit sloppy and trusts your JS a little bit too much and some user hacks your JS, modifying your variables after the checking but before the insertion&#8230;<br />
.<br />
Now seasoned jQuery developers will of course say that; &#8220;We don&#8217;t do that&#8221;. And thank you Lord for that! But most developers aren&#8217;t &#8220;seasoned&#8221;, and still if you do this operation in one &#8220;atomic operation&#8221; you&#8217;ll still need to have logic in the client layer as to what&#8217;s supposed to happen when the username is already taken&#8230;!<br />
And this logic is what&#8217;s refered to as the &#8220;application workflow&#8221;, or Business Logic if you wish&#8230;!<br />
.<br />
In a purely server-side framework, like Ra-Ajax yes, this is impossible and none of those problems are even relevant since you&#8217;d be able to do the checking, insertion and potentially error reporting in one chunk of code, without any needs for doing anything in the client layer.<br />
.<br />
When that is said it is still possible in Managed Ajax Frameworks (like Ra) to combine Business Logic with UI code, which is sub-optimal and bad practice, but at least that &#8220;bad practice code&#8221; is on your server, where nobody can hack it, test its attack surface utilizing robots and JS snippets. And your &#8220;dirty laundry&#8221;, all though still &#8220;dirty&#8221; lives in a Blue Pill environment where nobody can mess with it and figure out &#8220;just how dirty it actually is&#8221;&#8230;<br />
.<br />
And the result is that your stuff is far more DRY, far easier to maintain, far more flexible to modify and extend and far more safe. And the reason is because you don&#8217;t have *Business Logic* in your client layer&#8230;!<br />
.<br />
Fat is that DHTML libraries reduces the server to nothing but a fancy relational database implementation with support for triggers and stored procedures, while a real Ajax Application Framework &#8211; yes like GWT and Ra-Ajax &#8211; will make it possible to make your server far more capable then just push data back and forth between your database and your JavaScript&#8230;!<br />
.<br />
You might refer to potatoes as tomatoes, or even (falsely) claim that I am the one doing just that, but that doesn&#8217;t change the facts&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WillPeavy</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274835</link>
		<dc:creator>WillPeavy</dc:creator>
		<pubDate>Fri, 31 Jul 2009 14:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274835</guid>
		<description>@ThomasHansen - what if you are designing web apps that need to support thousands of concurrent users at large companies? You could (1) put as much processing as possible on the servers, thus creating the need to spend more money on servers, or (2) put more processing on the client-side and make use existing client resources that would otherwise be unused. 

Option 1 may be best in some situations, but Option 2 is commonly the best way in 2009, especially if clients are using modern browsers.</description>
		<content:encoded><![CDATA[<p>@ThomasHansen &#8211; what if you are designing web apps that need to support thousands of concurrent users at large companies? You could (1) put as much processing as possible on the servers, thus creating the need to spend more money on servers, or (2) put more processing on the client-side and make use existing client resources that would otherwise be unused. </p>
<p>Option 1 may be best in some situations, but Option 2 is commonly the best way in 2009, especially if clients are using modern browsers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BenGerrissen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274827</link>
		<dc:creator>BenGerrissen</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274827</guid>
		<description>@ThomasHansen
First read and LEARN what business logic is, people use this term too loosely and tend to toss it up whenever some coding comes up that starts to look like real programming or code management.

&quot;Technology&quot; and &quot;business logic&quot; are NOT interchangable and business logic does not exclude client sided code management nor does it dictate that client sided code should be served through another language like java (GWT).

From what I&#039;ve seen from GWT is that the ideal seperation of logic and presentation gets thrown out of the window and in fact, those kind of frameworks have a bigger risk of mixing business logic (which does indeed belong on the backend) into frontend logic. I suspect Ra-Ajax has the same risks.

Nay technology does not equal business logic and keeping business logic where it belongs is more a matter of knowledge and wits rather then what technologies you choose to use...</description>
		<content:encoded><![CDATA[<p>@ThomasHansen<br />
First read and LEARN what business logic is, people use this term too loosely and tend to toss it up whenever some coding comes up that starts to look like real programming or code management.</p>
<p>&#8220;Technology&#8221; and &#8220;business logic&#8221; are NOT interchangable and business logic does not exclude client sided code management nor does it dictate that client sided code should be served through another language like java (GWT).</p>
<p>From what I&#8217;ve seen from GWT is that the ideal seperation of logic and presentation gets thrown out of the window and in fact, those kind of frameworks have a bigger risk of mixing business logic (which does indeed belong on the backend) into frontend logic. I suspect Ra-Ajax has the same risks.</p>
<p>Nay technology does not equal business logic and keeping business logic where it belongs is more a matter of knowledge and wits rather then what technologies you choose to use&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274825</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Fri, 31 Jul 2009 09:09:14 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274825</guid>
		<description>@tercero12 - and others ...
I haven&#039;t said anything against Ajax, in fact that would be pretty weird since I&#039;ve exclusively worked with Ajax for many years now myself. What I do however propose, and what I feel especially tercero12 misunderstood is that we move the business logic away from the client and into the server. It&#039;s still possible - in fact way easier to be honest - to create really rich Ajax functionality, running exclusively in the browser. Like for instance we&#039;re demonstrating here; http://ra-ajax.org/samples/CRM-Sample.aspx - or here; http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx
.
None of those samples doesn&#039;t contains even *one* line of &quot;Custom JavaScript&quot;. Both of them are exclusively built purely on the server. Then they are being rendered back to the client automatically without the developer even needing to know that there&#039;s any JavaScript at all existing to tie things together. In a way it&#039;s a little bit similar to what GWT does (not really actually, but it&#039;s the only way I can get people to understand it)
.
I realize that this concept, and my ideas, are old news for most seasoned visitors at Ajaxian, and I am sorry for repeating theme, but I felt a little bit of clarification was needed for some of the new commenters at this Ajaxian...</description>
		<content:encoded><![CDATA[<p>@tercero12 &#8211; and others &#8230;<br />
I haven&#8217;t said anything against Ajax, in fact that would be pretty weird since I&#8217;ve exclusively worked with Ajax for many years now myself. What I do however propose, and what I feel especially tercero12 misunderstood is that we move the business logic away from the client and into the server. It&#8217;s still possible &#8211; in fact way easier to be honest &#8211; to create really rich Ajax functionality, running exclusively in the browser. Like for instance we&#8217;re demonstrating here; <a href="http://ra-ajax.org/samples/CRM-Sample.aspx" rel="nofollow">http://ra-ajax.org/samples/CRM-Sample.aspx</a> &#8211; or here; <a href="http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx" rel="nofollow">http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx</a><br />
.<br />
None of those samples doesn&#8217;t contains even *one* line of &#8220;Custom JavaScript&#8221;. Both of them are exclusively built purely on the server. Then they are being rendered back to the client automatically without the developer even needing to know that there&#8217;s any JavaScript at all existing to tie things together. In a way it&#8217;s a little bit similar to what GWT does (not really actually, but it&#8217;s the only way I can get people to understand it)<br />
.<br />
I realize that this concept, and my ideas, are old news for most seasoned visitors at Ajaxian, and I am sorry for repeating theme, but I felt a little bit of clarification was needed for some of the new commenters at this Ajaxian&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alexanmtz</title>
		<link>http://ajaxian.com/archives/loadingjs/comment-page-1#comment-274818</link>
		<dc:creator>alexanmtz</dc:creator>
		<pubDate>Thu, 30 Jul 2009 22:45:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7168#comment-274818</guid>
		<description>I develop a jQuery plugin that follow these guidelines and load css too:
http://plugins.jquery.com/project/includedemand

Hope everyone enjoy it. Load script on demand this way it&#039;s very usefull, for jQuery mainly, you can load just the plugins that is used in that script.

Great article, this is a recurrent subject here...</description>
		<content:encoded><![CDATA[<p>I develop a jQuery plugin that follow these guidelines and load css too:<br />
<a href="http://plugins.jquery.com/project/includedemand" rel="nofollow">http://plugins.jquery.com/project/includedemand</a></p>
<p>Hope everyone enjoy it. Load script on demand this way it&#8217;s very usefull, for jQuery mainly, you can load just the plugins that is used in that script.</p>
<p>Great article, this is a recurrent subject here&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

