Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just by including jQuery in a project I was able to shave a total of 22kb off a range of files without much trouble. But the current release version, minified jQuery is about 23kb. It's a balancing act.

EDIT: Also, in the next version of jQuery, they plan to separate out the core code such that you can include only what you need, so that 23kb will drop to only what you need.



For me at least, the main benefit by far of fewer lines of code is fewer bugs and maintainability. Code kilobytes rarely matter (though I concede "k" can be relevant on the web).


It was an easy way for me to illustrate how many lines of code I culled. I make it sound amazing, but the majority of changes involved turning 20 line functions with for loops into a simple 2 line jQuery snippet.

Also, jQuery means rarely declaring in-function variables therefore avoiding memory leaks.

Happy coders all round :)




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

Search: