<?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 for Konr Ness</title>
	<atom:link href="http://konrness.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://konrness.com</link>
	<description>PHP, Javascript, HTML Programming</description>
	<lastBuildDate>Mon, 24 Aug 2009 15:04:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on How to Create Javascript Objects by Konr Ness</title>
		<link>http://konrness.com/javascript/how-to-create-javascript-objects/#comment-8</link>
		<dc:creator>Konr Ness</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://konrness.com/?p=33#comment-8</guid>
		<description>Thanks for all the comments here. There was a lively discussion on this method on reddit.com over the weekend. Check it out here: http://www.reddit.com/r/javascript/comments/9d0qb/how_to_create_javascript_objects_this_method/</description>
		<content:encoded><![CDATA[<p>Thanks for all the comments here. There was a lively discussion on this method on reddit.com over the weekend. Check it out here: <a href="http://www.reddit.com/r/javascript/comments/9d0qb/how_to_create_javascript_objects_this_method/" rel="nofollow">http://www.reddit.com/r/javascript/comments/9d0qb/how_to_create_javascript_objects_this_method/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create Javascript Objects by cancel bubble</title>
		<link>http://konrness.com/javascript/how-to-create-javascript-objects/#comment-6</link>
		<dc:creator>cancel bubble</dc:creator>
		<pubDate>Sun, 23 Aug 2009 20:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://konrness.com/?p=33#comment-6</guid>
		<description>This is the Module Pattern, if anyone is interested, check out the following link for more info:  http://yuiblog.com/blog/2007/06/12/module-pattern/</description>
		<content:encoded><![CDATA[<p>This is the Module Pattern, if anyone is interested, check out the following link for more info:  <a href="http://yuiblog.com/blog/2007/06/12/module-pattern/" rel="nofollow">http://yuiblog.com/blog/2007/06/12/module-pattern/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create Javascript Objects by Peter Burns</title>
		<link>http://konrness.com/javascript/how-to-create-javascript-objects/#comment-5</link>
		<dc:creator>Peter Burns</dc:creator>
		<pubDate>Sun, 23 Aug 2009 05:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://konrness.com/?p=33#comment-5</guid>
		<description>I&#039;ve started using this style in my code as well.  One stylistic choice I&#039;ve found very useful when assigning a variable that&#039;s the result of an anonymous function like &#039;Connection&#039; is above is to wrap the function in parentheses.

//You have to scroll down to the bottom of the function definition
//before being able to tell if Connector is the function or its result
var Connector = function() {
...
}();


//Here the parens make it more obvious that it&#039;s not just a simple
//assignment of a function
var Connector = (function() {
...
})();


It&#039;s identical in meaning, but the parens convey pretty clearly that something is going on.  I&#039;ve seen this style a few places and it seems as though this is becoming the suggested coding style.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve started using this style in my code as well.  One stylistic choice I&#8217;ve found very useful when assigning a variable that&#8217;s the result of an anonymous function like &#8216;Connection&#8217; is above is to wrap the function in parentheses.</p>
<p>//You have to scroll down to the bottom of the function definition<br />
//before being able to tell if Connector is the function or its result<br />
var Connector = function() {<br />
&#8230;<br />
}();</p>
<p>//Here the parens make it more obvious that it&#8217;s not just a simple<br />
//assignment of a function<br />
var Connector = (function() {<br />
&#8230;<br />
})();</p>
<p>It&#8217;s identical in meaning, but the parens convey pretty clearly that something is going on.  I&#8217;ve seen this style a few places and it seems as though this is becoming the suggested coding style.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create Javascript Objects by Konr Ness</title>
		<link>http://konrness.com/javascript/how-to-create-javascript-objects/#comment-4</link>
		<dc:creator>Konr Ness</dc:creator>
		<pubDate>Sat, 22 Aug 2009 16:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://konrness.com/?p=33#comment-4</guid>
		<description>&lt;a href=&quot;#comment-3&quot; rel=&quot;nofollow&quot;&gt;@Jansen Price &lt;/a&gt; 
I fixed the line numbers. Thanks.

Regarding adding &lt;code&gt;this&lt;/code&gt; to the &lt;code&gt;populateExtendedContent()&lt;/code&gt; call, this will not work. I think this is where this method of creating objects differs from normal OO programming, since &lt;code&gt;this&lt;/code&gt; refers to the object that is being returned by the function. The private methods and variables are outside of the scope of &lt;code&gt;this&lt;/code&gt; when in the &lt;code&gt;Connector&lt;/code&gt;.

I do like your idea of following common programming standards and prefixing the private variables and methods with underscores. I have updated the code to do this.</description>
		<content:encoded><![CDATA[<p><a href="#comment-3" rel="nofollow">@Jansen Price </a><br />
I fixed the line numbers. Thanks.</p>
<p>Regarding adding <code>this</code> to the <code>populateExtendedContent()</code> call, this will not work. I think this is where this method of creating objects differs from normal OO programming, since <code>this</code> refers to the object that is being returned by the function. The private methods and variables are outside of the scope of <code>this</code> when in the <code>Connector</code>.</p>
<p>I do like your idea of following common programming standards and prefixing the private variables and methods with underscores. I have updated the code to do this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create Javascript Objects by Jansen Price</title>
		<link>http://konrness.com/javascript/how-to-create-javascript-objects/#comment-3</link>
		<dc:creator>Jansen Price</dc:creator>
		<pubDate>Sat, 22 Aug 2009 13:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://konrness.com/?p=33#comment-3</guid>
		<description>Thanks for posting this. I think this sums up the best way to create object oriented javascript with ability for private methods and properties. 

I have been trying out RightJS (rightjs.org), which uses a Class object whereby you can create classes and extend those to other classes, and it also has the ability to encapsulate an Options class which provides a uniform way to pass options to your objects. I kind of like this way a little better because it is a little simpler.

The line number you reference are off by one.

Also, in line 38, could you use this.populateExtendedContent() (add the keyword &quot;this&quot;)? Do you have a preference on using &quot;this&quot; to indicate that it is a method of this object? And what about prefixing the private methods with an underscore? That might reduce maintenance headaches later on to help keep it straight which are public and private methods.</description>
		<content:encoded><![CDATA[<p>Thanks for posting this. I think this sums up the best way to create object oriented javascript with ability for private methods and properties. </p>
<p>I have been trying out RightJS (rightjs.org), which uses a Class object whereby you can create classes and extend those to other classes, and it also has the ability to encapsulate an Options class which provides a uniform way to pass options to your objects. I kind of like this way a little better because it is a little simpler.</p>
<p>The line number you reference are off by one.</p>
<p>Also, in line 38, could you use this.populateExtendedContent() (add the keyword &#8220;this&#8221;)? Do you have a preference on using &#8220;this&#8221; to indicate that it is a method of this object? And what about prefixing the private methods with an underscore? That might reduce maintenance headaches later on to help keep it straight which are public and private methods.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.295 seconds -->
