Re: es-discuss Digest, Vol 97, Issue 31

2015-03-05 Thread Eric Elliott
> >5. Re: How to fix the `class` keyword (Allen Wirfs-Brock) > > One of those possible enhancement that has been talked about is to > implicitly treat a [[Call]] of a class constructor as an implicit 'new', > just like you are suggesting. > Doesn't this need to be configurable, and Brendan Eic

Re: How to fix the `class` keyword (Brendan Eich)

2015-03-05 Thread Eric Elliott
> > > In case it helps, the idea mooted for ES7 is that you'd add a "call > handler" to the class for when it is invoked without `new`: > > class Point2D { > constructor(x, y) { this.x = x, this.y = y; } > [Symbol.call](x, y) { return new this.constructor(x, y); } > ... > } > > I us

How to fix the `class` keyword

2015-03-04 Thread Eric Elliott
I've already posted this on my Medium blog here: https://medium.com/@_ericelliott/how-to-fix-the-es6-class-keyword-2d42bb3f4caf It seems inevitable that the `*class*` keyword in JavaScript is going to catch on, but that’s a problem because it’s fundamentally broken in many ways. Now that it’s out

Re: Array.prototype.contains

2014-03-05 Thread Eric Elliott
.com/ On Wed, Mar 5, 2014 at 2:07 AM, David Bruant wrote: > Le 05/03/2014 09:24, Eric Elliott a écrit : > > What ever happened to Array.prototype.contains? There's an old strawman > for Array.prototype.has ( > http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.

Array.prototype.contains

2014-03-05 Thread Eric Elliott
What ever happened to Array.prototype.contains? There's an old strawman for Array.prototype.has ( http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.has ) that references this thread: ( https://mail.mozilla.org/pipermail/es-discuss/2012-February/020745.html ) But it seems the thread f

Re: Another switch

2014-02-21 Thread Eric Elliott
; >> Also only works when you're switching on something with a meaningful >> conversion to string. >> > > On 20 Feb 2014, at 21:20, Eric Elliott wrote: > > > Object literals are already a great alternative to switch in JS: > > > > var cases = { > &g

Re: Another switch

2014-02-20 Thread Eric Elliott
Object literals are already a great alternative to switch in JS: var cases = { val1: function () {}, val2: function () {} }; cases[val](); Fall through is more trouble than it's worth, IMO. On Feb 17, 2014 1:44 PM, "Giacomo Cau" wrote: > -Messaggio originale- > From: Brendan Eic

Re: Classical inheritance is obsolete

2013-06-30 Thread Eric Elliott
iply inherited pieces. That skeleton doesn’t even have to be a > hierarchy, it could be a set of classes. > Maybe you simply need to write a mixin or trait library that works well > with ES6 classes? > > Axel > > On Jul 1, 2013, at 0:22 , Eric Elliott wrote: > > "Honest

Re: Classical inheritance is obsolete

2013-06-30 Thread Eric Elliott
"Honest question: how can this problem not be solved via ES6 classes plus mixins? The original hierarchy already feels wrong. Why not create a super-class Animal, with sub-classes Human, Ape, Bird, Bee, Fish, Whale plus the mixins Walking, Flying, Swimming?" I completely agree with you, but in the

Re: Classical inheritance is obsolete

2013-06-30 Thread Eric Elliott
hat motivates me to speak out about it. - Eric On Sat, Jun 29, 2013 at 7:07 PM, Axel Rauschmayer wrote: > On Jun 29, 2013, at 20:12 , Eric Elliott wrote: > > If I were advertising, there are better places to do it, and better ways. > I feel like adding class to JS would be detriment

Re: Classical inheritance is obsolete

2013-06-30 Thread Eric Elliott
"JS is a rich language that allows different styles of programming. Nothing wrong with that." What's wrong is that when we give people `class` and `extends`, books and blog posts everywhere will begin to teach that this is how we do inheritance in JavaScript, ignoring all the perils that go with t

Re: Classical inheritance is obsolete

2013-06-30 Thread Eric Elliott
Brendan, You seem to only be replying to the most recent comment in this thread, and not considering the objections that I raised at the beginning of the thread. My argument is that class isn't just a little bit of sugar. I believe that counter to its goal, it will reduce programmer productivity b

Re:

2013-06-29 Thread Eric Elliott
> push it. > > On Jun 29, 2013, at 8:58, "Eric Elliott" wrote: > > Hi Alex, > > Your response is extremely vague. It doesn't seem to say more than "I > think you're wrong. Oh, and lots of other people think you're wrong too." > &g

Re:

2013-06-29 Thread Eric Elliott
ncestor class inheritance... so even if you start out using class inheritance, it can be problematic to switch to mixins and similar strategies down the road. - Eric On Fri, Jun 28, 2013 at 7:41 PM, Claude Pache wrote: > > > Le 29 juin 2013 à 00:14, Eric Elliott a écrit : > >

Re:

2013-06-29 Thread Eric Elliott
2) Have you watched the talk? https://vimeo.com/69255635 3) Are there specific points that you disagree with? - Eric On Sat, Jun 29, 2013 at 7:11 AM, Alex Russell wrote: > > On 28 Jun 2013 19:31, "Eric Elliott" wrote: > > > > I'm not here to discuss the mechanics

Re:

2013-06-28 Thread Eric Elliott
irony. > > The one thing that saved us from dread of *OMG we have to re-visit > everything* has been reliance on unit tests - test-driven-development, or > test-during-development really does reduce the fear of later confusion - > but that's another discussion entirely. > >

Re:

2013-06-28 Thread Eric Elliott
o, the problem is when people limit the way they think about software through this only one paradigm. If this paradigm is here alongside others, I don't see the problem. People have the choice." JavaScript is confusing enough to people without adding `class`. Sometimes giving people more ch

Re:

2013-06-28 Thread Eric Elliott
n't with Backbone's particular implementation. I had the same problems in C++, Java, and with John Resig's Simple Inheritance in JavaScript. The problem isn't with the ES6 implementation. It's the whole paradigm. - Eric On Fri, Jun 28, 2013 at 2:27 PM, David Bru

Re:

2013-06-28 Thread Eric Elliott
om/2013/02/fluent-javascript-three-different-kinds-of-prototypal-oo/ Different author, similar message - http://davidwalsh.name/javascript-objects (3 parts) - Eric Elliott On Fri, Jun 28, 2013 at 11:40 AM, Tab Atkins Jr. wrote: > On Fri, Jun 28, 2013 at 11:31 AM, Eric Elliott wrote: > &g

Re:

2013-06-28 Thread Eric Elliott
t it because you don't have time to watch a video, I guess the conversation is over. =) - Eric On Fri, Jun 28, 2013 at 10:45 AM, Tab Atkins Jr. wrote: > On Fri, Jun 28, 2013 at 10:42 AM, Eric Elliott wrote: > > I know this has been batted around already. I know everybody's totally

[no subject]

2013-06-28 Thread Eric Elliott
I know this has been batted around already. I know everybody's totally stoked about class sugar in ES6. I just wanted to register my protest. I made my arguments in this talk at Fluent: http://ericleads.com/2013/06/classical-inheritance-is-obsolete-how-to-think-in-prototypal-oo/ I'm already seein