<?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: What are javascript prototypes? (longer answer)</title>
	<atom:link href="http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/</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: Mr Design</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-932</link>
		<dc:creator>Mr Design</dc:creator>
		<pubDate>Mon, 12 Jul 2010 01:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-932</guid>
		<description>I think the answer to your question is, like in Drupal - versioning. No body knows why Drupal&#039;s nodes are so heavily use vid&#039;s but it is so. Here&#039;s an example: &lt;a href=&quot;http://webdesignpatterns.org&quot; rel=&quot;nofollow&quot;&gt;http://webdesignpatterns.org&lt;/a&gt;. Now if it&#039;s usable, then why keeping only one value? Can we use arrays to keep multiple values backwards?</description>
		<content:encoded><![CDATA[<p>I think the answer to your question is, like in Drupal &#8211; versioning. No body knows why Drupal&#39;s nodes are so heavily use vid&#39;s but it is so. Here&#39;s an example: <a href="http://webdesignpatterns.org" rel="nofollow">http://webdesignpatterns.org</a>. Now if it&#39;s usable, then why keeping only one value? Can we use arrays to keep multiple values backwards?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-31</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 13 Aug 2007 20:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-31</guid>
		<description>Thanks for your comment! It&#039;s appreciated</description>
		<content:encoded><![CDATA[<p>Thanks for your comment! It&#8217;s appreciated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Roach</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-30</link>
		<dc:creator>Christopher Roach</dc:creator>
		<pubDate>Mon, 13 Aug 2007 20:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-30</guid>
		<description>Hi Dan,

In your first paragraph you mention that Javascript was the only language that you know of that uses prototypes.  Well, I just wanted to point out that, while Javascript makes good use of the prototype mechanism, it is by far not the only, nor the first, language to do so.  The first language to introduce this concept was the Self language.  Other languages today still use prototype method to perform OO.  The two languages, other than Javascript, that I am most acquainted with are Io and Lua.  Take a look at the Wikipedia article on Prototype-based Programming (http://en.wikipedia.org/wiki/Prototype-based_programming) and you&#039;ll no doubt find some other really interesting languages that do OO but don&#039;t use the traditional class-based methodology.

Cheers and keep up the good work,

Christopher</description>
		<content:encoded><![CDATA[<p>Hi Dan,</p>
<p>In your first paragraph you mention that Javascript was the only language that you know of that uses prototypes.  Well, I just wanted to point out that, while Javascript makes good use of the prototype mechanism, it is by far not the only, nor the first, language to do so.  The first language to introduce this concept was the Self language.  Other languages today still use prototype method to perform OO.  The two languages, other than Javascript, that I am most acquainted with are Io and Lua.  Take a look at the Wikipedia article on Prototype-based Programming (<a href="http://en.wikipedia.org/wiki/Prototype-based_programming" rel="nofollow">http://en.wikipedia.org/wiki/Prototype-based_programming</a>) and you&#8217;ll no doubt find some other really interesting languages that do OO but don&#8217;t use the traditional class-based methodology.</p>
<p>Cheers and keep up the good work,</p>
<p>Christopher</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hiram Abiff</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-29</link>
		<dc:creator>Hiram Abiff</dc:creator>
		<pubDate>Mon, 30 Apr 2007 00:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-29</guid>
		<description>For Ruby:

s = &quot;  string  &quot;

class String
  def trim2 #trim already exists
    self.gsub(/^\s*&#124;\s*$/, &#039;&#039;)
  end
end

s.trim2 # =&gt; &quot;string&quot;</description>
		<content:encoded><![CDATA[<p>For Ruby:</p>
<p>s = &#8221;  string  &#8221;</p>
<p>class String<br />
  def trim2 #trim already exists<br />
    self.gsub(/^\s*|\s*$/, &#8221;)<br />
  end<br />
end</p>
<p>s.trim2 # =&gt; &#8220;string&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-28</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 26 Mar 2007 14:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-28</guid>
		<description>Greg, this trim function clear all whitespaces before and after the string.

&quot;   TEST &quot; becomes &quot;TEST&quot;.

How can you extend objects this way in ruby? (by the way, have a look at my friend site : http://www.rubyfleebie.com/)</description>
		<content:encoded><![CDATA[<p>Greg, this trim function clear all whitespaces before and after the string.</p>
<p>&#8221;   TEST &#8221; becomes &#8220;TEST&#8221;.</p>
<p>How can you extend objects this way in ruby? (by the way, have a look at my friend site : <a href="http://www.rubyfleebie.com/)" rel="nofollow">http://www.rubyfleebie.com/)</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Knapp</title>
		<link>http://www.javascriptkata.com/2007/03/25/what-are-javascript-prototypes-longer-answer/comment-page-1/#comment-27</link>
		<dc:creator>Greg Knapp</dc:creator>
		<pubDate>Mon, 26 Mar 2007 10:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=12#comment-27</guid>
		<description>Hi,

Does the trim function you posted clear all whitespace - inc spaces between words? This would emulate trim behaviour?

String.prototype.trim = function() {
	return this.replace(/^\s*&#124;\s*$/g, &quot;&quot;);
}

I think Ruby emulates this behaviour as well, you can open any class (inc language base classes) and add methods.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Does the trim function you posted clear all whitespace &#8211; inc spaces between words? This would emulate trim behaviour?</p>
<p>String.prototype.trim = function() {<br />
	return this.replace(/^\s*|\s*$/g, &#8220;&#8221;);<br />
}</p>
<p>I think Ruby emulates this behaviour as well, you can open any class (inc language base classes) and add methods.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
