<?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: Is easy implementation the same as good code?</title>
	<atom:link href="http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code</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: Kingsley2</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261431</link>
		<dc:creator>Kingsley2</dc:creator>
		<pubDate>Mon, 18 Feb 2008 05:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261431</guid>
		<description>Depends on what you make money off of. If more badges displayed on more pages = more money for you, ease of badge embedding wins.

Although, I think you can make a nice badge-maker or something that&#039;ll churn out decent embed code. That&#039;ll probably make it even easier to embed than editing html attribs.</description>
		<content:encoded><![CDATA[<p>Depends on what you make money off of. If more badges displayed on more pages = more money for you, ease of badge embedding wins.</p>
<p>Although, I think you can make a nice badge-maker or something that&#8217;ll churn out decent embed code. That&#8217;ll probably make it even easier to embed than editing html attribs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilazarte</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261375</link>
		<dc:creator>ilazarte</dc:creator>
		<pubDate>Thu, 14 Feb 2008 18:53:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261375</guid>
		<description>ok, the code tag does nothing, i give up :)  happy valentines day!</description>
		<content:encoded><![CDATA[<p>ok, the code tag does nothing, i give up :)  happy valentines day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilazarte</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261374</link>
		<dc:creator>ilazarte</dc:creator>
		<pubDate>Thu, 14 Feb 2008 18:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261374</guid>
		<description>Hm... the above didn&#039;t work, let&#039;s try again.

&lt;code&gt;
Brandname
&lt;/code&gt;

Why not make it a query string?  Seems like this particular example was reinventing the wheel.</description>
		<content:encoded><![CDATA[<p>Hm&#8230; the above didn&#8217;t work, let&#8217;s try again.</p>
<p><code><br />
Brandname<br />
</code></p>
<p>Why not make it a query string?  Seems like this particular example was reinventing the wheel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilazarte</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261373</link>
		<dc:creator>ilazarte</dc:creator>
		<pubDate>Thu, 14 Feb 2008 18:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261373</guid>
		<description>Brandname</description>
		<content:encoded><![CDATA[<p>Brandname</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lon42</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261349</link>
		<dc:creator>Lon42</dc:creator>
		<pubDate>Wed, 13 Feb 2008 17:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261349</guid>
		<description>do you need to loop all script-tags? isn&#039;t the last script tag the current?</description>
		<content:encoded><![CDATA[<p>do you need to loop all script-tags? isn&#8217;t the last script tag the current?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stimpy77</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261347</link>
		<dc:creator>stimpy77</dc:creator>
		<pubDate>Wed, 13 Feb 2008 17:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261347</guid>
		<description>&quot;Security concerns and invalid HTML aside (the attributes - content inside a script is valid and should be ignored according to the W3C when a src attribute is present)&quot;

HTML == SGML and is not strict about undeclared insertions of attributes.

XHTML == strict XML and invalidates undeclared insertions of attributes.

Don&#039;t confuse the two. HTML 4.01 is still good stuff; XHTML is overrated.</description>
		<content:encoded><![CDATA[<p>&#8220;Security concerns and invalid HTML aside (the attributes &#8211; content inside a script is valid and should be ignored according to the W3C when a src attribute is present)&#8221;</p>
<p>HTML == SGML and is not strict about undeclared insertions of attributes.</p>
<p>XHTML == strict XML and invalidates undeclared insertions of attributes.</p>
<p>Don&#8217;t confuse the two. HTML 4.01 is still good stuff; XHTML is overrated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: broofa</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261346</link>
		<dc:creator>broofa</dc:creator>
		<pubDate>Wed, 13 Feb 2008 16:29:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261346</guid>
		<description>@arapehl: I think we&#039;re basically in agreement.  The only distinction I&#039;d make here is the difference between importing one 3rd party script multiple times (the case referred to in the original article) .vs. calling many different 3rd party scripts, which you&#039;re alluding to.  The former case is a non-issue due to caching, as I said. The latter case, as you point out, can be problematic.  However as long as the 3rd party servers have as good/better performance then site hosting the page than it&#039;s not that big a deal.  Which is why google ads, analytics, flickr - the high profile sites you mention, in fact - are able to do this _without_ it being a problem.  They put a lot of time and energy into making sure those services are robust and *fast* because if they don&#039;t serve those scripts reliably, they lose customers and $$$. But will myRandomLittleSite.com prove as reliable? &#039;Depends on who they&#039;re hosting with I expect.</description>
		<content:encoded><![CDATA[<p>@arapehl: I think we&#8217;re basically in agreement.  The only distinction I&#8217;d make here is the difference between importing one 3rd party script multiple times (the case referred to in the original article) .vs. calling many different 3rd party scripts, which you&#8217;re alluding to.  The former case is a non-issue due to caching, as I said. The latter case, as you point out, can be problematic.  However as long as the 3rd party servers have as good/better performance then site hosting the page than it&#8217;s not that big a deal.  Which is why google ads, analytics, flickr &#8211; the high profile sites you mention, in fact &#8211; are able to do this _without_ it being a problem.  They put a lot of time and energy into making sure those services are robust and *fast* because if they don&#8217;t serve those scripts reliably, they lose customers and $$$. But will myRandomLittleSite.com prove as reliable? &#8216;Depends on who they&#8217;re hosting with I expect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arapehl</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261345</link>
		<dc:creator>arapehl</dc:creator>
		<pubDate>Wed, 13 Feb 2008 16:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261345</guid>
		<description>@Jon: A badge, as in, the little widget you can get from Flickr to put your pictures on your own site.

@broofa &amp; @sentientholon: Third party script implementations are inherently slow because you need to poll yet another server for content and are completely at the mercy of its present lag conditions. Not only that, but odds are that a site using third party scripts isn&#039;t using just one (analytics script, a couple of badges, etc...) so your level of uncertainty and lag time just multiply in those situations. Worse still, if you drop a script tag in the middle of your page or at the top, and you happen to be trying to access the page during a particularly high traffic period for that service (say Flickr, or Google Analtytics), then you *will* have to wait for that server to respond before your page finishes rendering. And that is very noticeable.  Lastly, using non-standard attributes is just bad karma. I&#039;ve found repeatedly in the past that if you break away from the standard, you&#039;re opening yourself up to a wide breadth of unintended consequences. Basically the unknown. You know, somewhere down the line, some conditions arise and you end up with an &quot;oops, didn&#039;t think of that&quot; situation.

Just sayin&#039;...</description>
		<content:encoded><![CDATA[<p>@Jon: A badge, as in, the little widget you can get from Flickr to put your pictures on your own site.</p>
<p>@broofa &amp; @sentientholon: Third party script implementations are inherently slow because you need to poll yet another server for content and are completely at the mercy of its present lag conditions. Not only that, but odds are that a site using third party scripts isn&#8217;t using just one (analytics script, a couple of badges, etc&#8230;) so your level of uncertainty and lag time just multiply in those situations. Worse still, if you drop a script tag in the middle of your page or at the top, and you happen to be trying to access the page during a particularly high traffic period for that service (say Flickr, or Google Analtytics), then you *will* have to wait for that server to respond before your page finishes rendering. And that is very noticeable.  Lastly, using non-standard attributes is just bad karma. I&#8217;ve found repeatedly in the past that if you break away from the standard, you&#8217;re opening yourself up to a wide breadth of unintended consequences. Basically the unknown. You know, somewhere down the line, some conditions arise and you end up with an &#8220;oops, didn&#8217;t think of that&#8221; situation.</p>
<p>Just sayin&#8217;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Hartmann</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261342</link>
		<dc:creator>Jon Hartmann</dc:creator>
		<pubDate>Wed, 13 Feb 2008 15:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261342</guid>
		<description>Am I alone in wondering what the heck a badge is, and why it would need to be loaded from a third party?</description>
		<content:encoded><![CDATA[<p>Am I alone in wondering what the heck a badge is, and why it would need to be loaded from a third party?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sentientholon</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261341</link>
		<dc:creator>sentientholon</dc:creator>
		<pubDate>Wed, 13 Feb 2008 14:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261341</guid>
		<description>I agree with the last commenter: performance isn&#039;t going to be a concern here, the issue is correctness.  Something like this is just simple, just as easy to understand, and a lot more correct.  And under the hood, there&#039;s no good reason why Badge.create() couldn&#039;t do its work on the cheap, by doing document.write()&#039;s or whatever.

&lt;script src=&quot;badge.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;Badge.create(&#039;small&#039;, &#039;blue&#039;, &#039;ABC&#039;);&lt;/script&gt;
&lt;script&gt;Badge.create(&#039;big&#039;, &#039;red&#039;, &#039;XYZ&#039;);&lt;/script&gt;

Is this harder to understand?</description>
		<content:encoded><![CDATA[<p>I agree with the last commenter: performance isn&#8217;t going to be a concern here, the issue is correctness.  Something like this is just simple, just as easy to understand, and a lot more correct.  And under the hood, there&#8217;s no good reason why Badge.create() couldn&#8217;t do its work on the cheap, by doing document.write()&#8217;s or whatever.</p>
<p>&lt;script src=&#8221;badge.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script&gt;Badge.create(&#8216;small&#8217;, &#8216;blue&#8217;, &#8216;ABC&#8217;);&lt;/script&gt;<br />
&lt;script&gt;Badge.create(&#8216;big&#8217;, &#8216;red&#8217;, &#8216;XYZ&#8217;);&lt;/script&gt;</p>
<p>Is this harder to understand?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: broofa</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261340</link>
		<dc:creator>broofa</dc:creator>
		<pubDate>Wed, 13 Feb 2008 14:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261340</guid>
		<description>The issues mentioned above don&#039;t seem valid to me. Here&#039;s why ...

Issue #1, &quot;looping through script nodes is slow&quot;. Only true if there are 1000&#039;s of nodes in the DOM.  Even then, getElementsByTagName is probably very performant compared to the rendering time required for a DOM of that size.  I don&#039;t see this as something to be concerned about.

Issue #2, &quot;badge.js is called over and over again&quot;: Only true if the browser doesn&#039;t cache the script.  But if you set the HTTP caching headers properly this won&#039;t be an issue.  The script is small enough that fetching it _from the cache_ repeatedly should be fairly fast.

Issue #3, &quot;script tags make the rendering engine stop and pull the src&quot;: This is just a restatement of Issues #1 and #2.  The engine stops while it fetches the source (see Issue #2) and executes the script (see issue #1).

The &quot;real&quot; problems are...

1. The use of non-standard HTML attributes for the script tag
2. The equally-questionable practice of placing non-script content inside a script block
3. Page rendering depends on 3rd party servers to be performing well

The alternative solutions address the first and second issues, but still require script hosted on external servers. (that said, including the script at the end of the page will moderate the effects of said servers not responding in a timely manner).

In many cases, the best solution to this sort of problem is to provide a &quot;configurator&quot; tool that provides a friendly interface for generating the desired HTML markup, which users then simply paste into their page.

  - Explains all the options to users
  - Allows them to experiment and preview
  - Inline code renders immediately
  - Inline code doesn&#039;t require scripting DOM elements
  - Inline code doesn&#039;t depend on 3rd party servers</description>
		<content:encoded><![CDATA[<p>The issues mentioned above don&#8217;t seem valid to me. Here&#8217;s why &#8230;</p>
<p>Issue #1, &#8220;looping through script nodes is slow&#8221;. Only true if there are 1000&#8242;s of nodes in the DOM.  Even then, getElementsByTagName is probably very performant compared to the rendering time required for a DOM of that size.  I don&#8217;t see this as something to be concerned about.</p>
<p>Issue #2, &#8220;badge.js is called over and over again&#8221;: Only true if the browser doesn&#8217;t cache the script.  But if you set the HTTP caching headers properly this won&#8217;t be an issue.  The script is small enough that fetching it _from the cache_ repeatedly should be fairly fast.</p>
<p>Issue #3, &#8220;script tags make the rendering engine stop and pull the src&#8221;: This is just a restatement of Issues #1 and #2.  The engine stops while it fetches the source (see Issue #2) and executes the script (see issue #1).</p>
<p>The &#8220;real&#8221; problems are&#8230;</p>
<p>1. The use of non-standard HTML attributes for the script tag<br />
2. The equally-questionable practice of placing non-script content inside a script block<br />
3. Page rendering depends on 3rd party servers to be performing well</p>
<p>The alternative solutions address the first and second issues, but still require script hosted on external servers. (that said, including the script at the end of the page will moderate the effects of said servers not responding in a timely manner).</p>
<p>In many cases, the best solution to this sort of problem is to provide a &#8220;configurator&#8221; tool that provides a friendly interface for generating the desired HTML markup, which users then simply paste into their page.</p>
<p>  &#8211; Explains all the options to users<br />
  &#8211; Allows them to experiment and preview<br />
  &#8211; Inline code renders immediately<br />
  &#8211; Inline code doesn&#8217;t require scripting DOM elements<br />
  &#8211; Inline code doesn&#8217;t depend on 3rd party servers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arapehl</title>
		<link>http://ajaxian.com/archives/is-easy-implementation-the-same-as-good-code/comment-page-1#comment-261339</link>
		<dc:creator>arapehl</dc:creator>
		<pubDate>Wed, 13 Feb 2008 13:42:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3330#comment-261339</guid>
		<description>One of my pet peeves is having to wait for 3rd party scripts to load when visiting a site. It&#039;s also one of the least addressed issues on the web. The accepted dogma is, &quot;just plug this into your site and forget&quot;, except that in doing so, sites slow way down because of it. So reducing the number of times a 3rd party scripts are called is a big thing for me. Thanks for putting the effort into this article.</description>
		<content:encoded><![CDATA[<p>One of my pet peeves is having to wait for 3rd party scripts to load when visiting a site. It&#8217;s also one of the least addressed issues on the web. The accepted dogma is, &#8220;just plug this into your site and forget&#8221;, except that in doing so, sites slow way down because of it. So reducing the number of times a 3rd party scripts are called is a big thing for me. Thanks for putting the effort into this article.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

