<?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"
	>
<channel>
	<title>Comments on: JavaScript inheritance - how and why</title>
	<atom:link href="http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Tue, 06 Jan 2009 10:32:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: JavaScript namespacing - an alternative to JavaScript inheritance - Robert&#8217;s talk - Web development and Internet trends</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-468007</link>
		<dc:creator>JavaScript namespacing - an alternative to JavaScript inheritance - Robert&#8217;s talk - Web development and Internet trends</dc:creator>
		<pubDate>Wed, 29 Oct 2008 16:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-468007</guid>
		<description>[...] talking about JavaScript and inheritance, something that often go amiss from the discussion is the alternative of using proper namespacing [...]</description>
		<content:encoded><![CDATA[<p>[...] talking about JavaScript and inheritance, something that often go amiss from the discussion is the alternative of using proper namespacing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-466875</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 22 Oct 2008 18:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-466875</guid>
		<description>Anders,


:-)</description>
		<content:encoded><![CDATA[<p>Anders,</p>
<p> <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders Ytterström</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-466862</link>
		<dc:creator>Anders Ytterström</dc:creator>
		<pubDate>Wed, 22 Oct 2008 17:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-466862</guid>
		<description>Robert,

The three of us whom write javascript has a silent agreement to avoid it, I think. There are times when it is tempting to do it just because you can, but one use to find a more straightforward way to solve the problem during the coffee break. :)</description>
		<content:encoded><![CDATA[<p>Robert,</p>
<p>The three of us whom write javascript has a silent agreement to avoid it, I think. There are times when it is tempting to do it just because you can, but one use to find a more straightforward way to solve the problem during the coffee break. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaScript inheritance - experimenting with syntax alternatives and private variables - Robert&#8217;s talk - Web development and Internet trends</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-466695</link>
		<dc:creator>JavaScript inheritance - experimenting with syntax alternatives and private variables - Robert&#8217;s talk - Web development and Internet trends</dc:creator>
		<pubDate>Tue, 21 Oct 2008 21:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-466695</guid>
		<description>[...] reading this article, I strongly recommend reading JavaScript inheritance - how and why and Explaining JavaScript scope and closures first, since many phenomenon below will have their [...]</description>
		<content:encoded><![CDATA[<p>[...] reading this article, I strongly recommend reading JavaScript inheritance - how and why and Explaining JavaScript scope and closures first, since many phenomenon below will have their [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaScript: how to get private, privileged, public and static members (properties and methods) - Robert&#8217;s talk - Web development and Internet trends</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-461714</link>
		<dc:creator>JavaScript: how to get private, privileged, public and static members (properties and methods) - Robert&#8217;s talk - Web development and Internet trends</dc:creator>
		<pubDate>Tue, 14 Oct 2008 11:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-461714</guid>
		<description>[...] reading JavaScript inheritance - how and why and Explaining JavaScript scope and closures, I thought we&#8217;d combine the knowledge gained to [...]</description>
		<content:encoded><![CDATA[<p>[...] reading JavaScript inheritance - how and why and Explaining JavaScript scope and closures, I thought we&#8217;d combine the knowledge gained to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-454721</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 08 Oct 2008 06:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-454721</guid>
		<description>Stefan,

Thanks for sharing! I was hoping someone would express their love for a class-based approach. :-)

It depends on a few factors, as you say: in very, very large projects it might become useful, but my estimate is, like you say, that memory usage will increase (and while not dramatically, every byte counts for me).

In terms of private and protected properties and methods, the Yahoo Module Pattern offers you just that: one part which can be private and another with protected or public methods.

Regarding your JavaScript framework, if it ever becomes official, please let me know! :-)</description>
		<content:encoded><![CDATA[<p>Stefan,</p>
<p>Thanks for sharing! I was hoping someone would express their love for a class-based approach. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>It depends on a few factors, as you say: in very, very large projects it might become useful, but my estimate is, like you say, that memory usage will increase (and while not dramatically, every byte counts for me).</p>
<p>In terms of private and protected properties and methods, the Yahoo Module Pattern offers you just that: one part which can be private and another with protected or public methods.</p>
<p>Regarding your JavaScript framework, if it ever becomes official, please let me know! <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Van Reeth</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-454243</link>
		<dc:creator>Stefan Van Reeth</dc:creator>
		<pubDate>Tue, 07 Oct 2008 21:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-454243</guid>
		<description>You hava a strong case Robert, and I agree that for websites your approach is certainly the way to go. JavaScript is prototype based and should be used as such.

However, I feel that in some cases it can be real usefull to mimic class based languages in some respects. Again it's utterly dependent on user case and personal style, but for larger codebases, I prefer such an approach. However, this has issues as u describe.

What is needed for the class based emulation approach is something that gives us the goodies from other languages, without sacrificing native js syntax and behaviour. I do know a solution, but it's in-house developed (I own it, but I agreed not to make it public yet). Forgive me to bring it up here, but I need it to illustrate my views.

To cut short, it's possible to merge the two approaches gracefully. At home I can make class-like structures that I can use the native way, without any further calls to Class.extend() or something similiar. All magic is done by putting a few calls into the constructor and after that u can instantiate the classical way (ie with 'new').

Since I constructed this little lib, my productivity has increased dramatically. I now can have private, protected and static methods/properties. I have access control to classes and methods. When debugging I now get meaningfull errors, my objects can be introspected without writing endless for-in loops, etc. The trade-off is an increased memory usage, but that only shows when one creates something silly like 100.000 classes, and even then we're not talking megabytes here.

While I agree that such things are overkill for ordinary websites, for larger projects I feel classical js falls short. At some point it pays off to start using a framework, if only to make the codebase easier to maintain. The way I use MF - Mystery Framework ;) - I have the best of both worlds. I have all the benefits of js prototypical nature AND the ease of constraints like we know from Java. Lovely when the codebase surpasses the 1000 lines or so.

Forgive me this elaborate post again, but it has been a while and I don't seem to be able to post anything short anyway :D

Cheers to all that made it this far!!!</description>
		<content:encoded><![CDATA[<p>You hava a strong case Robert, and I agree that for websites your approach is certainly the way to go. JavaScript is prototype based and should be used as such.</p>
<p>However, I feel that in some cases it can be real usefull to mimic class based languages in some respects. Again it&#8217;s utterly dependent on user case and personal style, but for larger codebases, I prefer such an approach. However, this has issues as u describe.</p>
<p>What is needed for the class based emulation approach is something that gives us the goodies from other languages, without sacrificing native js syntax and behaviour. I do know a solution, but it&#8217;s in-house developed (I own it, but I agreed not to make it public yet). Forgive me to bring it up here, but I need it to illustrate my views.</p>
<p>To cut short, it&#8217;s possible to merge the two approaches gracefully. At home I can make class-like structures that I can use the native way, without any further calls to Class.extend() or something similiar. All magic is done by putting a few calls into the constructor and after that u can instantiate the classical way (<acronym title="Internet Explorer">IE</acronym> with &#8216;new&#8217;).</p>
<p>Since I constructed this little lib, my productivity has increased dramatically. I now can have private, protected and static methods/properties. I have access control to classes and methods. When debugging I now get meaningfull errors, my objects can be introspected without writing endless for-in loops, etc. The trade-off is an increased memory usage, but that only shows when one creates something silly like 100.000 classes, and even then we&#8217;re not talking megabytes here.</p>
<p>While I agree that such things are overkill for ordinary websites, for larger projects I feel classical js falls short. At some point it pays off to start using a framework, if only to make the codebase easier to maintain. The way I use MF - Mystery Framework <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> - I have the best of both worlds. I have all the benefits of js prototypical nature AND the ease of constraints like we know from Java. Lovely when the codebase surpasses the 1000 lines or so.</p>
<p>Forgive me this elaborate post again, but it has been a while and I don&#8217;t seem to be able to post anything short anyway <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Cheers to all that made it this far!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-454104</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 07 Oct 2008 18:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-454104</guid>
		<description>mdmadph,

But is that the framework pushing you into using it, or just that it would've been needed when you had it, no matter which JavaScript library you were using?</description>
		<content:encoded><![CDATA[<p>mdmadph,</p>
<p>But is that the framework pushing you into using it, or just that it would&#8217;ve been needed when you had it, no matter which JavaScript library you were using?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdmadph</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-452950</link>
		<dc:creator>mdmadph</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-452950</guid>
		<description>In ExtJS, I've actually used super functions here and there, cause there's so much inheritance going on everywhere, but that's about it.</description>
		<content:encoded><![CDATA[<p>In ExtJS, I&#8217;ve actually used super functions here and there, cause there&#8217;s so much inheritance going on everywhere, but that&#8217;s about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-452865</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 06 Oct 2008 19:24:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-452865</guid>
		<description>Steven,

Interesting, thanks for the tip!

Anders,

Glad you liked it! The metaprogramming chapter is my favorite chapter in a JavaScript ever (or at least for a long long time)!

Kudos for using &lt;a href="http://www.robertnyman.com/dlite/" rel="nofollow"&gt;dLite&lt;/a&gt;!

By the way, would you say that by using Prototype at work for inheritance, that you might overuse inheritance inadvertedly or not?

Andrea,

Thanks! I haven't fully read your document, but it looks quite good!</description>
		<content:encoded><![CDATA[<p>Steven,</p>
<p>Interesting, thanks for the tip!</p>
<p>Anders,</p>
<p>Glad you liked it! The metaprogramming chapter is my favorite chapter in a JavaScript ever (or at least for a long long time)!</p>
<p>Kudos for using <a href="http://www.robertnyman.com/dlite/" rel="nofollow">dLite</a>!</p>
<p>By the way, would you say that by using Prototype at work for inheritance, that you might overuse inheritance inadvertedly or not?</p>
<p>Andrea,</p>
<p>Thanks! I haven&#8217;t fully read your document, but it looks quite good!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-452246</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Mon, 06 Oct 2008 08:42:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-452246</guid>
		<description>Hi Robert, good stuff as usual :-)

The only thing is: why people completely ignore &lt;a href="http://www.3site.eu/doc/" rel="nofollow"&gt;my document&lt;/a&gt;? :P</description>
		<content:encoded><![CDATA[<p>Hi Robert, good stuff as usual <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The only thing is: why people completely ignore <a href="http://www.3site.eu/doc/" rel="nofollow">my document</a>? <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders Ytterström</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-452239</link>
		<dc:creator>Anders Ytterström</dc:creator>
		<pubDate>Mon, 06 Oct 2008 08:33:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-452239</guid>
		<description>Nice read! Yesterday I finished reading about metaprogramming in JavaScript (Art and Science of JavaScript, Sitepoint), so it was a good coincidence that you blogged about it.

Since I'm bound to Prototype in my current project at work, I stick to their class-like inheritence during office-time. On my own though (no libraries here except DLite), I will start to use the module pattern since it make sense to me.</description>
		<content:encoded><![CDATA[<p>Nice read! Yesterday I finished reading about metaprogramming in JavaScript (Art and Science of JavaScript, Sitepoint), so it was a good coincidence that you blogged about it.</p>
<p>Since I&#8217;m bound to Prototype in my current project at work, I stick to their class-like inheritence during office-time. On my own though (no libraries here except DLite), I will start to use the module pattern since it make sense to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Clark</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-451825</link>
		<dc:creator>Steven Clark</dc:creator>
		<pubDate>Sun, 05 Oct 2008 23:41:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-451825</guid>
		<description>Its at about 35 minutes into episode 2. Sorry I should have mentioned that. :)</description>
		<content:encoded><![CDATA[<p>Its at about 35 minutes into episode 2. Sorry I should have mentioned that. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Clark</title>
		<link>http://www.robertnyman.com/2008/10/06/javascript-inheritance-how-and-why/#comment-451824</link>
		<dc:creator>Steven Clark</dc:creator>
		<pubDate>Sun, 05 Oct 2008 23:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/?p=865#comment-451824</guid>
		<description>Interesting, I've done a fair bit of Java and understand class inheritance well enough, but JavaScript I'm pretty weak on...

If you've missed it (which I'd be surprised) the Open Web Podcast episode 2 has a bit of a discussion of the inheritance issue, which is kind of interesting.

http://openwebpodcast.com/</description>
		<content:encoded><![CDATA[<p>Interesting, I&#8217;ve done a fair bit of Java and understand class inheritance well enough, but JavaScript I&#8217;m pretty weak on&#8230;</p>
<p>If you&#8217;ve missed it (which I&#8217;d be surprised) the Open Web Podcast episode 2 has a bit of a discussion of the inheritance issue, which is kind of interesting.</p>
<p><a href="http://openwebpodcast.com/" rel="nofollow">http://openwebpodcast.com/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
