<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 5 reasons to write object-oriented (oo) javascript</title>
	<atom:link href="http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/</link>
	<description>Advanced katas for javascripters</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:10:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Interesting Resources to learn Object Oriented Design &#124; Enterprise Java</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-712</link>
		<dc:creator>Interesting Resources to learn Object Oriented Design &#124; Enterprise Java</dc:creator>
		<pubDate>Tue, 17 Feb 2009 11:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-712</guid>
		<description>[...] 5 reasons to write object-oriented (oo) javascript- Create Advanced Web Applications With Object-Oriented Techniques- Understanding scope in object [...]</description>
		<content:encoded><![CDATA[<p>[...] 5 reasons to write object-oriented (oo) javascript- Create Advanced Web Applications With Object-Oriented Techniques- Understanding scope in object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ultram best</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-374</link>
		<dc:creator>ultram best</dc:creator>
		<pubDate>Tue, 11 Dec 2007 13:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-374</guid>
		<description>manufacturer ultram &lt;a href=&quot;http://ultram50mgno.ipbfree.com&quot; rel=&quot;nofollow&quot;&gt;vera ultram&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>manufacturer ultram <a href="http://ultram50mgno.ipbfree.com" rel="nofollow">vera ultram</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-12</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Fri, 06 Apr 2007 22:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-12</guid>
		<description>Ill second that... if its an &#039;intranet&#039;, a closed environment, then its usually fine to use JS to its full power... but when you get it onto the internet, it can start to cause all sorts of accessibility issues.

That&#039;s why I quite like the unobtrusive method... sometimes known as progressive enhancement...

http://onlinetools.org/articles/unobtrusivejavascript/

NOTE: Anyone reading that article should perhaps not pay that much attention to the specific examples... but the theory is spot on.

At the end of the day... if it works well in standard HTML, then keep it that way.

One thing I have found with screen readers, if the user requests to follow a standard HTML link, the new page will load and start being processed... but if its done with JavaScript, most of the time, the JavaScript will trigger, but the screen reader will sit there and do nothing... the user has to wait, as they might think that the new page is taking a while to load, but eventually they will have to investigate on what has happened.

I once did a website which hi-jacked all links, whereby it replaced the page content, instead of reloading the whole page, the result... a disaster... the back button was broken, users could not copy links to specific pages, the page loaded in a strange way (middle bit changed, which freaked out some users)... the alternative, without JS, seemed to load just as quick... so why bother?

But that was a bad example... there are many other examples which are useful... for example a hidden block of text (like the terms and conditions for a competition) which is displayed on request...

http://www.craigfrancis.co.uk/features/code/jsLinkedWidget/</description>
		<content:encoded><![CDATA[<p>Ill second that&#8230; if its an &#8216;intranet&#8217;, a closed environment, then its usually fine to use JS to its full power&#8230; but when you get it onto the internet, it can start to cause all sorts of accessibility issues.</p>
<p>That&#8217;s why I quite like the unobtrusive method&#8230; sometimes known as progressive enhancement&#8230;</p>
<p><a href="http://onlinetools.org/articles/unobtrusivejavascript/" rel="nofollow">http://onlinetools.org/articles/unobtrusivejavascript/</a></p>
<p>NOTE: Anyone reading that article should perhaps not pay that much attention to the specific examples&#8230; but the theory is spot on.</p>
<p>At the end of the day&#8230; if it works well in standard HTML, then keep it that way.</p>
<p>One thing I have found with screen readers, if the user requests to follow a standard HTML link, the new page will load and start being processed&#8230; but if its done with JavaScript, most of the time, the JavaScript will trigger, but the screen reader will sit there and do nothing&#8230; the user has to wait, as they might think that the new page is taking a while to load, but eventually they will have to investigate on what has happened.</p>
<p>I once did a website which hi-jacked all links, whereby it replaced the page content, instead of reloading the whole page, the result&#8230; a disaster&#8230; the back button was broken, users could not copy links to specific pages, the page loaded in a strange way (middle bit changed, which freaked out some users)&#8230; the alternative, without JS, seemed to load just as quick&#8230; so why bother?</p>
<p>But that was a bad example&#8230; there are many other examples which are useful&#8230; for example a hidden block of text (like the terms and conditions for a competition) which is displayed on request&#8230;</p>
<p><a href="http://www.craigfrancis.co.uk/features/code/jsLinkedWidget/" rel="nofollow">http://www.craigfrancis.co.uk/features/code/jsLinkedWidget/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-11</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 06 Apr 2007 21:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-11</guid>
		<description>A lot of people tends to keep javascript as minimal as possible. I did it for a long time.

But the reason why I started this site is that I saw more and more advantages in using javascript. It makes my applications faster, cleaner and more user-friendly.

But there&#039;s also hundreds of reason not to use it...</description>
		<content:encoded><![CDATA[<p>A lot of people tends to keep javascript as minimal as possible. I did it for a long time.</p>
<p>But the reason why I started this site is that I saw more and more advantages in using javascript. It makes my applications faster, cleaner and more user-friendly.</p>
<p>But there&#8217;s also hundreds of reason not to use it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-10</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Fri, 06 Apr 2007 20:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-10</guid>
		<description>Hi Dan,

Fair enough... I&#039;m sure that its valuable if you are doing allot of work in JavaScript.

Personally I tend to keep the JavaScript usage to a minimum, as I find that most websites I build only need the odd little helper script.

But its handy knowing as many different methods as possible... you never know what the next project might bring.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi Dan,</p>
<p>Fair enough&#8230; I&#8217;m sure that its valuable if you are doing allot of work in JavaScript.</p>
<p>Personally I tend to keep the JavaScript usage to a minimum, as I find that most websites I build only need the odd little helper script.</p>
<p>But its handy knowing as many different methods as possible&#8230; you never know what the next project might bring.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-9</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 06 Apr 2007 20:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-9</guid>
		<description>Hi Craig,
I made another post where I explain how to do classes in javascript : &lt;a href=&quot;http://www.javascriptkata.com/2007/03/23/how-to-create-objects-in-object-oriented-javascript/&quot; rel=&quot;nofollow&quot;&gt;How to create objects in object-oriented javascript&lt;/a&gt;.

An example? If I have a list of contacts, every contact should be a different instance of a class. This way, they share their methods and properties and take less memory.

With your technique, it creates a global variable and these variable can be really difficult to track. But I have to admit that I used your technique myself a lot before switching to the new one.

I&#039;d say that even if you don&#039;t need multiple instances, you should encapsulate (when possible) your functions in class. It won&#039;t change nothing to javascript but it will be easier to maintain.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Craig,<br />
I made another post where I explain how to do classes in javascript : <a href="http://www.javascriptkata.com/2007/03/23/how-to-create-objects-in-object-oriented-javascript/" rel="nofollow">How to create objects in object-oriented javascript</a>.</p>
<p>An example? If I have a list of contacts, every contact should be a different instance of a class. This way, they share their methods and properties and take less memory.</p>
<p>With your technique, it creates a global variable and these variable can be really difficult to track. But I have to admit that I used your technique myself a lot before switching to the new one.</p>
<p>I&#8217;d say that even if you don&#8217;t need multiple instances, you should encapsulate (when possible) your functions in class. It won&#8217;t change nothing to javascript but it will be easier to maintain.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-8</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Fri, 06 Apr 2007 17:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-8</guid>
		<description>Hi Dan,

While you are correct about not being able to create multiple instances... I have not been in a position where I need to have this feature. Typically it is only being used to help create a single name space for the code.

Have you got any examples where multiple instances are useful?

As to the memory requirements... I take this is related to having multiple instances of the main object (a copy)... in which case, I still don&#039;t think this is an issue for me, as I only have one instance of each object.</description>
		<content:encoded><![CDATA[<p>Hi Dan,</p>
<p>While you are correct about not being able to create multiple instances&#8230; I have not been in a position where I need to have this feature. Typically it is only being used to help create a single name space for the code.</p>
<p>Have you got any examples where multiple instances are useful?</p>
<p>As to the memory requirements&#8230; I take this is related to having multiple instances of the main object (a copy)&#8230; in which case, I still don&#8217;t think this is an issue for me, as I only have one instance of each object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-7</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 23 Mar 2007 21:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-7</guid>
		<description>Craig, there are two a darksides to your technique.

First, you can&#039;t create more than one instance of an object because you are directly assigning the class to a variable.

Second, because you are not using prototypes, it uses more memory because each instance of a class will have its own method instead of using a reference to a single method.

Take a look at to see how I do it (might not be the best way) : http://www.javascriptkata.com/2007/03/23/how-to-create-objects-in-object-oriented-javascript/

Thanks for your comment!</description>
		<content:encoded><![CDATA[<p>Craig, there are two a darksides to your technique.</p>
<p>First, you can&#8217;t create more than one instance of an object because you are directly assigning the class to a variable.</p>
<p>Second, because you are not using prototypes, it uses more memory because each instance of a class will have its own method instead of using a reference to a single method.</p>
<p>Take a look at to see how I do it (might not be the best way) : <a href="http://www.javascriptkata.com/2007/03/23/how-to-create-objects-in-object-oriented-javascript/" rel="nofollow">http://www.javascriptkata.com/2007/03/23/how-to-create-objects-in-object-oriented-javascript/</a></p>
<p>Thanks for your comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganeshji Marwaha</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-6</link>
		<dc:creator>Ganeshji Marwaha</dc:creator>
		<pubDate>Fri, 23 Mar 2007 21:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-6</guid>
		<description>was a pretty quick read... i expected see more examples though.</description>
		<content:encoded><![CDATA[<p>was a pretty quick read&#8230; i expected see more examples though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Lang</title>
		<link>http://www.javascriptkata.com/2007/03/19/5-reasons-to-write-object-oriented-oo-javascript/comment-page-1/#comment-5</link>
		<dc:creator>Rob Lang</dc:creator>
		<pubDate>Fri, 23 Mar 2007 09:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=5#comment-5</guid>
		<description>An interesting read. I would have added a link to a Javascript OO tutorial for the uninitiated. One that you thought was a goody. Just a thought!</description>
		<content:encoded><![CDATA[<p>An interesting read. I would have added a link to a Javascript OO tutorial for the uninitiated. One that you thought was a goody. Just a thought!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
