I would argue that #4 isn't a speed advantage and in some cases harmful.
I think some of the suggestions on selectors are valid and have been
violated by mootools code in the wild. ( helpful tips)
The suggestions about Dom insertion are also good. Again, general good
practice that applies to all Dom js. Again I've seen mootools code
violate this principle.
One practice "encouraged" by mootools that I don't always agree with
is the use of .each(). Calling a function for each iteration isn't the
greatest thing especially when fast tight loops are needed.
The article also points out the use of window.addEvent('load') instead
of window.addEvent('domready'). As a community I don't think we point
out the differences enough. We too have a tendency of overselling
'domready'.
Event Delegation is a really good thing. It's sad that mootools
doesn't have this in the core. I'm guilty of not utilizing this
awesome technique as much as I could. I think the community could
benefit greatly from more awareness in this department.
The points in the article about using references doesn't really apply
to mootools if you follow the 'moo way'. Using classes gives this one
to you for free.
On Oct 25, 2009, at 9:01 PM, Aaron Newton <aa...@iminta.com> wrote:
it's funny, almost all those suggestions can be summed up roughly
as, "...or use mootools, which encourages you to program this way to
begin with."
On Sun, Oct 25, 2009 at 4:14 PM, Dimitar Christoff <christ...@gmail.com
> wrote:
http://www.artzstudio.com/2009/04/jquery-performance-rules/
I think most of it is really obvious and applies to mootools to a
large
degree - perhaps we can do our own best practices for effecient
mootools
code? in doing so we can also focus on particulars of our selectors
system, coding to the pattern and inheritance, extending native
classes
when possible etc etc.
in any case, not a bad read this. for example, I had not considered
the
event bubbling performance implications - see 7. Leverage Event
Delegation (a.k.a. Bubbling)
we could do it on wave or gdocs or something... ?
Regards,
--
Dimitar Christoff <christ...@gmail.com> - http://fragged.org/