News for hackers. Stuff that matters.
Re:jQuery Learning Center by baby on Friday February 22, 2013 @05:42AM (#5263668)
Does it really need it? It feels to me that jQuery is simple enough.
Re:jQuery Learning Center by diggan on Friday February 22, 2013 @05:45AM (#5263677)
Let's not teach anyone else swedish because it's simple for me.
Re:jQuery Learning Center by btipling on Friday February 22, 2013 @07:34AM (#5263924)
The bits on performance are interesting:

http://learn.jquery.com/performance/

Although the bit about variable definitions on one line under performance is absolute rubbish: http://jsperf.com/variable-definition On chrome it's the same, on Firefox their suggestion is slower. Added an issue, https://github.com/jquery/learn.jquery.com/blob/master/page/...

The best way for a software engineer to learn about jQuery in my opinion is to look at the source code though.

Re:jQuery Learning Center by ithcy2 on Friday February 22, 2013 @10:00AM (#5264464)
Yes, the variable definitions page leaves me scratching my head. Not sure what it's doing under performance. Surely that's a matter of your personal coding style and I'm not sure a jQuery tutorial site should be so dogmatic about how you choose to define your variables when there's negligible performance impact either way. Although JSLint loves to complain about the "old & busted" style, grouping variable definitions together with commas goes against the principle that inserting a new line of code anywhere should be "safe". If you paste in a new variable definition statement with a semicolon in the midst of a group of comma-separated lines, you're going to break things.

The bit on "clever conditionals" is rubbish as well. Not only are the "better" ways much slower, they're much harder to read. I opened an issue for this one: https://github.com/jquery/learn.jquery.com/issues/258

Re:jQuery Learning Center by ihsw on Friday February 22, 2013 @09:52AM (#5264411)
Indeed, some of them are basic optimization techniques that experienced jQuery users have 'discovered' over the years (through Google or otherwise) and they are essential to creating high-quality web applications.

Having a central resource is obviously a boon to the entirety of the community and it reduces the barrier to entry, and I personally know some designers (who get by on the bare minimum of jQuery knowledge) that would benefit greatly from this service.

Re:jQuery Learning Center by mattmanser on Friday February 22, 2013 @10:36AM (#5264674)
It seems to be giving advice which is contrary to the very purpose of jQuery. Take:

http://learn.jquery.com/performance/append-outside-loop/

I always do something like this:

    $target
      .append($("li")
        .class("thing")
        .text(someText));
But it's not mentioned at all.

Instead they are using the verbose monstrosities from the DOM API which is exactly what we don't want to use because it sucks.

i.dontWantToHaveVerboseMethodsToAppendSomethingToTheDom(please).

Without the easy DOM manipulation, jQuery's not much more than a nice wrapper to deal with AJAX browser differences. There's some serious cognitive dissonance here.