Enough with the JavaScript Already by Nicholas Zakas




Slides can be found here — http://www.slideshare.net/nzakas/enough-withthejavascriptalready

After consulting with several companies on performance related issues, it became clear that one of the biggest performance issues facing websites today is the sheer amount of JavaScript needed to power the page. The demand for more interactive and responsive applications has driven JavaScript usage through the roof. It’s quite common for large sites to end up with over 1 MB of JavaScript code on their page even after minification. But do today’s web applications really need that much JavaScript?

Through an examination of several large websites, this talk shows just how little of a page’s JavaScript is actually used by the time the page is loaded or immediately afterwards. You will also learn about JavaScript library design and how some flawed patterns add to not only more JavaScript code, but also more memory used to run it. In some cases, it might actually be worth your time to write the JavaScript component yourself rather than using an off-the-shelf one.

http://tech.blog.box.com/

Note: Our apologies for the darkness of the video.

Original source


23 responses to “Enough with the JavaScript Already by Nicholas Zakas”

  1. This talk is seriously fucked up. Were trying to recreate the server and browser in JS cos the state of web is a joke. We need to see the end of all page reloads. The web should be fluid and seamless not some clunky php shit.

  2. bytes is a less important metric than number of http requests. Even Ember apps, which are huge, make far fewer http requests and provide a much faster experience over time. Paying an extra 200k download cost once is a small price to pay for a full fledge, blazing fast, application.

  3. I think part of the problem is that JavaScript has a LOT of people using it that really aren't programmers. Hence all these bloated libraries floating around. Personally, I've always preferred writing my own library for my own purposes. And if jQuery, or some other library, has a functionality that I need, then I will analyse how they did it and adapt that code for my own use. One example is the DOM Ready event. Why I should use the entire jQuery library, JUST to make use of this one functionality, was stupid so, I wrote my own based on a similar approach used by the jQuery gurus. Anyway, what I've subsequently learnt is that in a lot of cases, you don't even need to worry about the DOM Ready event if you simply placed your scripts right before the end body tag. So yeah, if you really sit back and analyse what you REALLY need to get your website going, you will usually find that you don't really need that much at all. Some people keep on banging on about all these "wonderful" libraries as if they were a Second Religion. Personally, I think that is simply lazy and wasteful! If you need it then sure, go ahead and use it but, if you don't then you don't, so why use it?

  4. Nicholas is one guy that KNOWS a GREAT LOT about JS and web application, and still is able to respond "I truly don't know" to a question. That's is why I admire his work a lot: knowledge combined with a good dose of humility…. The JS community lacks of that, and the content of the talk proves that: We've been trying to solve all things using javascript just to prove ourselves.

    So my humble recommendation to our community: get a shrink and your page load time will shrink.

Leave a Reply