[dojo-contributors] Should connect take string id's for nodes?

Tom Trenka ttrenka at gmail.com
Tue Jun 5 15:21:56 EDT 2007


Personally, I consider this kind of thing to lead to lots of "magic" in a
system, and think it's better to maintain some version of both simplicity
and expectation in terms of typing than to add the minor
convenience...meaning I agree with Adam here--I think we'd be better off
without it.
trt

On 6/5/07, Scott J. Miles <sjmiles at turboajax.com> wrote:
>
> IMO, the only reason to remove this kind of convenience is performance.
>
> For code that is time-critical, I advocate strongly against anything
> like this. For example, I was hardcore about requiring availability of
> low-overhead functions in html.js because they tend to be used in UI
> scenarios where responsiveness is critical.
>
> I'm not talking about being sloppy here, the actual performance impact
> is mostly the overhead of the function calls (by overhead, I mean the
> cost of calling *any* function).
>
> Again, merely IMO, I think connect in particular is better with the
> value-added.
>
> Regards,
> Scott J. Miles
> TurboAjax Group
> http://www.turboajax.com
>
> Adam L. Peller wrote:
> > Though it may be worth making an exception for some common calls, I'd
> > be concerned about consistency (and simplicity) of our APIs.  It seems
> > like there are several that accept both Node and String in the html
> > package... in Dijit I think we tried to remove this pattern.
> >
> > -Adam
> >
> > On 6/5/07, Scott J. Miles <sjmiles at turboajax.com> wrote:
> >> Hi,
> >>
> >> I am considering altering dojo.connect so that you can pass a string
> >> (id) for a node as the first argument.
> >>
> >> The cost would essentially be a call to dojo.isString() for every
> >> connect (and a call to dojo.byId() for every connect to a node).
> >>
> >> I imagine this seems like an incredibly minor thing, but I try to
> >> consider every cycle used in _base code.
> >>
> >> Regards,
> >> Scott J. Miles
> >> TurboAjax Group
> >> http://www.turboajax.com
> >> _______________________________________________
> >> dojo-contributors mailing list
> >> dojo-contributors at dojotoolkit.org
> >> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> >>
> > _______________________________________________
> > dojo-contributors mailing list
> > dojo-contributors at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20070605/b55970af/attachment.htm 


More information about the dojo-contributors mailing list