> With prototype-based inheritance they all point to > the same copy. It's a big win for memory usage. Read this interview > with Dean Edwards: http://snook.ca/archives/writing/an_interview_wi/
I see your point. But this is not exactly what happens here. We do indeed save memory by putting the methods into the Hashes constructor. I completely missed that and it is indeed an advantage. But Dean Ewards is promoting true javascript inheritance, which means not copying Enumerables methods into our constructor, but putting Enumerable into our prototype chain. This saves even more memory (no copying of any methods to extended classes, leave alone instances) and leaves Enumerable "open", which means we can still override Enumerables methods and add new ones, even on instantiated objects. Now that seems to be on the list of things to do as most people here probably know. See here http://encytemedia.com/blog/articles/2006/05/23/prototype-inheritance- madness and here: http://sam.conio.net/articles/better-inheritance-for-prototype But for now it is probably safe to state that the new inheritance scheme for Enumerable solves some problems (memory footprint) while creating others (backwards compatibility, "openness"), at least for some people. Probably the tradeoff is a positive one for most people, sadly not including me at this time :-(. How is the state of affairs in introducing Dean Edwards Base inheritance to prototype? There are some tickets on inheritance, but one especially for that? Cheers, Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---
