<?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: MooTools Javascript Classes</title>
	<atom:link href="http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/</link>
	<description>my god, it's full of stars</description>
	<pubDate>Sun, 06 Jul 2008 19:21:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Don&#8217;t forget to bind your functions, &#8216;this&#8217; can be a pain &#124; Camocarzi</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-52852</link>
		<dc:creator>Don&#8217;t forget to bind your functions, &#8216;this&#8217; can be a pain &#124; Camocarzi</dc:creator>
		<pubDate>Thu, 08 Nov 2007 12:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-52852</guid>
		<description>&lt;p&gt;[...] have, especially since I&#8217;ve started working Mootools classes and combining them with anonymous functions. The problem which Peter-Paul Koch explains very [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] have, especially since I&#8217;ve started working Mootools classes and combining them with anonymous functions. The problem which Peter-Paul Koch explains very [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaiser</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35867</link>
		<dc:creator>kaiser</dc:creator>
		<pubDate>Mon, 23 Jul 2007 18:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35867</guid>
		<description>&lt;p&gt;good questions, and i don't knot if my answers will be accurate, but here's my stab at:&lt;/p&gt;

&lt;p&gt;"Just because something was done on purpose doesn’t mean it was done for the right reasons" -- absolutely true, except that you're missing the point of prototype languages. wikipedia gives a good description of one, but a fundamental idea is that there are no classes.&lt;/p&gt;

&lt;p&gt;it seems, then, Ecma International made a conscious decision to base the standard on a prototype framework. no blunder -- design decision. there are probably a lot of things in the background that lend prototyping to be better suited for client-side implementation on a variety of platforms. (take a walk to the other extreme, java. how fast do pages load with an applet? what type of beast would that be for anyone to do casual/quick scripting?)&lt;/p&gt;

&lt;p&gt;the reason people are throwing in class emulation is really simple, in my view: what popular server-side languages are prototyping languages? fundamentally, none. they all have some class-based OOP. so it makes sense that people will want to continue working in a paradigm they're comfortable with (or open up the doors for others to dig into javascript without having to fully understand prototyping, closures, etc.).&lt;/p&gt;

&lt;p&gt;having said that, ecma-262 (4th edition) looks like it'll be bending to popular usage, since it will support classes, packages, and namespaces (though I'm confused how namespaces will function if that ability is pretty much there, syntactically at least). but there's no mention that they're ditching the prototyping foundation, so all the syntax support for classes will no doubt function similar to how mootools handles it. syntactic sugar, basically.&lt;/p&gt;

&lt;p&gt;the current actionscript is just a different beast for the reasons i just said in the latter paragraph, namely, using ecma-262 4th edition as its core. so it should be expected to be dramatically different than firefox's javascript. but it'd be interesting to see a direct real-life comparison between the two and what's functionally different from 3rd and 4th edition when you strip out the type-checking?&lt;/p&gt;

&lt;p&gt;(i also think javascript is going to lose appeal when people have to adhere to strongly typed declarations for a language that never had it. it's annoying for me, anyway. doesn't make sense, given the context it's used in.)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>good questions, and i don&#8217;t knot if my answers will be accurate, but here&#8217;s my stab at:</p>
<p>&#8220;Just because something was done on purpose doesn’t mean it was done for the right reasons&#8221; &#8212; absolutely true, except that you&#8217;re missing the point of prototype languages. wikipedia gives a good description of one, but a fundamental idea is that there are no classes.</p>
<p>it seems, then, Ecma International made a conscious decision to base the standard on a prototype framework. no blunder &#8212; design decision. there are probably a lot of things in the background that lend prototyping to be better suited for client-side implementation on a variety of platforms. (take a walk to the other extreme, java. how fast do pages load with an applet? what type of beast would that be for anyone to do casual/quick scripting?)</p>
<p>the reason people are throwing in class emulation is really simple, in my view: what popular server-side languages are prototyping languages? fundamentally, none. they all have some class-based OOP. so it makes sense that people will want to continue working in a paradigm they&#8217;re comfortable with (or open up the doors for others to dig into javascript without having to fully understand prototyping, closures, etc.).</p>
<p>having said that, ecma-262 (4th edition) looks like it&#8217;ll be bending to popular usage, since it will support classes, packages, and namespaces (though I&#8217;m confused how namespaces will function if that ability is pretty much there, syntactically at least). but there&#8217;s no mention that they&#8217;re ditching the prototyping foundation, so all the syntax support for classes will no doubt function similar to how mootools handles it. syntactic sugar, basically.</p>
<p>the current actionscript is just a different beast for the reasons i just said in the latter paragraph, namely, using ecma-262 4th edition as its core. so it should be expected to be dramatically different than firefox&#8217;s javascript. but it&#8217;d be interesting to see a direct real-life comparison between the two and what&#8217;s functionally different from 3rd and 4th edition when you strip out the type-checking?</p>
<p>(i also think javascript is going to lose appeal when people have to adhere to strongly typed declarations for a language that never had it. it&#8217;s annoying for me, anyway. doesn&#8217;t make sense, given the context it&#8217;s used in.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35822</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Mon, 23 Jul 2007 02:30:13 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35822</guid>
		<description>&lt;p&gt;&lt;strong&gt;kaiser:&lt;/strong&gt; Then my question for you is how did ECMAScript evolve into a fully strictly-typed object-oriented language if Javascript (based on ECMA) isn't "supposed" to have classes?  And if this is the case: why does ActionScript have classes? It serves essentially the same functionality as Javascript does but with a different interface (flash rather than the browser).&lt;/p&gt;

&lt;p&gt;And one last point: if it's not a blunder, why do so many libraries emulate classes?  Just because something was done on purpose doesn't mean it was done for the right reasons.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><strong>kaiser:</strong> Then my question for you is how did ECMAScript evolve into a fully strictly-typed object-oriented language if Javascript (based on ECMA) isn&#8217;t &#8220;supposed&#8221; to have classes?  And if this is the case: why does ActionScript have classes? It serves essentially the same functionality as Javascript does but with a different interface (flash rather than the browser).</p>
<p>And one last point: if it&#8217;s not a blunder, why do so many libraries emulate classes?  Just because something was done on purpose doesn&#8217;t mean it was done for the right reasons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaiser</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35657</link>
		<dc:creator>kaiser</dc:creator>
		<pubDate>Sat, 21 Jul 2007 02:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35657</guid>
		<description>&lt;p&gt;javascript doesn't have true classes because it's not supposed to. it's a prototyping language, and from my understanding on these types of languages, it's just a matter of design.&lt;/p&gt;

&lt;p&gt;think if prototyping could really work in a more traditional OO language? (i guess ruby can rename and eval functions to attach to a class at runtime, but i don't have enough experience to know if changes to a class reflect to any current instances.)&lt;/p&gt;

&lt;p&gt;but yeah, no blunder at all. it's pretty amazing, actually, that you should even be able to emulate typical class functionality.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>javascript doesn&#8217;t have true classes because it&#8217;s not supposed to. it&#8217;s a prototyping language, and from my understanding on these types of languages, it&#8217;s just a matter of design.</p>
<p>think if prototyping could really work in a more traditional OO language? (i guess ruby can rename and eval functions to attach to a class at runtime, but i don&#8217;t have enough experience to know if changes to a class reflect to any current instances.)</p>
<p>but yeah, no blunder at all. it&#8217;s pretty amazing, actually, that you should even be able to emulate typical class functionality.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35231</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Wed, 18 Jul 2007 06:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35231</guid>
		<description>&lt;p&gt;&lt;strong&gt;Jonathan:&lt;/strong&gt; I think it relies a lot on the person's programming style.  Personally, the more involved I get with Rails and ActionScript, the more OO-at-heart I become with my Javascript.  Now I can't seem to do anything without a Class or thinking it's a dirty approach ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><strong>Jonathan:</strong> I think it relies a lot on the person&#8217;s programming style.  Personally, the more involved I get with Rails and ActionScript, the more OO-at-heart I become with my Javascript.  Now I can&#8217;t seem to do anything without a Class or thinking it&#8217;s a dirty approach ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rubynho</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35110</link>
		<dc:creator>Rubynho</dc:creator>
		<pubDate>Tue, 17 Jul 2007 16:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35110</guid>
		<description>&lt;p&gt;I use a technique I learned from the Ext JS library. Here's a live sample of one of the most complex declarations I use:&lt;/p&gt;

&lt;p&gt;JR.Widget.TextField = function(h){
  JR.Widget.TextField.superclass.constructor.call(this);
  this.mix&lt;em&gt;init&lt;/em&gt;textfieldlabel();
  this.merge&lt;em&gt;conf({
      cls: 'jr-textfield',
      text&lt;/em&gt;range: null,      // msie
      size: 20
      },h);
  if (this.gut.place){
    this.set_place(this.gut.place);
  }
};&lt;/p&gt;

&lt;p&gt;JR.mix(JR.Widget.TextField, JR.Widget.Common, 
    JR.Widget.CommonValidation, CommonTextFieldDataValue, 
        CommonTextFieldLabel, {&lt;/p&gt;

&lt;p&gt;set_place: function(s, conf){
    [snip]
  }
    [snip]&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;It's single-inheritance with mixin support as well. It has scaled to tens of classes. Way cool and even uses namespace (JR) which is non-intrusive.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I use a technique I learned from the Ext JS library. Here&#8217;s a live sample of one of the most complex declarations I use:</p>
<p>JR.Widget.TextField = function(h){<br />
  JR.Widget.TextField.superclass.constructor.call(this);<br />
  this.mix<em>init</em>textfieldlabel();<br />
  this.merge<em>conf({<br />
      cls: &#8216;jr-textfield&#8217;,<br />
      text</em>range: null,      // msie<br />
      size: 20<br />
      },h);<br />
  if (this.gut.place){<br />
    this.set_place(this.gut.place);<br />
  }<br />
};</p>
<p>JR.mix(JR.Widget.TextField, JR.Widget.Common,<br />
    JR.Widget.CommonValidation, CommonTextFieldDataValue,<br />
        CommonTextFieldLabel, {</p>
<p>set_place: function(s, conf){<br />
    [snip]<br />
  }<br />
    [snip]</p>
<p>}</p>
<p>It&#8217;s single-inheritance with mixin support as well. It has scaled to tens of classes. Way cool and even uses namespace (JR) which is non-intrusive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Snook</title>
		<link>http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35066</link>
		<dc:creator>Jonathan Snook</dc:creator>
		<pubDate>Tue, 17 Jul 2007 11:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://warpspire.com/tipsresources/interface-scripting/mootools-javascript-classes/#comment-35066</guid>
		<description>&lt;p&gt;I'd hardly consider it a blunder that JavaScript doesn't have true class inheritance. Sure, plenty of people have come up with ways to solve "the problem" but I almost never require complex deep inheritance. &lt;/p&gt;

&lt;p&gt;The Prototype/Mootools "mixin" approach, though, is very handy but even then, i mostly use it for class options and not for any kind of inheritance.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;d hardly consider it a blunder that JavaScript doesn&#8217;t have true class inheritance. Sure, plenty of people have come up with ways to solve &#8220;the problem&#8221; but I almost never require complex deep inheritance. </p>
<p>The Prototype/Mootools &#8220;mixin&#8221; approach, though, is very handy but even then, i mostly use it for class options and not for any kind of inheritance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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