jQuery Delegate Document vs Element

It was recently brought to my attention that jQuery delegating to the document is faster than an element, the reason being document is already an object that doesn’t have to be transversed.  Needless to say I’m the kind of person that always wants to see this in action, so I made up a quick set of tests on jsPerf.com which test this theory in many variants.

Posted in Web Development | Tagged , , | Leave a comment

IE to Start Automatic Upgrades

By far some of the greatest news Microsoft has given us in a long time, being a Front End Developer by day I have to deal with IE ranging from 6 to 9, thankfully with this update we will hopefully see a decline of IE6 and IE7, and an incline of 8 and 9.  Obviously we won’t see total extinction especially with enterprise/corporate control preventing these updates, but I’d rather one day we hit that low percentage of IE7 so that we can officially stop supporting it (I can dream right?).

Today we are sharing our plan to automatically upgrade Windows customers to the latest version of Internet Explorer available for their PC. This is an important step in helping to move the Web forward. We will start in January for customers in Australia and Brazil who have turned on automatic updating via Windows Update. Similar to our release of IE9 earlier this year, we will take a measured approach, scaling up over time.
-Microsoft
Source:  Windows Steam Blog

UPDATE:  A good point has been raised by a fellow Front End Developer in that IE9 is quickly gaining speed, and now with this auto-update we will see IE9 on Windows 7 rise from 30% to probably 80% or more within mere months.  Feel free to see these stats at Windows Stem Blog posted back in September.

Posted in Web Development | Tagged , , , , , , , | Leave a comment

jQuery bind vs delegate

Just the other day I posted about how much I love using jsPerf to run performance tests for jQuery snippets, so today I’m going to talk about my latest test.  Many a times I’ve read that the jQuery delegate is faster than live, however only recently I realized it was also faster than event binding.  To summarize, jQuery delegate is about the fastest method of binding events to elements, single or multiple.  The reason for this is that binding to a set of elements binds to each element individually, where as binding to the parent element with children delegated binds the event to the parent only.  More info on this can be found on the article “24 ways: Your jQuery now with less Suck” by Scott Kosman.  Feel free to check out my test case on jsPerf and if you’d like to contest or try to prove a faster method I’d love the challenge.

An added benefit of delegate I have discovered is that when you delegate to something with class, and later remove that class, that delegation updates thus removing itself from the object.  For example lets say you have a delegation bound to a button that has a class of disabled to start with, later when you meet the requirements to enable that button and remove the disabled class that button no longer has the disabled delegation assigned to it, thus it undelegated itself without any extra code effort.  Check out this test case on jsFiddle. This has proven to be a very helpful technique, and surely adds to the reasons to use delegate over bind.

Posted in Web Development | Tagged , , | Leave a comment

JavaScript performance testing using jsPerf

When developing smaller websites JavaScript performance is often neglected, however when dealing with enterprise level websites such as Lowe’s Home Improvement you start to take these things seriously.  Since before I started at Lowe’s I’ve been trying to improve myself when it comes to JavaScript and jQuery, especially in the area of performance.  Thankfully a very helpful tool exists, known as jsPerf.  The great thing about this tool is that you can setup tests for JavaScript snippets whether its proprietary or library based such as jQuery.  I often find myself comparing different jQuery techniques to prove the more optimal, such as the longer hand jQuery dom ready is in fact faster than the shorthand, and bind events are faster than individual event declarations.  I haven’t yet tested how the new jQuery 1.7 on/off events perform, but I do hope that by moving all those events into one simple method will not heart the performance aspect.

jsPerf aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks.

Posted in Web Development | Tagged , , , | Comments Off

Google+ Hangouts and Productivity…

Not long after getting into Google+‘s closed field testing I started toying with Google+ Hangout, at first it seemed like just a cool way to hang out online; however as of the last week or so I have realized it can be used for productivity.  For instance Scott Carroll and myself have been using Google+ Hangouts combined with Google chat and jSFiddle to actually build jQuery plugins (jTator, jQualize, jCentr so far), and I have to say its very helpful to see and talk to the person your working with in realtime (for remote work).

Feel free to check out my Google+ Profile, where I be post about jQuery and other web development/design topics.

Posted in Social Media, Web Development | Tagged , , , , | 2 Comments

Google+ joins the Social Network war

With the upcoming release of Google’s new social network known as Google+, top dogs Facebook and Twitter have a lot to worry about.  Google brings video conferencing for up to 10 people via what they call “Hangouts“, mass text/instant messaging on phones via Huddle, targeted posts via Circles, and many more creative features.  Surprisingly Google plans to integrate some of the core features into Google Apps, allowing for companies, school and other organizations to build their own internal social network, something Facebook nor Twitter offer.

Along with new features Google is re-branding Blogger to Google Blogs and Picasa to Google Photos.  Google has also chosen to redesign their entire catalog, including but not limited to Search, Gmail, Calendar, Maps, Images, and possibly soon Docs.  Part of the reason for a redesign is to develop a look that can seamlessly work on many platforms from Desktop to smart phones and TV’s.  As a front-end web developer I am happy to see Google using HTML5 and CSS3, while dropping support for outdated browsers like Internet Explorer 6 and 7.

From what I’ve read some well known SEO sites have been getting high amounts of traffic from Google+, surprising since Google+ is still closed field testing and not open to the public as of yet.  Currently what Google+ does lack, though hopefully not for long would be an equivalent to Facebook Pages, which would intern drive the business to consumer side of social networking.  Google also has a change to support ads in a non intrusive and yet functional way that can still bring plenty of profits and business.  There is also some evidence that Google is working on a social gaming aspect for their network, and even a question/answer system.

A good sign that Facebook is threatened would be the removal of email address’s from their API, thus shutting down the Google Chrome plugin that allowed users to import their friends list into Google+ from Facebook.  Along with that days after Google+’s initial announcement Facebook has declared that they have a big and exciting announcement coming today.

From a survey done 2/3rd’s of current Google+ users would happily move from Facebook permanently.  Overall my experience thus far with Google+ has been nothing but enjoyment, I for one can hope to one day ditch Facebook in favor of Google+.  I would like to see YouTube and Google Music integrated, as currently the videos tab just uses Picasa based videos.  Check out Google+’s page which has videos showcasing the above mentioned features and more.  Be on the look out for the official public opening, rumored to be July 31st, less than a month away!

Posted in Social Media | Tagged , , , , , , , , | Leave a comment