<?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: Class Warfare</title>
	<atom:link href="http://infrequently.org/2012/04/class-warfare/feed/" rel="self" type="application/rss+xml" />
	<link>http://infrequently.org/2012/04/class-warfare/</link>
	<description>Alex Russell on browsers, standards, and the process of progress.</description>
	<lastBuildDate>Thu, 11 Apr 2013 16:50:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Craig Ewert</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239919</link>
		<dc:creator>Craig Ewert</dc:creator>
		<pubDate>Wed, 30 May 2012 22:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239919</guid>
		<description><![CDATA[&gt;  ... short-term stack space in our wetware ...

First, please don&#039;t talk like that.  Second, if you are keeping the JS way of doing objects (prototypes, etc) in short-term memory, you are doing it wrong.]]></description>
		<content:encoded><![CDATA[<p>&gt;  &#8230; short-term stack space in our wetware &#8230;</p>
<p>First, please don&#8217;t talk like that.  Second, if you are keeping the JS way of doing objects (prototypes, etc) in short-term memory, you are doing it wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: In Defense of JavaScript Constructor Functions (Classes) &#124; dBlogIt by Dustin Boston</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239860</link>
		<dc:creator>In Defense of JavaScript Constructor Functions (Classes) &#124; dBlogIt by Dustin Boston</dc:creator>
		<pubDate>Sun, 06 May 2012 22:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239860</guid>
		<description><![CDATA[[...] 6, 2012 by Dustin Boston    So there&#8217;s lots of debate about the merits of pure JavaScript objects (using Prototypal Inheritance) vs constructor functions [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 6, 2012 by Dustin Boston    So there&#8217;s lots of debate about the merits of pure JavaScript objects (using Prototypal Inheritance) vs constructor functions [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239818</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 27 Apr 2012 14:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239818</guid>
		<description><![CDATA[I don&#039;t get why adding classes to the spec is even up for discussion. Call me a JS purist, but I came from a classical background, OOP to the core. Switching to the prototypical paradigm was like putting mayonnaise on my peanut butter &amp; jelly. It tasted bad; I hated taking bites and I just wanted nothing to do with it.

I realized, maybe if I have to deal with mayonnaise, why not just try making an equally tasty sandwich with the new ingredient?

&quot;Don’t add classes and the world at large thinks of JS as a joke and a toy&quot; -- so because we have a &quot;new generation&quot; of classically-trained programmers who are using Javascript we need to add a &quot;class&quot; keyword so they don&#039;t feel so weird about prototyping? I&#039;m one of those programmers. I got over it, so can they.

The ECMAScript 5 spec addressed A LOT of the issues I have personally with prototyping. I cannot wait until its adopted across the board.

I think creations like Coffeescript (and dare I even say Dart) have put the web app development world in a frenzy over shimming every classical OOP pattern into Javascript (or in the case of Dart, dropping JS altogether). I think this post highlights a critical fork in the road.]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t get why adding classes to the spec is even up for discussion. Call me a JS purist, but I came from a classical background, OOP to the core. Switching to the prototypical paradigm was like putting mayonnaise on my peanut butter &amp; jelly. It tasted bad; I hated taking bites and I just wanted nothing to do with it.</p>
<p>I realized, maybe if I have to deal with mayonnaise, why not just try making an equally tasty sandwich with the new ingredient?</p>
<p>&#8220;Don’t add classes and the world at large thinks of JS as a joke and a toy&#8221; &#8212; so because we have a &#8220;new generation&#8221; of classically-trained programmers who are using Javascript we need to add a &#8220;class&#8221; keyword so they don&#8217;t feel so weird about prototyping? I&#8217;m one of those programmers. I got over it, so can they.</p>
<p>The ECMAScript 5 spec addressed A LOT of the issues I have personally with prototyping. I cannot wait until its adopted across the board.</p>
<p>I think creations like Coffeescript (and dare I even say Dart) have put the web app development world in a frenzy over shimming every classical OOP pattern into Javascript (or in the case of Dart, dropping JS altogether). I think this post highlights a critical fork in the road.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239807</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Wed, 25 Apr 2012 22:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239807</guid>
		<description><![CDATA[Marco:

On browser population, trust me; I feel your pain. It&#039;s the reason I&#039;ve spent years of my life trying to provide us all with a workaround in the form of Chrome Frame. I get that none of this stuff really matters until we can fix the decay rate of Old IE, and I&#039;m still working to make that better. But we can&#039;t just do nothing while we wait for the cavalry to arrive, else we&#039;ll be empty handed when it *does* get better and have nothing to show for our hard-won victory.]]></description>
		<content:encoded><![CDATA[<p>Marco:</p>
<p>On browser population, trust me; I feel your pain. It&#8217;s the reason I&#8217;ve spent years of my life trying to provide us all with a workaround in the form of Chrome Frame. I get that none of this stuff really matters until we can fix the decay rate of Old IE, and I&#8217;m still working to make that better. But we can&#8217;t just do nothing while we wait for the cavalry to arrive, else we&#8217;ll be empty handed when it *does* get better and have nothing to show for our hard-won victory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Rogers</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239797</link>
		<dc:creator>Marco Rogers</dc:creator>
		<pubDate>Tue, 24 Apr 2012 18:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239797</guid>
		<description><![CDATA[Alex:

I don&#039;t doubt what you&#039;re saying. I just doubt that adding a &quot;recommended&quot; version of classes is going to solve it. These various class libs all do things differently because that&#039;s how their authors want to solve the problem. And through conflict and fear of backwards incompatibility, we&#039;ve ensured that class syntax can be ignored, extended or co-opted for the same nefarious purposes. I think there will be some adoption of the class syntax and some reduction of ad-hoc solutions. But as long as it doesn&#039;t do what some people expect, javascript is still flexible enough for people to do their own thing.

All that being said. This may still be good enough. More important than anything is making it possible for devs to adopt the new syntax sooner rather than later. That story is getting better for browser apis, but not so much for js upgrades. New js syntax is still just not feasible for the wide majority of browser devs. This may seem like a lame argument, but it has consequences in trying to gain support for this stuff. What it means is that the support you might otherwise get isn&#039;t there because most practical devs just don&#039;t care. Because they know it won&#039;t make a difference for them for a while yet.]]></description>
		<content:encoded><![CDATA[<p>Alex:</p>
<p>I don&#8217;t doubt what you&#8217;re saying. I just doubt that adding a &#8220;recommended&#8221; version of classes is going to solve it. These various class libs all do things differently because that&#8217;s how their authors want to solve the problem. And through conflict and fear of backwards incompatibility, we&#8217;ve ensured that class syntax can be ignored, extended or co-opted for the same nefarious purposes. I think there will be some adoption of the class syntax and some reduction of ad-hoc solutions. But as long as it doesn&#8217;t do what some people expect, javascript is still flexible enough for people to do their own thing.</p>
<p>All that being said. This may still be good enough. More important than anything is making it possible for devs to adopt the new syntax sooner rather than later. That story is getting better for browser apis, but not so much for js upgrades. New js syntax is still just not feasible for the wide majority of browser devs. This may seem like a lame argument, but it has consequences in trying to gain support for this stuff. What it means is that the support you might otherwise get isn&#8217;t there because most practical devs just don&#8217;t care. Because they know it won&#8217;t make a difference for them for a while yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie Hubbard</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239796</link>
		<dc:creator>Charlie Hubbard</dc:creator>
		<pubDate>Tue, 24 Apr 2012 18:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239796</guid>
		<description><![CDATA[After reading the proposal I still think this might not be enough to really make a difference.  The biggest pain in the butt part of OO in javascript is loosing the this pointer when using function references.  So we have to proxy the methods every time we want to hand out a reference and maintain the this pointer.  I think without fixing that adding classes won&#039;t have as much impact to improved productivity because the competition, coffeescript and Dart, offers this already.  If you look at the feature list on coffeescript its disheartening the state of javascript.  This is happening one way or another the debate is will it be in javascript or other languages that transpile to javascript.  If TC39 kicks the can down the road for another 5 years they&#039;ll have to contend with the rising languages that will be working from a stronger position.]]></description>
		<content:encoded><![CDATA[<p>After reading the proposal I still think this might not be enough to really make a difference.  The biggest pain in the butt part of OO in javascript is loosing the this pointer when using function references.  So we have to proxy the methods every time we want to hand out a reference and maintain the this pointer.  I think without fixing that adding classes won&#8217;t have as much impact to improved productivity because the competition, coffeescript and Dart, offers this already.  If you look at the feature list on coffeescript its disheartening the state of javascript.  This is happening one way or another the debate is will it be in javascript or other languages that transpile to javascript.  If TC39 kicks the can down the road for another 5 years they&#8217;ll have to contend with the rising languages that will be working from a stronger position.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shannon</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239794</link>
		<dc:creator>Shannon</dc:creator>
		<pubDate>Tue, 24 Apr 2012 15:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239794</guid>
		<description><![CDATA[Alex, yes it does! Thanks for your patience!]]></description>
		<content:encoded><![CDATA[<p>Alex, yes it does! Thanks for your patience!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eugene Lazutkin</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239790</link>
		<dc:creator>Eugene Lazutkin</dc:creator>
		<pubDate>Tue, 24 Apr 2012 13:14:47 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239790</guid>
		<description><![CDATA[I like the proposal, but one thing strikes me as strange --- explicit super calls in constructors. While it is flexible, it is extremely error prone, refactor-unfriendly, and violates an object invariant potentially. Realistically how many cases, when you want to skip super&#039;s constructors vs. cases when you don&#039;t? Obviously if it is the best we can have, it is better than nothing]]></description>
		<content:encoded><![CDATA[<p>I like the proposal, but one thing strikes me as strange &#8212; explicit super calls in constructors. While it is flexible, it is extremely error prone, refactor-unfriendly, and violates an object invariant potentially. Realistically how many cases, when you want to skip super&#8217;s constructors vs. cases when you don&#8217;t? Obviously if it is the best we can have, it is better than nothing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239789</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Tue, 24 Apr 2012 09:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239789</guid>
		<description><![CDATA[Shannon:

Your example still doesn&#039;t work. The &lt;code&gt;Color&lt;/code&gt; function object (aka &quot;class&quot;) delegates to something &lt;em&gt;other&lt;/em&gt; than &lt;code&gt;Color.prototype&lt;/code&gt;. In this case, that something is &lt;code&gt;Function.prototype&lt;/code&gt;. That means that you can&#039;t de-reference &lt;code&gt;Color.WHITE&lt;/code&gt; unless you add it to the function object directly (as you did above) as a &quot;static&quot;. That&#039;s allowed.

What adding things to &lt;code&gt;Color.prototype.*&lt;/code&gt; does is make them available as things you can de-reference on &lt;em&gt;instances&lt;/em&gt; of &lt;code&gt;Color&lt;/code&gt;. Here&#039;s a quick example showing what works:

&lt;pre lang=&quot;javascript&quot;&gt;
class Color { constructor() { ... } }
// Class-level data (aka, &quot;statics&quot;)
Color.WHITE = 0xffffff;
Color.blend = function(c1, c2, alpha) { ... };

// Prototypal method
Color.prototype.blend = function(other, alpha) {
  return Color.blend(this, other, alpha);
};

// Now, usage:
let c1 = new Color(...);
let c2 = new Color(...);
let b1 = Color.blend(c1, Color.WHITE, 0.5);
let b2 = c2.blendWith(c1, 0.5);
&lt;/pre&gt;

Does that clear it up?]]></description>
		<content:encoded><![CDATA[<p>Shannon:</p>
<p>Your example still doesn&#8217;t work. The <code>Color</code> function object (aka &#8220;class&#8221;) delegates to something <em>other</em> than <code>Color.prototype</code>. In this case, that something is <code>Function.prototype</code>. That means that you can&#8217;t de-reference <code>Color.WHITE</code> unless you add it to the function object directly (as you did above) as a &#8220;static&#8221;. That&#8217;s allowed.</p>
<p>What adding things to <code>Color.prototype.*</code> does is make them available as things you can de-reference on <em>instances</em> of <code>Color</code>. Here&#8217;s a quick example showing what works:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #FF0000;">class</span> Color <span style="color: #009900;">&#123;</span> constructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// Class-level data (aka, &quot;statics&quot;)</span>
Color.<span style="color: #660066;">WHITE</span> <span style="color: #339933;">=</span> 0xffffff<span style="color: #339933;">;</span>
Color.<span style="color: #660066;">blend</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>c1<span style="color: #339933;">,</span> c2<span style="color: #339933;">,</span> alpha<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Prototypal method</span>
Color.<span style="color: #000066; font-weight: bold;">prototype</span>.<span style="color: #660066;">blend</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>other<span style="color: #339933;">,</span> alpha<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> Color.<span style="color: #660066;">blend</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> other<span style="color: #339933;">,</span> alpha<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Now, usage:</span>
let c1 <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> Color<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
let c2 <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> Color<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
let b1 <span style="color: #339933;">=</span> Color.<span style="color: #660066;">blend</span><span style="color: #009900;">&#40;</span>c1<span style="color: #339933;">,</span> Color.<span style="color: #660066;">WHITE</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
let b2 <span style="color: #339933;">=</span> c2.<span style="color: #660066;">blendWith</span><span style="color: #009900;">&#40;</span>c1<span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Does that clear it up?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239788</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Tue, 24 Apr 2012 09:21:07 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239788</guid>
		<description><![CDATA[Hey Marco:

I&#039;d be on-side with you if we didn&#039;t have *enormous* piles of evidence to suggest that people are already staring down the complexity you&#039;re accusing us of adding, but doing it in an ad-hoc, non-interoperable way. Nearly every JS library includes some form of class system (yes, even jQuery via jQuery UI). If we weren&#039;t simply codifying something you demonstrably need, I think your critique would be more relevant; but as it stands, we&#039;re overdue for this. The complexity exists, people are already struggling with it, and there&#039;s an opportunity for the language to do something reasonable to help settle the various style/pattern/library wars around classes.

I have some sympathy for the idea that we should use a name other than &quot;class&quot;, but doing that would prevent us from introducing them in non-module or opt-in environments and would make whatever the alternative keyword is contextual. That&#039;s going to force developers to know that they can only use these newfangled object factories in some contexts but not others, adding mental overhead.]]></description>
		<content:encoded><![CDATA[<p>Hey Marco:</p>
<p>I&#8217;d be on-side with you if we didn&#8217;t have *enormous* piles of evidence to suggest that people are already staring down the complexity you&#8217;re accusing us of adding, but doing it in an ad-hoc, non-interoperable way. Nearly every JS library includes some form of class system (yes, even jQuery via jQuery UI). If we weren&#8217;t simply codifying something you demonstrably need, I think your critique would be more relevant; but as it stands, we&#8217;re overdue for this. The complexity exists, people are already struggling with it, and there&#8217;s an opportunity for the language to do something reasonable to help settle the various style/pattern/library wars around classes.</p>
<p>I have some sympathy for the idea that we should use a name other than &#8220;class&#8221;, but doing that would prevent us from introducing them in non-module or opt-in environments and would make whatever the alternative keyword is contextual. That&#8217;s going to force developers to know that they can only use these newfangled object factories in some contexts but not others, adding mental overhead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Wright</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239785</link>
		<dc:creator>Nathan Wright</dc:creator>
		<pubDate>Tue, 24 Apr 2012 06:58:38 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239785</guid>
		<description><![CDATA[I think that Python is an excellent example of prototypal object orientation, and it works great. Much like in Javascript, everything in Python is a dict, including classes and their instances. Occasionally newbies will get tripped up when mutating an object in the class dict when they meant for the change to be local to an instance, but aside from that classes are very easy to use. It&#039;s a familiar pattern that&#039;s good at expressing certain ideas — and that&#039;s all it needs to be.

With javascript, any new framework you look at will have its own way of defining something like a class. They&#039;re trivially different and they haven&#039;t really evolved at all in the past few years. This makes them ripe for standardization IMO.

My only concern is that the underlying prototype still be exposed to those who know what they&#039;re doing. Also, classes should be mutable by default, just like everything in JS, but I guess if people want to &quot;freeze&quot; objects that should be easy enough too. Overall, the maximally minimal classes proposal seems to capture all the right behaviour pretty cleanly. +1]]></description>
		<content:encoded><![CDATA[<p>I think that Python is an excellent example of prototypal object orientation, and it works great. Much like in Javascript, everything in Python is a dict, including classes and their instances. Occasionally newbies will get tripped up when mutating an object in the class dict when they meant for the change to be local to an instance, but aside from that classes are very easy to use. It&#8217;s a familiar pattern that&#8217;s good at expressing certain ideas — and that&#8217;s all it needs to be.</p>
<p>With javascript, any new framework you look at will have its own way of defining something like a class. They&#8217;re trivially different and they haven&#8217;t really evolved at all in the past few years. This makes them ripe for standardization IMO.</p>
<p>My only concern is that the underlying prototype still be exposed to those who know what they&#8217;re doing. Also, classes should be mutable by default, just like everything in JS, but I guess if people want to &#8220;freeze&#8221; objects that should be easy enough too. Overall, the maximally minimal classes proposal seems to capture all the right behaviour pretty cleanly. +1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shannon</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239783</link>
		<dc:creator>Shannon</dc:creator>
		<pubDate>Tue, 24 Apr 2012 05:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239783</guid>
		<description><![CDATA[Whoops! Duh. Sorry about the missing .prototype. That was a typo.

A not-crazy example might be what amounts to an enum.

class Color { ... }
Color.prototype.WHITE = 0xffffff;
Color.prototype.RED = 0xff0000;
Colo.blend(Color.WHITE, 0xff00ff, .5);

I&#039;ve also used class variables for caches and the ilk as well.

I&#039;m perfectly happy declaring them in foo.prototype.blah form (as opposed to within the class block). I was confused because your comment seemed to indicate that one wasn&#039;t able to have prototype level data.]]></description>
		<content:encoded><![CDATA[<p>Whoops! Duh. Sorry about the missing .prototype. That was a typo.</p>
<p>A not-crazy example might be what amounts to an enum.</p>
<p>class Color { &#8230; }<br />
Color.prototype.WHITE = 0xffffff;<br />
Color.prototype.RED = 0xff0000;<br />
Colo.blend(Color.WHITE, 0xff00ff, .5);</p>
<p>I&#8217;ve also used class variables for caches and the ilk as well.</p>
<p>I&#8217;m perfectly happy declaring them in foo.prototype.blah form (as opposed to within the class block). I was confused because your comment seemed to indicate that one wasn&#8217;t able to have prototype level data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin Doughtie</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239782</link>
		<dc:creator>Gavin Doughtie</dc:creator>
		<pubDate>Tue, 24 Apr 2012 04:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239782</guid>
		<description><![CDATA[Constantine -- classes and data hiding are orthogonal (see Smalltalk, etc.).

Everybody -- even having a *bleh* syntax for classic OO classes, even if it&#039;s just sugar, is a win in that we don&#039;t have to ship a convenience function down the wire, and classes from multiple sources can interoperate. Think of it as &quot;querySelectorAll&quot; for object designs.]]></description>
		<content:encoded><![CDATA[<p>Constantine &#8212; classes and data hiding are orthogonal (see Smalltalk, etc.).</p>
<p>Everybody &#8212; even having a *bleh* syntax for classic OO classes, even if it&#8217;s just sugar, is a win in that we don&#8217;t have to ship a convenience function down the wire, and classes from multiple sources can interoperate. Think of it as &#8220;querySelectorAll&#8221; for object designs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Rogers</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239781</link>
		<dc:creator>Marco Rogers</dc:creator>
		<pubDate>Tue, 24 Apr 2012 03:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239781</guid>
		<description><![CDATA[Sorry, here&#039;s the link to my fat arrow post. It&#039;s actually less about fat arrow and more about what criteria we are using to evaluate proposals. https://gist.github.com/2364818]]></description>
		<content:encoded><![CDATA[<p>Sorry, here&#8217;s the link to my fat arrow post. It&#8217;s actually less about fat arrow and more about what criteria we are using to evaluate proposals. <a href="https://gist.github.com/2364818" rel="nofollow">https://gist.github.com/2364818</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Rogers</title>
		<link>http://infrequently.org/2012/04/class-warfare/comment-page-1/#comment-239780</link>
		<dc:creator>Marco Rogers</dc:creator>
		<pubDate>Tue, 24 Apr 2012 03:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://infrequently.org/?p=1845#comment-239780</guid>
		<description><![CDATA[Alex, I appreciate your thoughts here. The new Maximally Minimal Classes proposal does strike me as being &quot;just sugar&quot;. I&#039;m still not sure I agree with all of your points, but maybe we can have that conversation next time we meet in person.

But I would like to throw this into the discussion. What I&#039;ve been arguing lately about es.next proposals is that they may be adding wins to the language, but they are also adding complexity and confusion. See my post about fat arrow and the ensuing discussion (would love to have your thoughts there as well).

The problem with something like classes is that while it follows all the basic rules of js, it presents them in a new syntax that creates dissonance. So a class has to desugar to a function with prototype methods. So the constructor inside it is a different construct? Does the prototype live on the class or on the constructor? If I get an instance from this class, can people mess with that instance or can I count on it always being what it&#039;s supposed to be? I know the answer to these questions, but I argue that they are not obvious to someone learning the language. They are not obvious to someone coming from another language with a stricter definition of how classes behave. That&#039;s why I can sympathize with the argument from your colleague.

The question is, if we don&#039;t expect people to be able to build a working mental model of these constructs and reason about them sufficiently, then what is their purpose? If we introduce a class that falls all over the traditional prototypal usage and also falls all over the OO mindset that some are almost certainly going to come into this with, where is the win? How is it not just another point of confusion.

My example of this is the concept of dynamic this. It&#039;s close enough to OO to seem familiar, and then it has this wildly different behavior that people are still tripping over decades later. I don&#039;t know what the pitfalls will be of these class proposals. But I calling them classes at all is just asking for trouble. I don&#039;t have another name that might help to disambiguate. At least &quot;module&quot; is sufficiently generalized and doesn&#039;t come with baggage.

Not sure if I&#039;ve been clear here, but those are my thoughts. In the end I agree that we need consensus more than perfection.]]></description>
		<content:encoded><![CDATA[<p>Alex, I appreciate your thoughts here. The new Maximally Minimal Classes proposal does strike me as being &#8220;just sugar&#8221;. I&#8217;m still not sure I agree with all of your points, but maybe we can have that conversation next time we meet in person.</p>
<p>But I would like to throw this into the discussion. What I&#8217;ve been arguing lately about es.next proposals is that they may be adding wins to the language, but they are also adding complexity and confusion. See my post about fat arrow and the ensuing discussion (would love to have your thoughts there as well).</p>
<p>The problem with something like classes is that while it follows all the basic rules of js, it presents them in a new syntax that creates dissonance. So a class has to desugar to a function with prototype methods. So the constructor inside it is a different construct? Does the prototype live on the class or on the constructor? If I get an instance from this class, can people mess with that instance or can I count on it always being what it&#8217;s supposed to be? I know the answer to these questions, but I argue that they are not obvious to someone learning the language. They are not obvious to someone coming from another language with a stricter definition of how classes behave. That&#8217;s why I can sympathize with the argument from your colleague.</p>
<p>The question is, if we don&#8217;t expect people to be able to build a working mental model of these constructs and reason about them sufficiently, then what is their purpose? If we introduce a class that falls all over the traditional prototypal usage and also falls all over the OO mindset that some are almost certainly going to come into this with, where is the win? How is it not just another point of confusion.</p>
<p>My example of this is the concept of dynamic this. It&#8217;s close enough to OO to seem familiar, and then it has this wildly different behavior that people are still tripping over decades later. I don&#8217;t know what the pitfalls will be of these class proposals. But I calling them classes at all is just asking for trouble. I don&#8217;t have another name that might help to disambiguate. At least &#8220;module&#8221; is sufficiently generalized and doesn&#8217;t come with baggage.</p>
<p>Not sure if I&#8217;ve been clear here, but those are my thoughts. In the end I agree that we need consensus more than perfection.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
