Hacker Newsnew | past | comments | ask | show | jobs | submit | marti221's commentslogin

Couldn't of said it better myself.


It's "couldn't have" or perhaps "couldn't've" but it's certainly not "couldn't of". Interesting error born of an incorrect interpretation of phonetics.


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


Exactly...

As crockford would say "The World's Most Misunderstood Programming Language Has Become the World's Most Popular Programming Language" http://javascript.crockford.com/popular.html


jQuery -- The world's most popular misunderstanding ...


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).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: