prototype focus

Brendan Eich brendan at mozilla.com
Fri Jul 1 14:59:33 PDT 2011


On Jul 1, 2011, at 2:28 PM, Irakli Gozalishvili wrote:
> On Friday, 2011-07-01 at 19:31 , Brendan Eich wrote:
> 
>> On Jul 1, 2011, at 6:19 AM, Irakli Gozalishvili wrote:
>> 
>>> With focus on prototype this is so much simpler: 
>>> 
>>> var Foo = Object.extend({
>>>    initialize: function(options) { ... },
>>>    do_foo_job: function() { ... }
>>> })
>> 
>> With <| and 'super' in functions, I think you are set. It's hard to add more. The main debate is about whether this is enough, or do classes as sugar provide enough added value?
>> 
>> (But you didn't show Bar as well as Foo.)
>> 
> 
> Sorry I don't understand what did I failed to show in Bar ?

I was replying to your message sent too soon; sorry, I should have looked ahead for your complete followup.


> My intent was to show that classes don't necessary need to have own constructors / initialization methods as they can be
> simply inherited via prototype chain. Or did you meant something else ?  

No, I was looking for your version of Bar as prototype not constructor function.

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110701/a00229e5/attachment.html>


More information about the es-discuss mailing list