Review: “Beyond jQuery” by Ray Nicholus

Fascinating book. In it, he shows the benefits of direct JS calls, rather than going through a library (specifically jQuery.) While much of his focus is on speed from direct coding instead of working through the library, I found another benefit – code size.

I’m currently working on code with an embedded server in VB.net, rather than using a MS server and ASP.net. The advantage is that the code is portable and license-free – no Microsoft server to pay for. The disadvantage is that everything has to be coded directly – file uploading and downloading for example, and especially file aging/checking. At about 85k, the jQuery library is not small – on typical browsers the first 85k file load is the only one, since the cache is hit from then on. But on a single-page app, that 85k is not trivial, and on a custom server, bypassing jQuery means the extra code for handling caching checks is code I don’t have to write immediately.

The book has other goodies in it. He goes through typical jQuery uses, and then shows how direct JS calls handle it the same, or often much better (by the by, I say JavaScript, but mean ECMAScript, for those purists reading).

Most significantly, the book shows the code to use depending on what browser support you need. When jQuery first came out in 2006, it was a glue that bound a variety of browsers with a variety of non-standard ways of doing things (I’m looking at you, Internet Explorer) As a result, jQuery made calls work crossplatform, and reduced the workload of programmers everywhere.

But over a decade later, the glue isn’t as necessary. Throughout the book, just about everything worked as long as you stayed with Internet Explorer 11 or later – and since that’s been out since 2013, and now replaced by Edge, we are finally getting mainstream scripting consistency.

And ultimately, it’s fun to code bare to the metal. Working your way through the DOM should be a rite of passage, like coding in assembler language, or writing a Windows dialog directly via API calls.

Would I stay away from jQuery all the time? No – for most projects, 85k one-time isn’t too bad. Especially for the jQuery UI effects like slides and closes, it’s worth working with. But it is frustrating to load a large package for a few DOM searches and calls. Of course, if you think jQuery is big, look at Angular, which can weigh in at close to 1/2 meg!

So if you want to see how far we’ve come in browser coding, give it a read – it’s well worth it!

4 thoughts on “Review: “Beyond jQuery” by Ray Nicholus

  1. David Pankhurst, thanks a lot for the article post. Much thanks again. Fantastic.

  2. I’m always pleased to hear about a developer who found value in my work. Glad you enjoyed the book, David. Happy coding!