with Imagination: by Dustin Diaz

./with Imagination

A JavaScript, CSS, XHTML web log focusing on usability and accessibility by Dustin Diaz

Episode 13: JavaScript Libraries Overview

Monday, May 29th, 2006

Last epsidode I spoke with Yahoo!’s Matt Sweeny, primary responsible for two YUI utilities, however in this episode I spoke just a bit on some of the benefits of other libraries and how they can be useful for you. In particular I picked apart some of the entries from the jQuery Event Selector showdown and speaked a bit on the shortcomings and benefits of each. Nonetheless, the driving factor for any library is that it is beneficial for you and that you can get things done with it. Since I obviously hold close ties to YUI I wanted to make it clear of what it does and doesn’t do.

Other than YUI (which I barely even talked about), I touched a bit on Sam’s Prototype, John’s jQuery, and Justin’s Event Selectors. Others I mentioned but didn’t go into detail (mainly because I don’t know them as well) was MochiKit and Alex’s Dojo Toolkit.

In the News

Actually, I really didn’t have much except for Jack Born’s latest jump into doing his side project at 15 Days of jQuery.

Download this Episode

This podcast is 40 minutes.
Download Episode 13: WSwI Podcast: JavaScript Library Overview

21 Responses to “Episode 13: JavaScript Libraries Overview”

  1. John Resig

    Good show Dustin! I’ll have to take you up on that beer the next time I’m in Silicon Valley.

    I think the ‘competition’ between the different Javascript libraries is interesting because everyone has different desires - as you stated in your show. Some people care about small file size, some people see that as being unimportant, some people care about namespace issues, some people don’t. I imagine that a giant grid of all the features by all the libraries would be helpful to developers. Although, first, it would probably be good to take a survey to figure out exactly what it is that people want. If this interests you, we could probably work something up together.

    Oh, and let me know if you’re looking for someone else to interview, I’d be happy to talk about jQuery and other Javascript libraries.

    Keep up the good work!

  2. Jack

    Dustin,
    Thank you very much for your mention of “15 Days of jQuery”. As always, I enjoyed the show.

  3. Antonio

    Not a bad show, I just finished hearing it. As (I think) you said every person looks for different things when looking for a javascript framework (or utilities toolbox).

    Actually these days I’m kinda looking everywhere and weighting the good and bad (for me) of all these “views” of the problem, so the subject of your show was perfect for me at this particular moment.

    About the show, maybe it’s me, or my English, or the fact that I hear it on the way to work, but when you read code, you lose me. A first approximation to the giant grid John mentioned above would have been more useful.

    I agree with you in the (little) importance of filesize, but I was surprised you didn’t mention the jQuery aspect most appealing to me: CSS3 selectors. How cool is to be able to target ‘#tabs>div:lt(5)’ ? :)

    Still undecided, though…

  4. Dustin Diaz

    @John, You’re on. I’ve got the 12 in the fridge ;). I agree that this whole “competition” thing is rather weird, especially coming from the library developers themselves. It’s interesting to see us all nitpick around, and in the end, none of us are really questioning what the developer (Consumer) of these libraries want. In the end I’m not really sure if there ‘is’ going to be an ultimate lib, and maybe it’s better off that way.

    I for one wouldn’t want you to change your jQuery just because of the ‘$’ namespace and it’s “shorthandness” of it all. It most definitely appeals to some people out there and you have a good thing going on for you.

    Interview et ‘al, I can send you some details on how to get setup for a VOIP interview.

    @Jack, No problems linking you for the 15 days event. Just keep up your end ;) Let’s see some cool stuff :)

    @Antonio, I agree that really, there is no way to “speak code” over a podcast. I only mention a few of the code snippets to give a general idea, but I never actually expect someone to follow it. However it is a podcast of which you can download, rewind, and play again… but then again I doubt people want to spend that amount of time.

    I have a question for you on the other hand. Since you mentioned you listen to it on the way to work, how was the sound quality for you on this one? Better than the last ones? How’d you like that beatbox in the end? :p

  5. shfx

    Hi Dustin! Nice episode.. I like when you talk about DOM, DHTML, AJAX and all JS stuff.

    ps. Did you say “Weed Beer” ? =]

  6. Dustin Diaz

    shfx: Wheat Beer. As opposed to most traditional beers that use Rice.

  7. shfx

    oh… Cheers!

  8. Elliot Swan

    Good episode. I agree that it’s a little hard to follow when you “talk code,” but I don’t know how else one would do it.

    I’d never thought of the YUI library like that, where it just gives you a few tools rather than trying to do things for you. Interesting approach, though I still wish they didn’t go so heavy on the namespacing stuff. One or two seems good enough to me.

  9. Dustin Diaz

    Elliot, The namespacing imo is yet another weak argument that I think folks also need to let go of. Let me know when you find of a real bug ;). I do really think it’s for the benefit of the entire library and all the namespaces are completely inline with the tasks you’re getting done on each. Especially when most of the times when you’re going to use it, you’ll be using them in a private scope such as :

    DED.myApp = function() {
      // Do this once, and once only.
      var YUD = YAHOO.util.Dom;
      var YUE = YAHOO.util.Event;
      var YUA = YAHOO.util.Anim;
      return {
        init : function() {
          var c = YUD.get('content');
          var YUE.on(c, 'click', this.swap);
          // etc. etc.
        }
      }
    }();

    So really, the namespaces really aren’t that bad. When you’re working with the DOM, you know exactly what to refer to (YUD). When you’re working with events, you point to YUE.

    Again, that also goes inline with just what I was saying. It allow you as a developer to put in just the right amount of verbosity as you want. For instance, if you want less verbosity, and you’re a dollar lover. Simply do this:

    DED.myApp = function() {
      var $D = YAHOO.util.Dom;
      var $E = YAHOO.util.Event;
      var $A = YAHOO.util.Anim;
      // take it a step further
      var $ = $D.get;
      return {
        init : function() {
          var c = $(['content', 'foo', bar']);
          var $E.on(c, 'click', this.swap);
          // etc. etc.
        }
      }
    }();

    So thus I am still all for the namespaces :). Try it on for at least a week, then lemme know if you get tired of it. Deal?

  10. Dustin Diaz

    FYI everyone, I’ve allowed the <pre><code> </code></pre> combo in the comments. No more crappy code postings :). Just make sure you escape your entities.

  11. Justin Perkins

    > As opposed to most traditional beers that use Rice.

    By traditional beer, you mean cheap ass american beer right? Rice in beer is about as traditional as drinking your beer with ice cubes.

    Wheat Beer in Wikipedia

  12. Dustin Diaz

    @Justin: lol! Leave it to a true beer connoisseur :)

  13. Justin Perkins

    > Leave it to a true beer connoisseur

    Why thank you, I consider that quite a compliement :)

    Btw, I love me some rice beer (sometimes). Nothing beats a tallboy Lone Star or Pabst on those hot Texas days, then again Wheat beer is good for that too.

  14. Elliot Swan

    I guess you’ve got me cornered there…

  15. Dustin Diaz

    sall good. Just try it for a week then lemme know if it becomes a hassle. However if Prototype is working out great for you, then by all means, keep using what you know best if it helps you get the job done :)

  16. gib

    You mention referencing javascript files “correctly” with gzip to help with file size? What’s that all about? Can you post a reference?

    Thanks for the show and intro to YUI!

  17. Dustin Diaz

    Hey Gib, I mentioned that in the beginning of this article. Hopefully that helps :)

  18. kentaromiura

    Could I go a bit Off-Topics?

    Dustin, I wrote a mini-framework for an application
    that i’m developing, and I would release it,
    I embedded some of your function(and the Y! event also) if ,for you, there is no problem I would write the documentation(with credits to your works) and I would publish it, you can take a look of my work here:

    http://rey9999.altervista.org/kenta/framework_0.1.zip

  19. Matthijs Abeelen

    Really liked this show Dustin. Positive point was, in my opinion, the somewhat easier pace. Some nice not too loud music and well paced talking without too many burpy sidesteps makes a difference.

    In general one of the problems I have with pod casts is that it’s not possible to skim through them. So it’s either listen to the full hour or not. Of course you can fast forward with the player, but then you completely loose track of the story. On a webpage, at least a well designed one, it’s easy to quickly skim through the content and pick out the interesting bits and focus on those. With a podcast, that’s not possible. Or at least not easy. So that’s one thing I would like to mention. A joke now and then is fine. But a little focus and structure in the story also adds a lot of value, at least for me.

    So keep up the great work!

  20. Weibing

    
     // Do this once, and once only.
      var YUD = YAHOO.util.Dom;
      var YUE = YAHOO.util.Event;
      var YUA = YAHOO.util.Anim;
    

    good,I like this

  21. Ali

    can javascript get find number of line of a div tag? maybe something in libraries to handdle the gui matters in a page.

Leave a Reply

Phone Number:

If you're about to post code in your comment, please wrap your code with the tag-combo <pre><code>. Also please escape your html entities - otherwise they will be stripped out. I recommend using postable.

Get "JavaScript Design Patterns"

"As a web developer, you'll already know that JavaScript™ is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked--JavaScript is capable of full object-oriented capabilities, and by applying OOP principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team."

Buy JS Design Patterns from Amazon.com Buy JS Design Patterns from Apress

Flickr

Submit a Prototype

All content copyright © 2003 - 2007 under the Creative Commons License. Wanna know something? Just ask.

About | Archives | Blog Search

[x] close

Loading...

Submit a prototype

By checking this prototype I agree that I am not submitting false credentials, pornography, or a hate crime website. I also understand that by submitting my entry I may or may not be accepted, and if accepted, my entry may be taken down at any given time if I violate these terms.