<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MoMolog &#187; Mootools</title>
	<atom:link href="http://momolog.info/category/javascript/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://momolog.info</link>
	<description>MoMolog aus Berlin stellt sich vor. Projekte, Ideen, Referenzen.</description>
	<lastBuildDate>Sun, 18 Jul 2010 22:13:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Prototype Hash was killed</title>
		<link>http://momolog.info/2008/02/09/prototype-hash-was-killed/</link>
		<comments>http://momolog.info/2008/02/09/prototype-hash-was-killed/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 14:43:53 +0000</pubDate>
		<dc:creator>aljoscha</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://momolog.info/2008/02/09/prototype-hash-was-killed/</guid>
		<description><![CDATA[In what they call a &#8220;backwards compatibility change&#8221; the prototype core developers have introduced some changes to the prototype Hash class. A little history: From version 1.5 the Hash class started behaving a bit differently because now the Enumerable methods where copied into the Hash prototype instead of into the instances, as before. That helped [...]]]></description>
			<content:encoded><![CDATA[<p>In what they call a &#8220;<a href="http://prototypejs.org/api/hash">backwards compatibility change</a>&#8221; the prototype core developers have introduced some changes to the prototype Hash class.<br />
A little history:<br />
From version 1.5 the Hash class started behaving a bit differently because now the Enumerable methods where copied into the Hash <strong>prototype</strong> instead of into the instances, as before. That helped minimize the memory footprint but introduced incompatibilities and removed the possibility to patch Enumerables methods because after patching Enumerable one would have to manually copy its methods into all &#8220;inheriting&#8221; classes again.<br />
To my understanding that is in conflict with the dynamic inheritance in prototype-based languages like javascript.<br />
See <a href="http://groups.google.com/group/prototype-core/browse_thread/thread/d6c5b3caa59f003d/524412167c69b4c8?lnk=gst&#038;q=hash#524412167c69b4c8">this thread</a> for more info.</p>
<p>Now with 1.6. things get worse. The Hash object is not an JS object with added functionality anymore, its a wrapper around one.<br />
The following code will work in 1.5.0.2 but not in 1.6:<br />
<pre><code>
test = $H({a: 1, b:2});
alert(test.a); // -&gt; 1 in version 1.5
</code></pre><br />
Instead, in prototype 1.6 you have to write <code>test.get(&#039;a&#039;)</code> to get to the property &#8220;a&#8221; of the underlying object. In case you need the whole object, there is always <code>test.toObject()</code> to the rescue. Bye bye, consise and short notation.</p>
<p>I feel the developers forgot what made prototype so wildly successfull: Its beautiful concept of enhancing the built in objects, not wrapping them.</p>
<p>I consider leaving the prototype world alltogether and will switch to <a href="http://mootools.net">mootools</a>. </p>
<p><a href="http://dev.rubyonrails.org/ticket/3592">Unlike prototype</a>, mootools returns a hash on filtering a hash.</p>
]]></content:encoded>
			<wfw:commentRss>http://momolog.info/2008/02/09/prototype-hash-was-killed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
