<?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>Ajax Bestiary &#187; Best Practices</title>
	<atom:link href="http://www.ajaxbestiary.com/tag/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxbestiary.com</link>
	<description>AJAX Development, News, Techniques &#38; More</description>
	<lastBuildDate>Wed, 01 Feb 2012 12:46:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript Testing with Test from Javascript MVC</title>
		<link>http://www.ajaxbestiary.com/2008/05/19/javascript-testing-with-test-from-javascript-mvc/</link>
		<comments>http://www.ajaxbestiary.com/2008/05/19/javascript-testing-with-test-from-javascript-mvc/#comments</comments>
		<pubDate>Mon, 19 May 2008 13:27:23 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Javascript MVC]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=322</guid>
		<description><![CDATA[I&#8217;m always looking for ways to improve my javascript development and after a few weeks of playing, Javascript MVC test looks like it might be one the best tools yet. We all know the power of testing our code.  A proper suite of unit tests can be among a projects most valuable assets.  They can [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I&#8217;m always looking for ways to improve my javascript development and after a few weeks of playing, Javascript MVC test looks like it might be one the best tools yet.</p>
<p>We all know the power of testing our code.  A proper suite of unit tests can be among a projects most valuable assets.  They can ensure against the regressions rampant in rapid application development cycles that may not have adequate opportunities for proper QA.  Most importantly, when coupled with continuous integration tools, a comprehensive test suite catches many bugs close to when they are written and when they are easiest to correct.</p>
<p>Historically, testing javascript hasn&#8217;t been the most useful or productive of tasks.  The type of data manipulation, object inheritance and communication most conducive to unit testing has been minimized in most javascript applications.  Instead, most javascript is highly event driven and is often loosely tied to any specific server side data model.  Test MVC stands to provide a powerful testing framework for just those tasks we normally use javascript for.</p>
<p>Key Features</p>
<p> </p>
<ul>
<li><a href="http://javascriptmvc.com/learningcenter/test/index.html#accurate">Cross browser<sup>1</sup></a> support for typical DOM events, like keypress, click, submit, blur, and focus</li>
<li>Simulate writing text or dragging an element</li>
<li>Easily simulate AJAX functionality with sample data in fixture files</li>
</ul>
<div>You can find out more here</div>
<div><span style="color: #551a8b; text-decoration: underline;">http://javascriptmvc.com/learningcenter/test/index.html<br />
</span></div>
<p> </p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/05/19/javascript-testing-with-test-from-javascript-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DamnIT Remote Javscript Error Reporting</title>
		<link>http://www.ajaxbestiary.com/2008/03/23/damnit-remote-javscript-error-reporting/</link>
		<comments>http://www.ajaxbestiary.com/2008/03/23/damnit-remote-javscript-error-reporting/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 02:02:49 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Misc Toolkits]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Logging]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2008/03/23/damnit-remote-javscript-error-reporting/</guid>
		<description><![CDATA[Firebug and its kin are awesome for debugging javascript, but once our scripts are in the wild we really don&#8217;t have any feedback of any kind about the state of the browser.  DamnIT from JupiterIT attempts to alleviate this by providing an automated feedback system for javascript applications. How it works: A box appears prompting [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Firebug and its kin are awesome for debugging javascript, but once our scripts are in the wild we really don&#8217;t have any feedback of any kind about the state of the browser.  DamnIT from JupiterIT attempts to alleviate this by providing an automated feedback system for javascript applications.</p>
<p>How it works:</p>
<ol>
<li>A box appears prompting you to describe your most recent actions: 		<img src="https://damnit.jupiterit.com/images/notification.png" /></li>
<li>One of the following occurs:
<ul>
<li>you type something and click send</li>
<li>you click &#8220;close&#8221;</li>
<li>10 seconds pass with you doing nothing</li>
</ul>
</li>
<li>DamnIT emails you the following information:
<ul>
<li>Browser</li>
<li>Page</li>
<li>HTML Content</li>
<li>Description (if you entered one)</li>
<li>Error message</li>
<li>File name, line number, and stack (if the browser supports them)</li>
</ul>
</li>
</ol>
<p>On the surface this is an incredible system.  In practice there are a few key issues that I think need addressed before the product is an ideal fit for every situation.  Basically, I have severe reservations about the email only nature of the system and its dependence on central management.  Both of these are key issues when dealing with sensitive information or large volumes of error messages and I&#8217;m sure will be addressed with future versions.  I am going to integrate the system into the next release of BLT and will be providing feedback from those efforts in the near future.  In the short term, you can check out DamnIT here:</p>
<p><a href="https://damnit.jupiterit.com ">https://damnit.jupiterit.com </a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/03/23/damnit-remote-javscript-error-reporting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Best Practices: parseInt( x, 10 );</title>
		<link>http://www.ajaxbestiary.com/2008/01/12/javascript-best-practices-parseint-x-10/</link>
		<comments>http://www.ajaxbestiary.com/2008/01/12/javascript-best-practices-parseint-x-10/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 14:35:37 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2008/01/12/javascript-best-practices-parseint-x-10/</guid>
		<description><![CDATA[ParseInt is one of the handiest universal functions in javascript. Even though javascript&#8217;s ability to cast most any primitive to any other primitive on the fly is handy to say the least, sometimes we need to explicitly parse a string to make sure we have a legitimate number to work with. ParseInt does this for [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>ParseInt is one of the handiest universal functions in javascript.  Even though javascript&#8217;s ability to cast most any primitive to any other primitive on the fly is handy to say the least, sometimes we need to explicitly parse a string to make sure we have a legitimate number to work with.</p>
<p>ParseInt does this for us.  What most developers don&#8217;t realize is that parseInt is <strong>base agnostic</strong>. While it typically assumes base ten, any base between 2 and 36 can be used and is indicated by the optional second argument.</p>
<p>Why is this a problem you might ask? Because octal numbers can be represented by a leading zero.  In practice this can cause some interesting effects in your code.</p>
<p>For example:<br />
<code><br />
var x = "010";</code></p>
<p><code>console.log( x );</code></p>
<p><code>console.log( x - 0 );</code></p>
<p><code>console.log( parseInt( x ) );</code></p>
<p><code>console.log( parseInt( x , 10 ) );</code><br />
<strong><br />
Returns:</strong><br />
<code><br />
"010"</code></p>
<p><code>10</code></p>
<p><code>8</code></p>
<p><code>10</code></p>
<p>Note: &#8220;010&#8243; is equivalent to 10 in  &#8220;x &#8211; 0&#8243;!</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/01/12/javascript-best-practices-parseint-x-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Namespaces &amp; Why You Should Use Them</title>
		<link>http://www.ajaxbestiary.com/2007/11/06/namespaces-why-you-should-use-them/</link>
		<comments>http://www.ajaxbestiary.com/2007/11/06/namespaces-why-you-should-use-them/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 16:41:18 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/11/06/namespaces-why-you-should-use-them/</guid>
		<description><![CDATA[If you don&#8217;t already know about Namespaces, Here&#8217;s a quick primer. A namespace is a unique identifier for a particular library or collection of objects.  Namespaces are used to prevent conflicts between various libraries and to simplify debugging. Traditionally Namespaces are defined using the unique name of a given project or library followed by a [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you don&#8217;t already know about Namespaces, Here&#8217;s a quick primer.</p>
<p>A namespace is a unique identifier for a particular library or collection of objects.  Namespaces are used to prevent conflicts between various libraries and to simplify debugging.</p>
<p>Traditionally Namespaces are defined using the unique name of a given project or library followed by a subsequent functional grouping i.e. (Yahoo.Util).  There is also a tradition from the Java community of defining namespaces &amp; packages using reverse URL notation i.e. (com.ajaxbestiary.libraryname)  I&#8217;ve found this notation to be too cumbersome for most Ajax projects.</p>
<p><strong>Abbreviating Namespaces </strong></p>
<p>Some developers prefer to abbreviate namespaces using a shorthand variable notation ie (var yu = Yahoo.Util).  This technique should be used quite carefully as it can lead to conflicts and confusion in multi-library &amp; multi-person development.  My recommendation is that any abbreviations be standardized upon across all development within an organization.</p>
<p>Over the next few days I will be exploring the use of namespaces in common Ajax toolkits.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/11/06/namespaces-why-you-should-use-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streamline jQuery Debugging with Firebug Logging</title>
		<link>http://www.ajaxbestiary.com/2007/10/23/streamline-jquery-debugging-with-firebug-logging/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/23/streamline-jquery-debugging-with-firebug-logging/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 12:19:00 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/23/streamline-jquery-debugging-with-firebug-logging/</guid>
		<description><![CDATA[Here&#8217;s a handy jQuery plugin to speedup development and greatly enhance debugging. http://happygiraffe.net/blog/archives/2007/09/26/jquery-logging  This lets you simply add a .log command to a jquery chain and have the result logged to the firebug console with all relevant contextual information.  Fast, easy and simple.]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Here&#8217;s a handy jQuery plugin to speedup development and greatly enhance debugging.</p>
<p><a href="http://happygiraffe.net/blog/archives/2007/09/26/jquery-logging">http://happygiraffe.net/blog/archives/2007/09/26/jquery-logging </a></p>
<p>This lets you simply add a .log command to a jquery chain and have the result logged to the firebug console with all relevant contextual information.  Fast, easy and simple.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/23/streamline-jquery-debugging-with-firebug-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great Article on Ajax Interface Construction &amp; Best Practices</title>
		<link>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 13:40:01 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/</guid>
		<description><![CDATA[IBM Developer Works has released an excellent article on AJAX interface development with a focus on best practices and a recomended work flow. Check it out here: http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>IBM Developer Works has released an excellent article on AJAX interface development with a focus on best practices and a recomended work flow.</p>
<p>Check it out here:</p>
<p><a href="http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207">http://www.ibm.com/developerworks/web/library/wa-aj-frontend/index.html?ca=drs-tp4207</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/19/great-article-on-ajax-interface-construction-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Standardizing On A Framework</title>
		<link>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 19:56:06 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/</guid>
		<description><![CDATA[Organizational standards are wonderful things.  They enforce consistency, help insure institutional competence and can dramatically reduce the learning curve to get additional staff up to speed on a project.  At the same time, in the world of AJAX standards can be too slow to adapt to a constantly changing landscape.  How do you strike a [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Organizational standards are wonderful things.  They enforce consistency, help insure institutional competence and can dramatically reduce the learning curve to get additional staff up to speed on a project.  At the same time, in the world of AJAX standards can be too slow to adapt to a constantly changing landscape.  How do you strike a balance between flexibility and consistency?</p>
<p><span id="more-123"></span> <span style="font-weight: bold">Project Specific Framework Selection</span></p>
<p>This is one of the most common approaches and is definitely the most flexible.  Project specific standards basically let the needs of a given project describe the choice of frameworks.  A project needing lots of animation and color manipulation may be built using mootools, a complex RIA may be built using dojo &amp; a simpler project may use prototype or jQuery.  The problem with this approach is the frequent need to learn new API&#8217;s &amp; potential to develop overly superficial knowledge of toolkits that may lead to unnecessarily cumbersome solutions.</p>
<p style="font-weight: bold">Selection of Approved Frameworks</p>
<p>A step beyond project specific framework selection is the adoption of 2 &#8211; 4 approved frameworks within an organization.  In this arrangement, you try to achieve a balance between project appropriateness and standardization.  Usually the frameworks are chosen to accommodate different scales of projects.  A natural breakdown is the use of prototype &amp; scriptaculous where scriptaculous may not be used in every project.  Another breakdown may combine a simple framework like prototype with a RIA platform like Dojo &amp; an intermediate toolkit like jQuery.  In any event, it&#8217;s usually a good idea to pick platforms with similar coding styles &amp; api&#8217;s to maximize the transference of skills between projects.</p>
<p><span style="font-weight: bold">Standardizing on a Single Framework</span></p>
<p>This is definitely a popular approach and prevents any problems with developers needing to relearn things to get up to speed on different projects. Unfortunately, it&#8217;s a very high risk approach as toolkits frequently aren&#8217;t optimal for every project (e.g. dojo for a brochureware site and prototype for a webmail client).  There&#8217;s also the unfortunate possibility of a framework transitioning to an inappropriate licensing model or being abandoned as well.</p>
<p><span style="font-weight: bold">Standardized Coding Practices</span></p>
<p>This is a strategy that can be adopted independent of your framework strategy.  basically, since so many of the various frameworks share constructs and they are all based on javascript.   Adopting a set of coding standards can dramatically simplify collaborative development.  Some of the strategies to consider are:</p>
<ul>
<li>Standardized Naming Conventions (camelcase, underscore etc.)</li>
<li>Standardized File Names</li>
<li>Standardized Function Names</li>
<li>Comment Formating</li>
<li>Chaining limits</li>
</ul>
<p>We&#8217;ll discus coding standards more in the future, but since I&#8217;ve had several recent discussions on adopting a standard for my organization.  I thought I&#8217;d share some of our thoughts with you.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/16/standardizing-on-a-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

