logo       

Re: Re: [Dojo-escalate] bug in dojo.lang declare: msg#00006

web.dojo.devel

Subject: Re: Re: [Dojo-escalate] bug in dojo.lang declare

Sounds like a 0.5 feature type of thing..

I think I'd like to stay out of this one for now :) , but I'd still agree that if you ~are~ going to emulate another language feature then it should really go "all the way" or it starts leaking ..oh hell...nevermind...

On 10/1/06, Owen Williams <owen@xxxxxxxxxxxxx> wrote:

[Sorry for the cross-post -- I didn't see the request to put it on contrib until after sending]

On Oct 1, 2006, at 10:46 AM, Jesse Kuhnert wrote:
You could also just use the prototype reference directly.

Besides being much faster than anything we can do dynamically, it has the added benefit of being easily understood by anyone who is familiar with "built in" _javascript_ language features.



As opposed the other 90% of the world who works in object oriented systems other than _javascript_, who would expect the behavior of "inherit" to automatically chain, as Eugene did.  (And I did when first using the system).

Telling people "learn the dojo inheritance chain and call superclasses directly by name" seems a poor method of encapsulation to me. And one innocuous-seeming refactor could break a lot of user code.

It also makes the system a lot harder to learn since, to be effective, you have to learn about super"classes" that you may never care about.   How many of the folks on the dojo-interest list understand that widgets are built upon successive layers of abstraction (eg: Widget, DomWidget, HtmlWidget FooWidget) and what those layers are?  Do we really want them to?

If MyFooWidget calls directly to HtmlWidget (because I look and see that HtmlWidget and DomWidget don't implement a myFoo() function), but then the implementor of HtmlWidget decides to implement myFoo, "MyFooWidget" won't see that change.   Yuck.

I definitely do not want to turn dojo/JS into a slavish copy of Java/C++/etc, but I think there are conventions and language features in other languages that are worth emulating.  Inheritance seems a no-brainer in this regard.  If we need to go back and optimize, say, the gfx for speed, let's do that *after* it is working and we can profile it.

Owen



_______________________________________________
dojo-contributors mailing list
dojo-contributors@xxxxxxxxxxxxxxx
http://dojotoolkit.org/mailman/listinfo/dojo-contributors





--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com _______________________________________________
dojo-contributors mailing list
dojo-contributors@xxxxxxxxxxxxxxx
http://dojotoolkit.org/mailman/listinfo/dojo-contributors
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise