<?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: Object-Orientated JavaScript</title>
	<atom:link href="http://blog.firetree.net/2005/06/16/object-orientated-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/</link>
	<description>Sharing useful things with the world.</description>
	<lastBuildDate>Fri, 21 Jan 2011 09:51:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Deepak</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-25443</link>
		<dc:creator>Deepak</dc:creator>
		<pubDate>Mon, 29 Mar 2010 09:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-25443</guid>
		<description>&lt;p&gt;Fantastic! Thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fantastic! Thanks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: _es</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-25010</link>
		<dc:creator>_es</dc:creator>
		<pubDate>Sun, 25 Jan 2009 19:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-25010</guid>
		<description>&lt;p&gt;Local static variable?
&quot;staticlocal&quot; is GLOBAL variable - property.&lt;/p&gt;

&lt;p&gt;var id1 = function(){var n = 0;  return function(){return n++;};}(); // or:
with({n:0}) var id2 = function(){return n++;};&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Local static variable?
&#8220;staticlocal&#8221; is GLOBAL variable &#8211; property.</p>

<p>var id1 = function(){var n = 0;  return function(){return n++;};}(); // or:
with({n:0}) var id2 = function(){return n++;};</p>]]></content:encoded>
	</item>
	<item>
		<title>By: af</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-24958</link>
		<dc:creator>af</dc:creator>
		<pubDate>Tue, 16 Dec 2008 03:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-24958</guid>
		<description>&lt;p&gt;note that &#039;this&#039; doesn&#039;t refer to the function itself, but the object through which the function was invoked.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>note that &#8216;this&#8217; doesn&#8217;t refer to the function itself, but the object through which the function was invoked.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Christian S.</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-7990</link>
		<dc:creator>Christian S.</dc:creator>
		<pubDate>Wed, 07 Mar 2007 17:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-7990</guid>
		<description>&lt;p&gt;member function - PRIVATE:&lt;/p&gt;

&lt;p&gt;class C
  {
  private:
      void implementation() {}
  };&lt;/p&gt;

&lt;p&gt;// NO JAVASCRIPT EQUIVALENT&lt;/p&gt;

&lt;p&gt;Isnt it as follows??&lt;/p&gt;

&lt;p&gt;function C()
{
   var implementation = function()
   {
   };
}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>member function &#8211; PRIVATE:</p>

<p>class C
  {
  private:
      void implementation() {}
  };</p>

<p>// NO JAVASCRIPT EQUIVALENT</p>

<p>Isnt it as follows??</p>

<p>function C()
{
   var implementation = function()
   {
   };
}</p>]]></content:encoded>
	</item>
	<item>
		<title>By: horst</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-7864</link>
		<dc:creator>horst</dc:creator>
		<pubDate>Sun, 04 Mar 2007 14:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-7864</guid>
		<description>&lt;p&gt;nope Andrey. It&#039;s slower.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>nope Andrey. It&#8217;s slower.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: gaba: TÃ…Â±zfablog</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-6026</link>
		<dc:creator>gaba: TÃ…Â±zfablog</dc:creator>
		<pubDate>Mon, 11 Dec 2006 19:56:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-6026</guid>
		<description>&lt;p&gt;[...] Ha mÃƒÂ¡r ott voltam, kÃƒÂ¶rbenÃƒÂ©ztem a blogon. Szimpatikus hely. Van pl. egy ÃƒÂ©rdekes cikk, ami a JavaScript objektumorientÃƒÂ¡l vonÃƒÂ¡sait vizsgÃƒÂ¡lja meg a C++-hoz valÃƒÂ³ hasonlÃƒÂ­tÃƒÂ¡s segÃƒÂ­tsÃƒÂ©gÃƒÂ©vel: Object Orientated JavaScript [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Ha mÃƒÂ¡r ott voltam, kÃƒÂ¶rbenÃƒÂ©ztem a blogon. Szimpatikus hely. Van pl. egy ÃƒÂ©rdekes cikk, ami a JavaScript objektumorientÃƒÂ¡l vonÃƒÂ¡sait vizsgÃƒÂ¡lja meg a C++-hoz valÃƒÂ³ hasonlÃƒÂ­tÃƒÂ¡s segÃƒÂ­tsÃƒÂ©gÃƒÂ©vel: Object Orientated JavaScript [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-3310</link>
		<dc:creator>Andrey</dc:creator>
		<pubDate>Wed, 21 Jun 2006 09:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-3310</guid>
		<description>&lt;p&gt;function C(){
      this.getData = function(){ return true; }
}
better is
function C(){}
function C.prototype.getData() { return true; }&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>function C(){
      this.getData = function(){ return true; }
}
better is
function C(){}
function C.prototype.getData() { return true; }</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Hollingshead</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-747</link>
		<dc:creator>Keith Hollingshead</dc:creator>
		<pubDate>Sun, 22 Jan 2006 16:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-747</guid>
		<description>&lt;p&gt;nice article!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>nice article!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Koesel</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-744</link>
		<dc:creator>Mark Koesel</dc:creator>
		<pubDate>Fri, 20 Jan 2006 18:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-744</guid>
		<description>&lt;p&gt;When not preceded with a class name in dot notation, nested functions in JavaScript are &lt;em&gt;not&lt;/em&gt; static methods.  By necessity, static methods can only access static members.  Clearly nested functions can access instance members and thus they must not be static.  They must, instead, be instance methods.&lt;/p&gt;

&lt;p&gt;FireFox and Safari may well allow these nested functions to be called as public static methods of the class.  This means that these two userAgents have a namespace collision between public static methods and private instance methods.  That is to say that, by declaring one, you automatically declare the other.  What this means is that these methods will have undesired behavior when called in whichever context they were not designed for.  However, we must point out that constructors in Javascript face the same dilema since they too can be called statically.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>When not preceded with a class name in dot notation, nested functions in JavaScript are <em>not</em> static methods.  By necessity, static methods can only access static members.  Clearly nested functions can access instance members and thus they must not be static.  They must, instead, be instance methods.</p>

<p>FireFox and Safari may well allow these nested functions to be called as public static methods of the class.  This means that these two userAgents have a namespace collision between public static methods and private instance methods.  That is to say that, by declaring one, you automatically declare the other.  What this means is that these methods will have undesired behavior when called in whichever context they were not designed for.  However, we must point out that constructors in Javascript face the same dilema since they too can be called statically.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Boehme</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/comment-page-1/#comment-176</link>
		<dc:creator>Gabriel Boehme</dc:creator>
		<pubDate>Mon, 01 Aug 2005 20:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.firetree.net/?p=9#comment-176</guid>
		<description>&lt;p&gt;Check out http://www.crockford.com/javascript/private.html and http://www.litotes.demon.co.uk/js&#95;info/private_static.html for techniques for creating private variables &amp; methods in Javascript, and http://www.crockford.com/javascript/inheritance.html for further ways of duplicating classical inheritance within Javascript.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Check out <a href="http://www.crockford.com/javascript/private.html" rel="nofollow">http://www.crockford.com/javascript/private.html</a> and <a href="http://www.litotes.demon.co.uk/js&#95;info/private_static.html" rel="nofollow">http://www.litotes.demon.co.uk/js&#95;info/private_static.html</a> for techniques for creating private variables &amp; methods in Javascript, and <a href="http://www.crockford.com/javascript/inheritance.html" rel="nofollow">http://www.crockford.com/javascript/inheritance.html</a> for further ways of duplicating classical inheritance within Javascript.</p>]]></content:encoded>
	</item>
</channel>
</rss>

