<?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>JavascriptKata &#187; Uncategorized</title>
	<atom:link href="http://www.javascriptkata.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com</link>
	<description>helping you with javascript since 2007</description>
	<lastBuildDate>Wed, 14 Sep 2011 14:07:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Creating namespaces with self-invoking functions</title>
		<link>http://www.javascriptkata.com/2011/09/05/creating-namespaces-with-self-invoking-functions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-namespaces-with-self-invoking-functions</link>
		<comments>http://www.javascriptkata.com/2011/09/05/creating-namespaces-with-self-invoking-functions/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 14:40:41 +0000</pubDate>
		<dc:creator>dsimard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javascriptkata.com/?p=350</guid>
		<description><![CDATA[When a project&#8217;s javascript grows, it can be easy to lose ourselves, buried under thousands of lines of js code. That&#8217;s why I like to create namespaces to keep everything together. Let&#8217;s say I have functions to work with cats and I create a namespace for it because there are lots of other functions related [...]]]></description>
			<content:encoded><![CDATA[<p>When a project&#8217;s javascript grows, it can be easy to lose ourselves, buried under thousands of lines of js code. That&#8217;s why I like to create namespaces to keep everything together. </p>
<p>Let&#8217;s say I have functions to work with cats and I create a namespace for it because there are lots of other functions related to dogs.</p>
<p><script src="https://gist.github.com/1195071.js"> </script></p>
<p>As you see, to access the cat list I must use the complete name including the namespaces like this : <strong>Animal.Cat.list</strong>. You can guess that it will get pretty long as the code grows.</p>
<p>Let&#8217;s make this call shorter.</p>
<p><script src="https://gist.github.com/1195073.js"></script></p>
<p>Now, I only have to write <strong>c.list</strong> because <em>c</em> is an alias of the <em>Animal.Cat</em> namespace. Thanks to <a href="http://www.javascriptkata.com/2011/08/22/self-invoking-functions-explained-line-by-line/" title="Self-invoking functions explained line by line">self-invocation</a>!</p>
<p>You probably noticed that the code is longer but this is just an example. In a real situation, this technique would make your code much clearer.</p>
<p>Don&#8217;t forget to <a href="http://eepurl.com/fmsZA">subscribe to my newsletter</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2011/09/05/creating-namespaces-with-self-invoking-functions/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Announcing the jsKata libraries</title>
		<link>http://www.javascriptkata.com/2010/06/15/announcing-the-jskata-libraries/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=announcing-the-jskata-libraries</link>
		<comments>http://www.javascriptkata.com/2010/06/15/announcing-the-jskata-libraries/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 12:00:56 +0000</pubDate>
		<dc:creator>dsimard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javascriptkata.com/?p=253</guid>
		<description><![CDATA[I&#8217;m officially announcing the jsKata librairies. Why? I just wanted to write some public code and share it with others. Javascript has a lot of pains in the butt and jQuery is not the answer to every problem. jsKata is the answer to some of the problems that I face everyday while writing javascript. A [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m officially announcing the <a href="http://dsimard.github.com/jskata/" target="_blank">jsKata librairies</a>.</p>
<h3>Why?</h3>
<p>I just wanted to write some public code and share it with others. Javascript has a lot of pains in the butt and jQuery is not the answer to every problem. <em>jsKata</em> is the answer to some of the problems that I face everyday while writing javascript.</p>
<h3>A manifesto?</h3>
<p>I wrote a manifesto because it helps me focusing on what and how I want to achieve with <em>jsKata</em>. This is the manifesto of <a href="http://github.com/dsimard/jskata/blob/v0.2/README.textile">version 0.2</a>.</p>
<ul>
<li><strong>No internal dependence</strong> : every library can be used independently “as is”.</li>
<li><strong>No external dependence</strong> : don’t depend on external libraries.</li>
<li><strong>Everything is public</strong> : you know what you’re doing</li>
<li><strong>Avoid objects</strong> : use closures</li>
<li><strong>No unnecessary validation</strong> : if something goes wrong, an error will pop</li>
<li><strong>No error catching</strong> : if an error pop, it goes all the way up</li>
<li><strong>No DOM</strong> : jQuery already exists</li>
<li><strong>No plugins</strong> : if a developer wants to add something, he will find a way around</li>
<li><strong>Write good documentation</strong> : document as I code</li>
<li><strong>Promote</strong> : a good library is nothing without users</li>
</ul>
<h3>What are the libraries available?</h3>
<p>I don&#8217;t consider <em>jsKata</em> to be a library but more a set of libraries because each one can be used independently (see #1 in manifesto). For the moment, there are two librairies.</p>
<p><strong>Undo &#038; redo</strong><br />
I wrote about <a href="http://www.javascriptkata.com/2010/03/29/how-to-write-an-simple-undo-system-for-your-app/">undo</a> and <a href="http://www.javascriptkata.com/2010/04/26/an-undoredo-library-for-your-app/">undo &#038; redo</a> before. I took the code and put it in <em>jsKata</em>. You can look at the <a href="http://github.com/dsimard/jskata/blob/master/src/jskata.undo.js" target="_blank">code</a> or try the <a href="http://dsimard.github.com/jskata/undo.html">demo</a>.</p>
<p><strong>No freeze</strong><br />
This librairy is to avoid unresponsive script warning when you have a really long loop. It cuts a loop to create digestible chunks without a warning. I&#8217;ll write more about this one in the future but meanwhile, you can <a href="http://github.com/dsimard/jskata/blob/master/src/jskata.nofreeze.js">look at the code</a> or try the <a href="http://dsimard.github.com/jskata/nofreeze.html" target="_blank">demo</a>.</p>
<h3>GitHub</h3>
<p>All the code is <a href="http://github.com/dsimard/jskata">hosted on GitHub</a>. I hope you will enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2010/06/15/announcing-the-jskata-libraries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

