Better HN
topnewbestaskshowjobs
Log inSign up

marti221

-5 karma · joined May 6, 2012 (14y ago) · 4 submissions

Submissions

comment 12y ago · link · parent

Couldn't of said it better myself.

comment 12y ago · link · parent

This should be, "Do you know JavaScript inside out?". Native JS is where people should be starting.

comment 13y ago · link · parent

It's not about the actual number of operations the code compiles down to... it's about the number of bytes sent across the wire on initial page load. Among the most important elements of optimizing a webpage is minimizing the initial HTTP latency/download size. The jQuery core team is hyper-aware of all of these performance issues, and are doing everything possible to cut the gzipped/compressed size of their library. When you support a library that is literally run on the majority of the internet, these small improvements make a HUGE difference in the overall bandwidth consumption and load times of web applications.

I agree with you that use of the ternary operator, when not used properly, can obfuscate some code that could be simplified with if/else operators. But, jQuery has chosen to forgo readability for performance (and for good reason IMO).