<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>techfounder &#187; Javascript</title>
	<atom:link href="http://www.techfounder.net/category/webdev/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techfounder.net</link>
	<description>Blog about web development and Internet entrepreneurship</description>
	<lastBuildDate>Mon, 21 Jun 2010 19:41:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Creating embedabble widgets</title>
		<link>http://www.techfounder.net/2010/02/05/creating-embedabble-widgets/</link>
		<comments>http://www.techfounder.net/2010/02/05/creating-embedabble-widgets/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 03:38:39 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=461</guid>
		<description><![CDATA[Distribution of embeddable widgets is a common feature in many web services today. The most well known example is probably google's adsense that allows site owners to add google ads to their sites. Embeddable widgets allow a subset of functionality to be used on third-party sites, greatly increasing possible market reach for a web service [...]]]></description>
			<content:encoded><![CDATA[<p>Distribution of embeddable widgets is a common feature in many web services today. The most well known example is probably google's adsense that allows site owners to add google ads to their sites. Embeddable widgets allow a subset of functionality to be used on third-party sites, greatly increasing possible market reach for a web service / application.<br />
<span id="more-461"></span></p>
<h2>What is a [web] widget</h2>
<blockquote><p>... a <strong>web widget</strong> is a portable chunk of code that can be installed  and executed within any separate HTML-based web  page by an end user without requiring additional compilation.<br />
<a href="http://en.wikipedia.org/wiki/Web_widget" target="_blank">Web widget by Wikipedia</a></p></blockquote>
<p>Put simply, we need to provide prospective site owners with a short piece of code (henceforth, the "embed code") that they can place on their sites and have the widget appear without any additional modifications to the site.</p>
<p>How would we go about creating an embeddable widget?</p>
<h2>Cross-site scripting (XSS)</h2>
<p>Cross-site scripting is more often mentioned as a <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank">web vulnerability</a> which uses the same technique maliciously to manipulate the target site. In this case, Javascript will be used to create the widget on the host site and not to attack it (you should always beware of including scripts from untrusted sources).</p>
<p>This technique is based on embedding a script &lt;tag&gt; on the host site that will refer to a script residing on your service. The script should then dynamically create the widget on the host site by manipulating the DOM and adding stylesheets and script tags as needed. Dr. Nic gives a nice overview of this technique in <a href="http://drnicwilliams.com/2006/11/21/diy-widgets/" target="_blank">this detailed tutorial</a>.</p>
<p>As the tutorial mentions, your embeddable script should have a unique namespace to avoid colliding with local scripts on the host site. Don't be shy to use a long and verbose name for this purpose. Example:</p>
<pre class="javascript">;<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> techfounder_super_embed = window.<span style="color: #006600;">techfounder_super_embed</span> = <span style="color: #66cc66;">&#123;</span>
		init: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'embedded!'</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>;
	techfounder_super_embed.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>Some quick notes:</p>
<ul>
<li>I used a self executing anonymous function. This allows me to declare additional variables and functions other than my main namespace ('techfounder_super_embed' in this case) without polluting the main scope or interferring with existing code on the site.</li>
<li>In order for the main namespace to be available outside of the anonymous function scope, I attach it to the window object.</li>
<li>I preceded the function with a semi-colon to close any potentially open Javascript statement that might have been loaded before it, which would have resulted in an error.</li>
</ul>
<p>As opposed to the advice given in Dr. Nic's article, I usually opt to use an external library such as jQuery, in order to better account for cross-browser differences as well as leverage the power inherent in such libraries. jQuery in particular has the useful <a href="http://api.jquery.com/jQuery.noConflict/" target="_blank">noConflict()</a> method which allows it to work side-by-side with other libraries, and can be loaded from a <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" target="_blank">google CDN</a> so it does not add bandwidth load on your server.</p>
<p>As for retrieving data cross-site (from your service server to the host site), there are 3 paths you could take:</p>
<ul>
<li>Embedding extra script tags which include JSON data that is constructed dynamically (as shown in Dr. Nic's tutorial).</li>
<li>Creating an Iframe element that accesses a remote resource (ie, on your server) to retrieve the data, and then passing the data back to the document.</li>
<li>Using a <a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/" target="_blank">JSONP</a> call to simulate a cross-site AJAX request. I personally opt for this technique as I find it the most elegant. jQuery <a href="http://api.jquery.com/jQuery.getJSON/" target="_blank">supports this natively</a> in recent versions, making it almost too easy to implement.</li>
</ul>
<p>An important note to keep in mind that styling the widget elements should be done very explicitly. As the widget is embedded directly into the host document it could be affected by any previously loaded stylesheets. A good start would be to use a CSS reset (such as <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">this one</a> by Eric Meyer) and apply it directly to a unique ID that identifies the base widget element.</p>
<h2>Iframe embedding</h2>
<p>An Iframe is the most direct approach to including content from a remote site. It's easy to pass arguments in the Iframe source URL and have a response dynamically built in return. However the Iframe approach suffers from some limitations:</p>
<ul>
<li>You have to specify the Iframe proportions in the embed code and it should match the content exactly, else the content can get truncated. This also means the embed code would need to change if the widget appearance changes (which comes up often for customizable widgets).</li>
<li>There are some security limitations for Iframe scripting, so if you need to manipulate the host site page in any additional way,  you would need to include a script &lt;tag&gt; as well in the initial embed code to <a href="http://www.nczonline.net/blog/2009/09/15/iframes-onload-and-documentdomain/" target="_blank">bypass the security restrictions</a>.</li>
<li>Iframes are invalid markup in XHTML Strict doctype. Depending on the host site doctype declaration, this could present a minor issue (if the host site owner is concerned about with valid markup).</li>
</ul>
<p>A big advantage in using an Iframe over directly embedding the widget in the host page is that you don't have to be concerned with external styles affecting the widget.</p>
<h2>Which should you use</h2>
<p>Cross site scripting is useful when there is a need to dynamically manipulate the host site page. This would include placing the widget in positions different to where the embed code was placed at, offering additional user-interface interactions or communicating data back to your server (as Google analytics does, for example).</p>
<p>The Iframe approach is useful when you can tell ahead of time the exact size of the embedded widget, and you only want it to display content and not offer any Javascript interactions that occur outside of the Iframe.</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=461" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2010%2F02%2F05%2Fcreating-embedabble-widgets%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2010%2F02%2F05%2Fcreating-embedabble-widgets%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2010/02/05/creating-embedabble-widgets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making web-pages go faster using PHP</title>
		<link>http://www.techfounder.net/2008/11/16/making-web-pages-go-faster-using-php/</link>
		<comments>http://www.techfounder.net/2008/11/16/making-web-pages-go-faster-using-php/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 04:52:06 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=121</guid>
		<description><![CDATA[UI responsiveness is one of the basics of a good user experience. In the web environment, this often translates to the loading time of pages. As it might be expected, there are several techniques to optimize the delivery of web pages. The Exceptional Performance guide by Yahoo is a great resource for a multitude of [...]]]></description>
			<content:encoded><![CDATA[<p>UI responsiveness is <a href="http://www.useit.com/papers/responsetime.html" target="_blank">one of the basics</a> of a good user experience. In the web environment, this often translates to the loading time of pages.</p>
<p>As it might be expected, there are several techniques to optimize the delivery of web pages. The <a title="Yahoo Exceptional Performance" href="http://developer.yahoo.com/performance/" target="_blank">Exceptional Performance</a> guide by Yahoo is a great resource for a multitude of optimizations practices, including specifically two techniques which I will address in this article - script <a title="Yahoo on minifying javascript" href="http://developer.yahoo.net/blog/archives/2007/07/high_performanc_8.html" target="_blank">minifcation</a> and <a title="The Yahoo blog on combining scripts" href="http://yuiblog.com/blog/2008/07/21/performance-research-part-6/" target="_blank">concatenation</a>.<br />
<span id="more-121"></span></p>
<h2>Reducing script size and the number of request</h2>
<p>Modern web sites and web application serve increasingly heavier javascript and CSS files. The price for the increase in script payload is felt both on the client side, where loading time increase making pages feel slugish, and on the server side, where bandwidth and requests are at a premium.</p>
<p>Javascript files especially block the browser while downloading (no more than 2 components can be downloaded simultaneously as per <a title="HTML Specifications HTTP/1.1" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4" target="_blank">HTML specifications</a>), and are the type of scripts seeing the steepest increase in size in the last several years.</p>
<h2>Minification and concatenation</h2>
<p>Minifying is the process of removing all unnecessary characters from the source code without changing its functionality (removing whitespaces, line-breaks and comments, replacing variables names and more). Concatenation is the process of unifying two strings into one. Applying both to our scripts we reduce total script size and the amount of requests.</p>
<p>There are several public algorithms for minifying Javascript, and Dean Edwards gives <a title="Dean Edward on Javascript compression" href="http://dean.edwards.name/weblog/2007/08/js-compression/" target="_blank">a nice overview of those</a> on his blog.</p>
<p>For PHP we have the handy <a href="http://code.google.com/p/minify/" target="_blank">Minify</a> library, which handles both the minifcation and concatenation of scripts. Minify is quite robust, and comes with <a href="http://code.google.com/p/minify/wiki/ComponentClasses" target="_blank">a set of standalone classes</a> that can be used in other contexts as well. It also sets Etags and far-future headers for better client script caching.</p>
<h2>Deploying Minify</h2>
<p>Downloading and extracting the <a href="http://minify.googlecode.com/files/release_2.1.1.zip">package available</a> on google code creates several text files and two sub-directories. The directory that is of interest to us is '/min' which contains the actual source code, and we'll place it somewhere on our server about our document root (so it can be accessed by a regular http request).</p>
<p>The basic workflow of using Minify is to replace our &lt;script&gt; and &lt;link&gt; tags which load our javascript and CSS respectively with calls to the minify script. We need to tell the Minify script which scripts to process, and there are two main ways to accomplish that:</p>
<p> - Passing the scripts as parameters in the call to the minify script. We pass the path to the scripts separated by commas, translating the following:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/path/to/script_one.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/path/to/script_two.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div></li></ol></pre>
<p>Into:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/path/to/min/?f=/path/to/script_one.js,/path/to/script_two.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div></li></ol></pre>
<p>There is actually a shorter way writing this, by using a common base path for both scripts:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/path/to/min/?b=path/to&amp;f=script_one.js,script_two.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div></li></ol></pre>
<p>Provided that all the paths are correct, we have successful concatenated two scripts into one minified script. This can repeated for as many scripts as we like, though there is an artificial limit (due to performance and memory limitations I assume) of 10 scripts per Minify request. This limit can be adjusted in the configuration file which exists at the base path of the library (config.php).</p>
<p> - Using pre-defined script arrays. This method is less flexible as it requires hardcoding the script names into an array, but is slightly more performant. Minify calls those array 'groups', which look something like:</p>
<pre class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <span style="color: #b1b100;">return</span> <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #ff0000;">'js'</span> =&gt; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'//path/to/script_one.js'</span>, <span style="color: #ff0000;">'//path/to/script_two.js'</span><span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#41;</span>;</div></li></ol></pre>
<p>You can find an example of those in the installation folder of Minify (groupsConfig.php). The request to the script is then made by specifying the group name:</p>
<pre class="html4strict"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/path/to/min/?g=js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div></li></ol></pre>
<p>There are several options when using groups, and you can read on those on the library's <a href="http://code.google.com/p/minify/w/list">wiki</a>.</p>
<p>Its important to set up the cache folder for Minify. Minifying the scripts can actually take a couple of seconds, which is a relatively long delay - however once generated once they will be cached until the scripts change (provided the cache folder is set-up properly). </p>
<p>To declare the cache folder, simply define a variable named $min_cachePath in the configuration file or the main app file before the main application start.</p>
<pre class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$min_cachePath</span> = <span style="color: #ff0000;">'/path/to/cache'</span>;</div></li></ol></pre>
<p>Make sure the folder exists and has write permissions by PHP.</p>
<h2>Real world use</h2>
<p>I've implemented Minify in all of my recent projects to great effect. An extreme case would be script deployment in my current startup, <a href="http://www.octabox.com">Octabox web platform</a>. Being a heavy-duty web-application, it consumes much more javascript and styles than your average marketing site.</p>
<h3>Without Minify</h3>
<p>Javascript requests:<br />
<img src="http://www.techfounder.net/wp-content/uploads/2008/11/js.gif" alt="Javascript" style="float:none;" /><br />
CSS requests:<br />
<img src="http://www.techfounder.net/wp-content/uploads/2008/11/css.gif" alt="CSS" style="float:none;" /></p>
<h3>With Minify</h3>
<p>Javascript requests:<br />
<img src="http://www.techfounder.net/wp-content/uploads/2008/11/minifiedjs.gif" alt="Minified Javascript" style="float:none;" /><br />
CSS requests:<br />
<img src="http://www.techfounder.net/wp-content/uploads/2008/11/minifiedcss.gif" alt="Minified CSS" style="float:none;" /></p>
<p>51 total requests weighing 540kb reduced to 5 requests weighing 116kb. </p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=121" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F11%2F16%2Fmaking-web-pages-go-faster-using-php%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F11%2F16%2Fmaking-web-pages-go-faster-using-php%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/11/16/making-web-pages-go-faster-using-php/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Common misconceptions in web application development</title>
		<link>http://www.techfounder.net/2008/07/20/common-misconceptions-in-web-application-development/</link>
		<comments>http://www.techfounder.net/2008/07/20/common-misconceptions-in-web-application-development/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 07:13:18 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=98</guid>
		<description><![CDATA[Over the time I have developed for the web, I have read and heard many assumptions about development practices and technologies. This is my list of common misconceptions in (web) development: 1. OO code is less performant than procedural code The number one argument against OO application design from procedural advocates. This argument is based [...]]]></description>
			<content:encoded><![CDATA[<p>Over the time I have developed for the web, I have read and heard many assumptions about development practices and technologies. This is my list of common misconceptions in (web) development:</p>
<h2>1. OO code is less performant than procedural code</h2>
<p>The number one argument against OO application design from procedural advocates. This argument is based more on intuition than fact. The <a href="http://devzone.zend.com/article/1236-The-Best-Tool-For-The-Job-OO-versus-Procedural-Programming-in-PHP" target="_blank">usual examples</a> pit short procedural code against equivalent OO code in which procedural code comes out triumphant as more terse and performant.<br />
<span id="more-98"></span></p>
<pre class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Procedural, quick and to the point!</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$string</span> = <span style="color: #ff0000;">'hello world'</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$string</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//OO, verbose and ineffecient...</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> Speaker <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> say<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$string</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$string</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$me</span> = <span style="color: #000000; font-weight: bold;">new</span> Speaker<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$me</span> -&gt; <span style="color: #006600;">say</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'hello world'</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></pre>
<p>Actually, this example compares apples to oranges. Both approaches use 'echo' to output a string, only in the OO approach it is wrapped inside a class method. A more appropriate example for the procedural code would be:</p>
<pre class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> say<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$string</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$string</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">say<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'hello string'</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></pre>
<p>Which is very similar to the OO code written before. Strong application structure actually does not differ greatly between OO and procedural/functional approaches as my second example suggests, and it is mainly a function of the developer's skill and experience.</p>
<p>OO methodology however gives more language features and scope constructs to deal with code complexities and to handle code reuse, features that would require much more discipline and experience to implement using procedural programming only.</p>
<p>In reality, it is the efficiency of the language parser that will determine performance differences between procedural and OO code. There are no inherent <strong>noticeable</strong> performance differences between both methodologies for <strong>common usage in web applications</strong>. More typically in the web environment, IO operations such as server requests or database queries are the bottlenecks of performance / scalability.</p>
<p>Since it's impossible to know in advance what the bottlenecks will be (you can only make educated guesses), I try to follow the <a title="Wikiwikiweb on Rules of optimization" href="http://c2.com/cgi/wiki?RulesOfOptimization" target="_blank">Rules Of Optimization</a>:</p>
<ol>
<li>First rule of optimization - <strong>Don't</strong></li>
<li>Second rule of optimization - <strong>Don't ... yet</strong></li>
<li>Third rule of optimization - <strong>Profile before optimizing</strong></li>
</ol>
<p>It is much more important to pick a methodology that will promote more maintainable and structured code, as OOP does, to possible minor performance gains. With a well structured design, profiling an application and refactoring slow-performing code is a relatively straightforward process.</p>
<h2>2. The backend is the most important part of development</h2>
<p>I often see web developers treat HTML, CSS and Javascript as second class languages. While HTML and CSS are not programming languages per-se, correct implementation of both in a cross-browser and semantic way requires much experience and skill that I often see lacking in otherwise proficient web developers.</p>
<p>It is not uncommon to relegate implementation of those two markup languages to web designers or  "client-side developers" (which are usually regarded as lower level developers) or to use auto-generating tools for creating markup.</p>
<p><strong>Both approaches are wrong</strong> - the client side is an important aspect of the web development process, especially because of the unique environment a web site or application runs in on the Internet - the browser, which has many different flavours each with its own set of problems and constraints.</p>
<p>Javascript (or DHTML) is another domain expertise which is undervalued and yet has become such a common requirement in today's rich Internet applications. Many web developers coming from a server-side language background have an intrinsic dislike for Javascript because of its weird OO syntax, its difficult debugging scheme and its un-uniform implementation across browsers . I would admit to once have thought the same way, however through necessity I came to like Javascript and now consider it an indispensable skill for a serious web developer.</p>
<p><strong>Don't disrespect the client side languages</strong>. Sometimes the greatest challenges in web development are found there.</p>
<h2>3. Graphical designers are good at user interface design</h2>
<p>* This is more relevant for web applications as opposed to web sites</p>
<p>While there is a connection between graphical design and UI design, graphical designers <strong>do not</strong> naturally make for good UI designers. I can not emphasis this enough. User interface and user experience design is a separate expertise from graphical design. How a user will interact with a site / application is different from how he will view it. It is connected - but not the same.</p>
<p>Quoting <a href="http://en.wikipedia.org/wiki/User_interface_design" target="_blank">wikipedia</a>:</p>
<blockquote><p>Where traditional graphic design seeks to make the object or application physically attractive, the goal of user interface design is to make the user's interaction as simple and efficient as possible</p></blockquote>
<p>Graphical designers with no expertise in UI design tend to prefer aesthetics over usability, and this is only natural as it accentuates their strengths. On the flip side, (web) developers don't usually make for good UI designers either.</p>
<p>UI design is important for creating a usable application. <strong>Make sure the right people are creating it</strong>.</p>
<h2>4. The existence of a superior programming language</h2>
<p>While some programming languages are considered superior to others (higher level, more featured, better syntax etc.), no one language can be considered <strong>the</strong> superior language. Debating that one exists is more a statement of personal preferences than a declaration of actual merit.</p>
<p>All modern languages have roughly the same features and can perform most tasks equally well. Some languages might be more suited to specific problems than others, however no one language does everything better than the others.</p>
<p>Some promote specific languages because of highly acclaimed frameworks developed for them (I'm referring to <a title="Ruby On Rails" href="http://www.rubyonrails.org/" target="_blank">Ruby on Rails</a>, naturally). While this is a more relevant argument, currently all the major languages have at least one serious framework (<a href="http://www.djangoproject.com/" target="_blank">Django</a> for python, <a href="http://framework.zend.com/" target="_blank">Zend Framework</a> / <a href="http://www.cakephp.org/" target="_blank">CakePHP</a> / <a href="http://www.symfony-project.org/" target="_blank">Symphony</a> for PHP).</p>
<p>Use the language you are comfortable with, but <a href="http://www.techfounder.net/2008/05/22/php-versus-the-world/">don't deride others</a> based on your inexperience with them.</p>
<h2>5. XML is more economic than a DB</h2>
<p>Database are notorious for being the major bottleneck for many successful web sites / applications. It is this notoriety that prompts novice developers to seek out alternative persistence layers - and XML is the common alternative.</p>
<p>In general, parsing XML is slower and more resource intensive than querying a database. This is dependent on the complexity of the query, but holds true for 99% of the cases. Furthermore, databases have a much more complete language to fetch, order and manipulate result sets.</p>
<p>XML is a portable format for storing hierarchical data. It is useful for porting data between different databases  or between databases and interfaces. However <strong>XML is not a database</strong>, so don't treat it as one.</p>
<p><em>If you have more to add to this list, I would love to hear about it.<br />
</em></p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=98" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F20%2Fcommon-misconceptions-in-web-application-development%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F20%2Fcommon-misconceptions-in-web-application-development%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/07/20/common-misconceptions-in-web-application-development/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Comet is coming</title>
		<link>http://www.techfounder.net/2008/07/16/comet-is-coming/</link>
		<comments>http://www.techfounder.net/2008/07/16/comet-is-coming/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 23:21:56 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[The Webs]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=91</guid>
		<description><![CDATA[In a recent article in which I wrote about the HTML 5 draft, I mentioned a server notifications API and hinted that it will standardize a technique known as Comet. So what is Comet anyway? Comet is an event driven communication scheme with between a web-browser and a web-server. In the normal flow of an [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent article in which I wrote about <a href="http://www.techfounder.net/2008/06/20/html-5-shaping-up-nicely/" title="Techfounder: HTML 5 draft">the HTML 5 draft</a>, I mentioned a server notifications API and hinted that it will standardize a technique known as Comet. So what is Comet anyway?</p>
<p><a href="http://en.wikipedia.org/wiki/Comet_(programming)" target="_blank" title="Wikipedia: Comet">Comet</a> is an event driven communication scheme with between a web-browser and a web-server. In the normal flow of an http request, a web server can not initiate communications with the client (the web browser) - it can only respond to requests.  Comet declares a reversal of roles, in which the server can notify the client whenever new data is available. This technique is very useful in a constantly changing environment such as stock prices or online messaging (chat).<br />
<span id="more-91"></span><br />
The term was coined by Alex Russell of Dojo fame, in a <a href="http://alex.dojotoolkit.org/?p=545" target="_blank" title="Alex Russel: COMET">blog piece a little more than two years ago</a>. It has since gained minor traction in the development community, with <a href="http://cometdaily.com/" target="_blank" title="Comet Daily">several</a> <a target="_blank" title="Comted Project" href="http://cometdproject.dojotoolkit.org/">projects</a> actively promoting it and educating on it. It never reached AJAX-levels in popularity though, mainly due to it being somewhat difficult to implement and use.</p>
<p>Enter HTML 5. The working draft of the HTML 5 specifications declares <a target="_blank" title="HTML 5 draft: Server sent DOM events" href="http://www.w3.org/TR/html5/comms.html#server-sent-events">server-sent DOM events</a>. This API allows for native implementation of Comet techniques without using elaborate client-server setups which will finally make Comet accessible enough to be considered mainstream. The specs go even further, and declare an interface for bidirectional communications between client and server and client and client (P2P). Such an interface would render current AJAX techniques absolute, as the XHR object would no longer be required to poll the server for data on demand. The peer-to-peer options offer an incredible opportunity to multi-user environment by removing the server as the middle-man (and the bottleneck).</p>
<p>Comet Daily gives an overview of this API and the WebSockets API <a href="http://cometdaily.com/2008/07/04/html5-websocket/" target="_blank" title="Comet Daily: HTML5 WebSocket">in a recent piece</a>. Michael Carter mentions the new network API and how it will affect future client-server communication in some detail and even shows some mock code of ridiculously simple setup for server-listening events.</p>
<p>So yeah, HTML 5 is definitely something to watch for. Hopefully the draft will be finalized as soon as possible so browser vendors could start pushing out implementations and make us developers very happy.</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=91" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F16%2Fcomet-is-coming%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F16%2Fcomet-is-coming%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/07/16/comet-is-coming/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Advancing PHP Developer Part 5: Design Patterns</title>
		<link>http://www.techfounder.net/2008/07/12/the-advancing-php-developer-part-5-design-patterns/</link>
		<comments>http://www.techfounder.net/2008/07/12/the-advancing-php-developer-part-5-design-patterns/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 03:24:11 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=49</guid>
		<description><![CDATA[5. Design Patterns A design pattern is a general reusable solution to a recurring design problem in object-oriented systems. Design patterns are essentially blueprints that suggest how to solve a particular set of OO design problems while adhering to OO best good-practices (which I've recounted in my Object Oriented part of this series). To explain [...]]]></description>
			<content:encoded><![CDATA[<h2>5. Design Patterns</h2>
<p>A <a title="Wikipedia: Design Pattern" href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)" target="_blank">design pattern</a> is a general reusable solution to a recurring design problem in object-oriented systems. Design patterns are essentially blueprints that suggest how to solve a particular set of OO design problems while adhering to OO <span style="text-decoration: line-through;">best</span> good-practices (which I've recounted in my <a title="Techfounder on Object Oriented PHP programming" href="http://www.techfounder.net/2008/05/25/the-advancing-php-developer-part-2-object-orientation/">Object Oriented part of this series</a>).</p>
<p>To explain by example, lets have a look at the <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller pattern</a>, a common pattern in use on the web and a source of much confusion amongst aspiring developers. The Model-View-Controller pattern (abbr. MVC) is a general solution for decoupling domain logic from the user interface, resulting in much better maintainability for both.<br />
<span id="more-49"></span><br />
MVC suggests an application structure composed of three basic elements:</p>
<ol>
<li>Models - which encapsulate <a title="Domain Logic" href="http://www.phpwact.org/pattern/domain_logic" target="_blank">domain logic</a> (such as <a title="Wikipedia: Business Rules" href="http://en.wikipedia.org/wiki/Business_rule" target="_blank">business rules</a> and database access)</li>
<li>Views - which encapsulate presentation logic (such as HTML markup and recurring formatting decorators)</li>
<li>Controllers - which handle the application flow by handling requests and match models to views accordingly.</li>
</ol>
<p>By separating those three concerns MVC aims to provide a reusable solution for improving maintainability, as each can theoretically be changed independently (in practice, things are never so simple). My personal experience has been that MVC is a huge improvement over common PHP development which promotes spaghetti code since PHP can be very easily integrated with markup (HTML).</p>
<p>The MVC patterns is often used with the <a href="http://java.sun.com/blueprints/patterns/FrontController.html" target="_blank">Front-Controller pattern</a>, which defines a single entry point to an application and allows for ever greater control of application flow (a technique also known as <a href="http://devzone.zend.com/node/view/id/70" target="_blank" title="Zend Devzone on bootstrapping">bootstrapping</a>).</p>
<p>There are <a title="Wikipedia: Design Patterns" href="http://en.wikipedia.org/wiki/Category:Software_design_patterns" target="_blank">plenty of other useful patterns</a> for the web-environment, such as <a title="Wikipedia: Composite Pattern" href="http://en.wikipedia.org/wiki/Composite_pattern" target="_blank">Composite</a>, <a title="Wikipedia: Singleton Pattern" href="http://en.wikipedia.org/wiki/Singleton_pattern" target="_blank">Singleton</a> (and <a href="http://www.patternsforphp.com/wiki/Registry" target="_blank">Registry</a>), <a title="Wikipedia: Factory Pattern" href="http://en.wikipedia.org/wiki/Factory_method_pattern" target="_blank">Factory</a> and <a href="http://en.wikipedia.org/wiki/Decorator_pattern">Decorator</a> among others.</p>
<p>Design patterns broke into the software mainstream with the release of the apt named book <a href="http://en.wikipedia.org/wiki/Design_Patterns" target="_blank" title="Wikipedia: Design Patterns book">Design Patterns: Elements of Reusable Object-Oriented Software</a> (which I think any serious developer should read). The <a href="http://www.c2.com/cgi/wiki?WelcomeVisitors" target="_blank">WikiWikiWeb</a>, which has the book authors among others as contributors, contains many articles on design patters - such as an <a href="http://www.c2.com/cgi-bin/wiki?HistoryOfPatterns" target="_blank">overview of its history</a> and a discussion on <a href="http://www.c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures" target="_blank">whether design patterns should be language features</a> to name a few.</p>
<p>Design patterns are not limited to software design, and there are many patterns for design problems in all aspects of web development - such as graphical design and user interactions.</p>
<p>Extra reference material:<br />
<a href="http://www.patternsforphp.com/wiki/Main_Page" target="_blank">Patterns for PHP</a><br />
<a href="http://www.welie.com/patterns/" target="_blank">User interface patterns for the web</a><br />
<a href="http://www.e-gineer.com/v1/articles/design-patterns-in-web-programming.htm" target="_blank">Design patterns in web programming</a><br />
<a href="http://groups.ischool.berkeley.edu/ui_designpatterns/webpatterns2/webpatterns/home.php" target="_blank">Web patterns by Berkeley University</a><br />
<a href="http://ajaxpatterns.org/" target="_blank">Ajax patterns</a></p>
<p>Previously: <a href="http://www.techfounder.net/2008/06/07/the-advancing-php-developer-part-4-testing/" title="Techfounder on testing practices in PHP">Testing</a>, Next up: API</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=49" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F12%2Fthe-advancing-php-developer-part-5-design-patterns%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F07%2F12%2Fthe-advancing-php-developer-part-5-design-patterns%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/07/12/the-advancing-php-developer-part-5-design-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML 5 shaping up nicely</title>
		<link>http://www.techfounder.net/2008/06/20/html-5-shaping-up-nicely/</link>
		<comments>http://www.techfounder.net/2008/06/20/html-5-shaping-up-nicely/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 00:11:47 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[The Webs]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=69</guid>
		<description><![CDATA[Left for dead by many, HTML resurfaced half a year ago when the w3 released a working draft for the next version of this markup language. The draft was recently updated and a document detailing the differences from the previous version was released as well. Having read through the differences document and most of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ariadne.ac.uk/issue27/web-focus/" target="_blank" title="HTML is dead">Left for dead by many</a>, HTML resurfaced half a year ago when the <a href="http://w3.org" target="_blank" title="World Wide Web Consortium">w3</a> released a <a href="http://www.w3.org/TR/html5/" target="_blank" title="HTML5 working draft">working draft</a> for the next version of this markup language. The draft was recently updated and a <a href="http://www.w3.org/TR/html5-diff/" title="HTML5 vs. HTML4" target="_blank">document detailing the differences</a> from the previous version was released as well.<br />
<span id="more-69"></span><br />
Having read through the differences document and most of the working draft, I feel genuinely excited about the potential of HTML5. They include:</p>
<ul>
<li>Formal support for the <a href="http://en.wikipedia.org/wiki/Canvas_(HTML_element)" target="_blank" title="Wikipedia: CANVAS element">CANVAS drawing API</a>. Already implemented to various degrees in some browsers (excluding the <a href="http://me.eae.net/archive/2005/12/29/canvas-in-ie/" target="_blank" title="Canvas in IE">usual suspect</a>), the CANVAS drawing API is very useful for creating web graphics and interactions programmatically.  (I recently wrote about a <a href="http://www.techfounder.net/2008/05/17/processing-in-javascript/">very interesting port of the Processing language</a> using the Canvas element)</li>
<li>Native <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dnd">drag-and-drop</a> API (finally!)</li>
<li>Formal API for editing (contentEditable/designMode). Gone are the days of 150kb+ WYSIWYG javascript libraries.</li>
<li>An offline storage API</li>
<li>Browser history API (for fixing broken behavior with modern techniques, ie AJAX)</li>
<li>Server notifications API (standardizing a technique known as <a href="http://en.wikipedia.org/wiki/Comet_(programming)" target="_blank" title="Wikipedia: COMET">COMET</a>).</li>
<li>New attributes such as a global 'href' allowing every element to potentially be a hyperlink.</li>
</ul>
<p>This partial list has enough improvements to make any sane web-developer happy. HTML is definitely heading in the right direction to retain its dominant position as the markup language for the web (its biggest advantage over XHTML being a much more user friendly <a href="http://annevankesteren.nl/2005/04/html5" target="_blank" title="HTML5">error handling</a>).</p>
<p>Now it remains to be seen how long it takes for this proposal to be finalized and implemented.</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=69" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F20%2Fhtml-5-shaping-up-nicely%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F20%2Fhtml-5-shaping-up-nicely%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/06/20/html-5-shaping-up-nicely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery and Prototype the choice of top websites</title>
		<link>http://www.techfounder.net/2008/06/14/jquery-and-prototype-the-choice-of-top-websites/</link>
		<comments>http://www.techfounder.net/2008/06/14/jquery-and-prototype-the-choice-of-top-websites/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 00:54:59 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=68</guid>
		<description><![CDATA[Pingdom has complied a list of the Javascript frameworks used by the top sites on the web (top 100 in Alexa US, Webware's top 100 web apps). jQuery and Prototype are the top choices, getting 11 and 13 respectively. It's interesting to note that Dojo is not even featured on this list, though if you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://royal.pingdom.com/?p=305">Pingdom has complied a list</a> of the Javascript frameworks used by the top sites on the web (top 100 in Alexa US, Webware's top 100 web apps). jQuery and Prototype are the top choices, getting 11 and 13 respectively. </p>
<p>It's interesting to note that Dojo is not even featured on this list, though if you check the comments you'll see that it is used partially at the apple site (in the apple store). This makes me wonder even more regarding Zend's latest decision to <a href="http://weierophinney.net/matthew/archives/176-Zend-Framework-Dojo-Integration.html">integrate Dojo into their framework</a>. As I commented in that release statement (comment #6 is mine), I feel that Dojo isn't appropriate as the default for the framework as it is more complex and much less documented than the other top frameworks. </p>
<p>As a long time jQuery developer I have no intentions of integrating a new Javascript library into my development environment, so I'm obviously biased. I still feel as though Zend missed an opportunity here to better cater to the needs of a broader user base and instead chose to prioritize its partners best interests.</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=68" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F14%2Fjquery-and-prototype-the-choice-of-top-websites%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F14%2Fjquery-and-prototype-the-choice-of-top-websites%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/06/14/jquery-and-prototype-the-choice-of-top-websites/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Semi-colon mystery explained, jQuery UI released</title>
		<link>http://www.techfounder.net/2008/06/11/semi-colon-mystery-explained-jquery-ui-released/</link>
		<comments>http://www.techfounder.net/2008/06/11/semi-colon-mystery-explained-jquery-ui-released/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 01:33:50 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=65</guid>
		<description><![CDATA[Javascript is a very mysterious language. Its prototypical inheritance structure and its function == object == function concepts are quite different compared to standard OO languages. As I did with PHP, I try my best to learn best good practices by studying frameworks I like, and in Javascript's case that would be jQuery. I had [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript is a very mysterious language. Its <a title="Wikipedia: Prototypical Inheritance" href="http://en.wikipedia.org/wiki/Prototype-based_programming" target="_blank">prototypical inheritance</a> structure and its function == object == function concepts are quite different compared to standard OO languages. As I did with PHP, I try my best to learn <span style="text-decoration: line-through;">best</span> good practices by studying frameworks I like, and in Javascript's case that would be <a title="jQuery" href="http://jquery.com" target="_blank">jQuery</a>.</p>
<p>I had believed I figured out most of the conventions used in the jQuery source code, however a recent addition has been bugging me and I could not find a reasonable explanation for it - I'm talking about the mysterious semi-colons appearing at the beginning of some of the source files in the library. What is its purpose? Does it make the closure invisible to giant robots from outer space? I had no leads to go on.</p>
<p><a title="jQuery Rule 1.0 released" href="http://flesler.blogspot.com/2008/01/jqueryrule-10-released.html" target="_blank">This blog post</a> by the jQuery.rule team however, reveals the truth about the semi-colon debacle - apparently they're used for safe file concatenation (string join). Well that's a load off my chest. You learn something new every day.</p>
<p>In related news, jQuery UI 1.5 has been officially released, says the <a title="jQuery 1.5 released" href="http://jquery.com/blog/2008/06/09/jquery-ui-v15-released-focus-on-consistent-api-and-effects/" target="_blank">jQuery enquirer</a>. jQuery 1.5 is an extensive UI oriented extension to jQuery, and version 1.5 bring forth many improvements such as a tighter API, an effects library called enchant, a skinning mechanism and plenty of bug fixes. I'm just excited they finally updated their <a title="jQuery UI documentation" href="http://docs.jquery.com/UI" target="_blank">documentation</a>, as I've been using it for a while going only by source code.</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=65" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F11%2Fsemi-colon-mystery-explained-jquery-ui-released%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F11%2Fsemi-colon-mystery-explained-jquery-ui-released%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/06/11/semi-colon-mystery-explained-jquery-ui-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Almost useful IE replacement</title>
		<link>http://www.techfounder.net/2008/06/08/almost-useful-ie-replacement/</link>
		<comments>http://www.techfounder.net/2008/06/08/almost-useful-ie-replacement/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 01:19:37 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[techfounder]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=60</guid>
		<description><![CDATA[I stumbled upon a tool by the name of IETester today, that is supposed to render websites in different IE engines from version 5.5 to 8 beta. It appears to be working quite well, allowing to open multiple tabs of different IE versions. Unfortunately its Javascript support is too limited to be of real use [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon a tool by the name of IETester today, that is supposed to render websites in different IE engines from version 5.5 to 8 beta. It appears to be working quite well, allowing to open multiple tabs of different IE versions. Unfortunately its Javascript support is too limited to be of real use for serious application development.</p>
<p>Still, a nice tool for web designers wishing to test their HTML and CSS layouts against several generations of IE, without having to resort to hacking multiple installations of different versions (such as <a href="http://tredosoft.com/Multiple_IE">multipleIE</a>).</p>
<p><a href="http://www.my-debugbar.com/wiki/IETester/HomePage">IETester</a> [via <a href="http://lifehacker.com/395353/ietester-renders-sites-like-internet-explorer-55-through-8">LifeHacker</a>]</p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=60" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F08%2Falmost-useful-ie-replacement%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F08%2Falmost-useful-ie-replacement%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/06/08/almost-useful-ie-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery development marches on (1.2.6)</title>
		<link>http://www.techfounder.net/2008/06/04/jquery-development-marches-on-126/</link>
		<comments>http://www.techfounder.net/2008/06/04/jquery-development-marches-on-126/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 21:52:56 +0000</pubDate>
		<dc:creator>Eran Galperin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.techfounder.net/?p=47</guid>
		<description><![CDATA[jQuery 1.2.6 was released recently, with plenty of bug-fixes and speed improvements. Most notably event handling was sped up 103% and the dimensions plugin was integrated into the framework (the dimensions plugin is an API to calculate elements sizes in a cross-browser and reliable way). In addition, jQuery UI has recently reached release-candidate status, which [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery 1.2.6 was <a title="jQuery 1.2.6 release" href="http://jquery.com/blog/2008/06/04/jquery-126-events-100-faster/" target="_blank">released recently</a>, with plenty of bug-fixes and speed improvements. Most notably event handling was sped up 103% and the dimensions plugin was integrated into the framework (the dimensions plugin is an API to calculate elements sizes in a cross-browser and reliable way).</p>
<p>In addition, <a title="jQuery UI" href="http://ui.jquery.com/" target="_blank">jQuery UI</a> has recently reached <a title="jQuery UI release candidate 1" href="http://jquery.com/blog/2008/06/02/jquery-ui-15-release-candidate-were-getting-excited/" target="_blank">release-candidate</a> status, which means all non minor or trivial issues were solved and it's getting to the point that it will production ready shortly. I have been using its components for a while in anticipation of such release, and hopefully they will have their documentation up soon.</p>
<p>Good times to be jQuery developers <img src='http://www.techfounder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
 <img src="http://www.techfounder.net/wp-content/plugins/feed-statistics.php?view=1&post_id=47" width="1" height="1" style="display: none;" /><div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F04%2Fjquery-development-marches-on-126%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.techfounder.net%2F2008%2F06%2F04%2Fjquery-development-marches-on-126%2F" height="61" width="51" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.techfounder.net/2008/06/04/jquery-development-marches-on-126/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
