Posted over 1 year ago
tlnt.co/p/1T5

You don't have to use jQuery for everything. Especially not for small stuff... Here's a list of pure js equivalents if you need them.

You might also like

Ninja UI - Create beautiful web UI objects within jQuery
A generic jQuery message panel « Are we there yet?
50 jQuery Function Demos for Aspiring Web Developers

Comments

Screen_shot_2011-02-23_at_8.41.39_am_thumb
Iļja Ketris

This is what we read:

Why have:

$.extend(true, {}, objA, objB);

When we can just have this:

var deepExtend = function(out) {
  out = out || {};

  for (var i = 1; i < arguments.length; i++) {
    var obj = arguments[i];

    if (!obj)
      continue;

    for (var key in obj) {
      if (obj.hasOwnProperty(key)) {
        if (typeof obj[key] === 'object')
          deepExtend(out[key], obj[key]);
        else
          out[key] = obj[key];
      }
    }
  }

  return out;
};

deepExtend({}, objA, objB);

Why do we need jQuery? I would not stop here. Why do we need libraries at all? We can code everything ourselves, can't we? I had an impression that we need them exactly for that — to reduce lot of repetitive code into one line? I must have lived in darkness.

over 1 year ago   Like_icon 1 likes  
15b2f7b_thumb
Abelardo Gonzalez

My impression was that, if you are loading jQuery only for

$(el).hide();

Then maybe you should use

el.style.display = 'none';

Instead.

over 1 year ago   Like_icon 0 likes  
15b2f7b_thumb
Abelardo Gonzalez

Some of the examples, I would ignore and use jQuery for anyway, like extend and deep extend. Or for Ajax. It doesn't hurt to know what the originals are anyway.

over 1 year ago   Like_icon 0 likes  
10256594_10152616530373739_9058832982546939564_o_thumb
Melanie Archer

jQuery fan here. My fingers love typing .ajax() and .next() instead of the lengthier JS versions (though I guess CoffeeScript would be a good compromise). Nevertheless, I love the project's emphasis on provoking us to think, Really, does this application truly, really require jQuery?!.

over 1 year ago   Like_icon 2 likes  

Talentopoly Newsletter

A once-weekly round-up of the best programming and design posts.

Join 2050+ subscribers

We will never spam or share your email address. Easily unsubscribe

Liked_post_header
No one realizes how awesome this post is yet.