<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Object-Orientated JavaScript</title>
	<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/</link>
	<description>Sharing useful things with the world.</description>
	<pubDate>Thu, 24 Jul 2008 09:43:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Christian S.</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#comment-7990</link>
		<dc:creator>Christian S.</dc:creator>
		<pubDate>Wed, 07 Mar 2007 17:58:08 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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 - 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-7864</link>
		<dc:creator>horst</dc:creator>
		<pubDate>Sun, 04 Mar 2007 14:34:12 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#comment-7864</guid>
		<description>&lt;p&gt;nope Andrey. It'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-6026</link>
		<dc:creator>gaba: TÅ±zfablog</dc:creator>
		<pubDate>Mon, 11 Dec 2006 19:56:49 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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>[&#8230;] 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 [&#8230;]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#comment-3310</link>
		<dc:creator>Andrey</dc:creator>
		<pubDate>Wed, 21 Jun 2006 09:56:08 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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-747</link>
		<dc:creator>Keith Hollingshead</dc:creator>
		<pubDate>Sun, 22 Jan 2006 16:08:40 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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-744</link>
		<dc:creator>Mark Koesel</dc:creator>
		<pubDate>Fri, 20 Jan 2006 18:08:42 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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-176</link>
		<dc:creator>Gabriel Boehme</dc:creator>
		<pubDate>Mon, 01 Aug 2005 20:46:18 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#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 &#38; 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>
	<item>
		<title>By: Nir Tayeb</title>
		<link>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#comment-88</link>
		<dc:creator>Nir Tayeb</dc:creator>
		<pubDate>Fri, 08 Jul 2005 19:08:52 +0000</pubDate>
		<guid>http://blog.firetree.net/2005/06/16/object-orientated-javascript/#comment-88</guid>
		<description>&lt;p&gt;for member private function do that:
&lt;pre&gt;&lt;code&gt;
function C(){
  var m&lt;em&gt;private&lt;/em&gt;func = function(){
  }&lt;/p&gt;

&lt;p&gt;this.getData = function(){ m&lt;em&gt;private&lt;/em&gt;func(); }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>for member private function do that:
<pre><code>
function C(){
  var m<em>private</em>func = function(){
  }</code></pre></p>

<p>this.getData = function(){ m<em>private</em>func(); }
}
</p>]]></content:encoded>
	</item>
</channel>
</rss>
