<?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: Shrinking JS or CSS is premature optimization</title>
	<atom:link href="http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization/feed" rel="self" type="application/rss+xml" />
	<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization</link>
	<description>A .NET developer in Redmond</description>
	<lastBuildDate>Sun, 14 Mar 2010 14:22:22 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrew Donaldson</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5333</link>
		<dc:creator>Andrew Donaldson</dc:creator>
		<pubDate>Tue, 27 Nov 2007 16:39:37 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5333</guid>
		<description>Hey Damieng,

Someone had a similar discussion a while ago which ended out in the creation of a rails plugin called &#039;asset packager&#039; (http://synthesis.sbecker.net/pages/asset_packager). I think this is part of Rails now (or will be in future) but the underlying concept is probably one that can be ported.

Basically, whilst in development mode you access your files as normal. When your site is set to production mode, it looks for the compressed script files which are built (and compacted into one file as Corey mentioned) using a build script when you update your site.

The compressed files don&#039;t go anywhere near your version control, and as long as you keep your javascript tidy (semi-colons, damnit!) it melds into your workflow.

Couple this (as you&#039;ve said) with server-side compression and you&#039;ve got a nice &#039;free&#039; performance boost.</description>
		<content:encoded><![CDATA[<p>Hey Damieng,</p>
<p>Someone had a similar discussion a while ago which ended out in the creation of a rails plugin called &#8216;asset packager&#8217; (<a href="http://synthesis.sbecker.net/pages/asset_packager" rel="nofollow">http://synthesis.sbecker.net/pages/asset_packager</a>). I think this is part of Rails now (or will be in future) but the underlying concept is probably one that can be ported.</p>
<p>Basically, whilst in development mode you access your files as normal. When your site is set to production mode, it looks for the compressed script files which are built (and compacted into one file as Corey mentioned) using a build script when you update your site.</p>
<p>The compressed files don&#8217;t go anywhere near your version control, and as long as you keep your javascript tidy (semi-colons, damnit!) it melds into your workflow.</p>
<p>Couple this (as you&#8217;ve said) with server-side compression and you&#8217;ve got a nice &#8216;free&#8217; performance boost.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Corey</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5329</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Tue, 27 Nov 2007 14:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5329</guid>
		<description>Another advantage of a tool like Ricks is that it can consolidate many javascript files into one.  This has the effect of reducing HTTP requests on top of the smaller file size.  Reducing http requests and minimizing javascript and css files are both reccomended by YSlow</description>
		<content:encoded><![CDATA[<p>Another advantage of a tool like Ricks is that it can consolidate many javascript files into one.  This has the effect of reducing HTTP requests on top of the smaller file size.  Reducing http requests and minimizing javascript and css files are both reccomended by YSlow</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5328</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Tue, 27 Nov 2007 12:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5328</guid>
		<description>Yeah I&#039;d agree that having shrinking as part of the build process to release/production architectures has some merit and avoids the major issues leaving only the question of trying to debug production-only problems where the error could be the result of changes between debug and release but it&#039;s pretty rare.

Like most languages JavaScript should be particularly well suited to the Huffman algorithm of GZip and combining multiple JS files into one could see further gains.

Thanks for the compliments on the posts, trying to keep them more regularly paced than before but I&#039;ve now run out of hashing algorithm filler ;-)

[)amien</description>
		<content:encoded><![CDATA[<p>Yeah I&#8217;d agree that having shrinking as part of the build process to release/production architectures has some merit and avoids the major issues leaving only the question of trying to debug production-only problems where the error could be the result of changes between debug and release but it&#8217;s pretty rare.</p>
<p>Like most languages JavaScript should be particularly well suited to the Huffman algorithm of GZip and combining multiple JS files into one could see further gains.</p>
<p>Thanks for the compliments on the posts, trying to keep them more regularly paced than before but I&#8217;ve now run out of hashing algorithm filler ;-)</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reggie Drake</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5327</link>
		<dc:creator>Reggie Drake</dc:creator>
		<pubDate>Tue, 27 Nov 2007 12:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5327</guid>
		<description>Definitely don&#039;t minimize scripts on sites you are still working on -- but in production, there isn&#039;t that much added value to having readable scripts. Files with much comments can often be shrunk to half their size or smaller.</description>
		<content:encoded><![CDATA[<p>Definitely don&#8217;t minimize scripts on sites you are still working on &#8212; but in production, there isn&#8217;t that much added value to having readable scripts. Files with much comments can often be shrunk to half their size or smaller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Transom</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5324</link>
		<dc:creator>Dave Transom</dc:creator>
		<pubDate>Tue, 27 Nov 2007 12:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5324</guid>
		<description>Hey Damien,

Seeing the difference in the &#039;gzip&#039; vrs &#039;gzip and minified&#039; version of the library certainly seems minimal, so you could take it or leave it.

I think Gavri makes a good point. It&#039;s a fairly common and well known optimisation to minify and compress javascript and css files - every little bit helps, especially since we seem to be writing bigger client side files. It&#039;s not exactly premature, but there is credence in your words &quot;measuring the problem and result first&quot;.

We&#039;ve been using YUI-Compressor as an MS Build task using Web Deployment Projects, so the source is minified as part of the release deployment process - and it rocks. It means we can develop and debug with full source, pass QA, then deploy the production ready code. It&#039;s simple, once established takes no additional time, doesn&#039;t interfere with the development process and gives the best performance on the client side. Actually, if you use a fairly descent minifier, you can pick up a few warnings you may have missed during development.

I&#039;m a firm believer that all changes (projects for that matter) should be source controlled. Here, minifying the source has an added benefit of deterring minified files being modified - at least, I&#039;d hope they&#039;d think twice, looking at long lines of code, with the only meaningful member names being on the public side. More than likely their non-source controlled items will be overwritten at the next deployment.

Keep up the good posts (I&#039;ve been subscribed for about 10 posts now :)

Dave</description>
		<content:encoded><![CDATA[<p>Hey Damien,</p>
<p>Seeing the difference in the &#8216;gzip&#8217; vrs &#8216;gzip and minified&#8217; version of the library certainly seems minimal, so you could take it or leave it.</p>
<p>I think Gavri makes a good point. It&#8217;s a fairly common and well known optimisation to minify and compress javascript and css files &#8211; every little bit helps, especially since we seem to be writing bigger client side files. It&#8217;s not exactly premature, but there is credence in your words &#8220;measuring the problem and result first&#8221;.</p>
<p>We&#8217;ve been using YUI-Compressor as an MS Build task using Web Deployment Projects, so the source is minified as part of the release deployment process &#8211; and it rocks. It means we can develop and debug with full source, pass QA, then deploy the production ready code. It&#8217;s simple, once established takes no additional time, doesn&#8217;t interfere with the development process and gives the best performance on the client side. Actually, if you use a fairly descent minifier, you can pick up a few warnings you may have missed during development.</p>
<p>I&#8217;m a firm believer that all changes (projects for that matter) should be source controlled. Here, minifying the source has an added benefit of deterring minified files being modified &#8211; at least, I&#8217;d hope they&#8217;d think twice, looking at long lines of code, with the only meaningful member names being on the public side. More than likely their non-source controlled items will be overwritten at the next deployment.</p>
<p>Keep up the good posts (I&#8217;ve been subscribed for about 10 posts now :)</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5322</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Tue, 27 Nov 2007 11:58:28 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5322</guid>
		<description>It&#039;s premature if you are optimizing before you have a specific measurable problem and it will negatively impact the development process.

The code output by the minifier and other shrinking tools is incredibly difficult to work with should you need to debug or change it.

Sure you might have another unshrunk copy somewhere but what if somebody has modified the compressed version. How exactly would you diff that?

[)amien</description>
		<content:encoded><![CDATA[<p>It&#8217;s premature if you are optimizing before you have a specific measurable problem and it will negatively impact the development process.</p>
<p>The code output by the minifier and other shrinking tools is incredibly difficult to work with should you need to debug or change it.</p>
<p>Sure you might have another unshrunk copy somewhere but what if somebody has modified the compressed version. How exactly would you diff that?</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavri Fernandez</title>
		<link>http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5321</link>
		<dc:creator>Gavri Fernandez</dc:creator>
		<pubDate>Tue, 27 Nov 2007 11:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/27/shrinking-js-or-css-is-premature-optimization#comment-5321</guid>
		<description>I don&#039;t see how compressing responses is premature. It&#039;s not early in the development process. In fact, it can be the very last step. 

Premature optimization is evil because you optimize with vague notions and at an early stage. At a stage that hinders development.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see how compressing responses is premature. It&#8217;s not early in the development process. In fact, it can be the very last step. </p>
<p>Premature optimization is evil because you optimize with vague notions and at an early stage. At a stage that hinders development.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
