Look Ma, no "this" (was: ECMAScript Harmony)
petermichaux at gmail.com
Sat Aug 30 15:33:31 PDT 2008
On Mon, Aug 25, 2008 at 7:15 PM, Brendan Eich <brendan at mozilla.org> wrote:
> No, prototypes are here to stay. There's even Object.create to
> relieve prototypers from having to write constructor functions.
> The desire to explore ZI is two-fold:
> 1. It may help the committee to see the smallest possible proposal,
> and work up from there to SI and MI.
> 2. It may help the language to avoid adding another kind of
> inheritance than prototype-based delegation.
In a famous email, which many here have probably read, Alan Kay wrote
about leaving inheritance out of "object-oriented programming".
- I didn't like the way Simula I or Simula 67 did inheritance
(though I thought Nygaard and Dahl were just tremendous thinkers and
designers). So I decided to leave out inheritance as a built-in
feature until I understood it better.
This conservative approach seems apt for the situation of classes and
inheritance in ECMAScript. If classes are to be merely sugar for other
language features (purely ES3.1 features?), we don't know exactly what
those other parts are and have no experience seeing what is possible
with those, then we certainly don't understand how inheritance fits
into either the desugared or sugar pictures. It could be that the
boilerplate that inheritance tries to solve is not a big problem as I
tried to show in the observer pattern example. It seems reasonable to
follow Alan's conservative approach before jumping into the deep water
of inheritance which has a variable track records.
More information about the Es-discuss