Re: [JSMentors] Speed of jQuery selectors - testing on http://jsperf.com

2011-01-20 Thread Kai Mallea
On Fri, Jan 21, 2011 at 12:37 AM, Bill Heaton wrote: > Can someone using Internet Explorer 9 (beta) run this test ? I ran it for you 3x in IE9b. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non

[JSMentors] Re: Speed of jQuery selectors - testing on http://jsperf.com

2011-01-20 Thread Bill Heaton
Correction: http://jsperf.com/jquery-selector-with-context-as-object/5 > Oops, I forgot the link that I am requesting you to click the 'Run > tests' button at : Sorry everyone for the multiple posts I think I need to get some sleep. Thanks in advance for clicking the 'run tests' on the http://j

[JSMentors] Re: Speed of jQuery selectors - testing on http://jsperf.com

2011-01-20 Thread Bill Heaton
On Jan 20, 9:56 pm, Bill Heaton wrote: > I just added one more test case to be fair comparing the cached object > when selecting; so cached object used for context and also previous > to .find() ... Oops, I forgot the link that I am requesting you to click the 'Run tests' button at : http://jspe

[JSMentors] Re: Speed of jQuery selectors - testing on http://jsperf.com

2011-01-20 Thread Bill Heaton
I just added one more test case to be fair comparing the cached object when selecting; so cached object used for context and also previous to .find() ... // method I prefer to use var area1 = document.getElementById('mypage'); $('.stuff', area1) $('.morestuff', area1) // method faster in firefox

[JSMentors] Speed of jQuery selectors - testing on http://jsperf.com

2011-01-20 Thread Bill Heaton
I am testing the speed of jQuery selection with a cached DOM object as the 'context' for the selection. // method I prefer to use var area1 = document.getElementById('mypage'); $('.stuff', area1) $('.morestuff', area1) // method faster in firefox $('#mypage').find('.stuff') $('#mypage').find('.mo

Re: [JSMentors] Re: JS API Design - Accepting Parameters

2011-01-20 Thread Ariya Hidayat
One of the best advice I got was "Code is written once but read many times". This particularly holds for public API and thus I often compromise more on the readability side rather than code size or verbosity. Beside Garrett's example, my favorite classic of the so-called "Boolean trap" is: fo

[JSMentors] Re: Feedback on namespace pattern implementation

2011-01-20 Thread jmulligan
You create infinite loops by touching the Function.prototype object, you should never do that. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.

Re: [JSMentors] Feedback on namespace pattern implementation

2011-01-20 Thread אריה גלזר
Looking at your implementation, I find it weird that a you modify the Function prototype (the same functionality could be done w/o it obviously) Now - don't get me wrong - I'm a mootools user, so modifying the prototype is something I'm quite used to, but still - it seems like a bad habit for a cro

Re: [JSMentors] Re: JS API Design - Accepting Parameters

2011-01-20 Thread Peter van der Zee
On Thu, Jan 20, 2011 at 11:34 AM, Gregor wrote: > But this shifts the programmers task to "remember the property names". > /** * @param {Boolean} a * @param {String} b * @param {Object} options * - x:int=0 * - y:int=0 * - title:string="" * - onClick:function=null * - onClose:function=nul