News for hackers. Stuff that matters.
Re:Learning from Twitter by axod on Friday January 21, 2011 @05:38AM (#2127040)
jQuery promotes bad practices. People assume $('something') is a cheap variable access, when in fact it could be pretty slowly executing several functions. So they don't bother caching anything.
Re:Learning from Twitter by po on Friday January 21, 2011 @08:28AM (#2127277)
I think by "promote bad practices" you might mean "abstracts complexity away from the developer".

This is true of just about any API. Nobody blames the API when their ORM layer generates a massive SQL query based on complex query input. Understanding the performance characteristics of the 'backend' is assumed.

Re:Learning from Twitter by axod on Friday January 21, 2011 @10:57AM (#2127681)

  $FOO in php is cheap.
  $('FOO') in jquery is expensive.
I don't think using $ to signify "Run some load of jquery code" was a wise choice. Newcomers who don't know what is going on under the hood will regularly write loops with $('FOO') inside them, which is crappy code.

They're doing what they think is best, so I don't blame them. I blame jquery for making it look cheap.

Re:Learning from Twitter by rimantas on Friday January 21, 2011 @11:57AM (#2127906)
Why on Earth you assume that someone starting to use jQuery will come from PHP background, and more over, why should that person think that $FOO in PHP is cheap? I guess anyone thinking in terms of performance cost will be smart enough to understand what $() does in jQuery, especially when advice to cache selectors is on every wall.
Re:Learning from Twitter by axod on Friday January 21, 2011 @01:19PM (#2128244)
idle in #javascript for a while. It comes up all the time.