Review: JavaScript Patterns

In my (seemingly) never-ending quest to improve my JavaScript skills, I recently received a copy of JavaScript Patterns by Stoyan Stefanov. While I feel very comfortable with jQuery and simple Ajax applications, I feel like I’m still missing… something in terms of constructing JavaScript heavy applications, especially those used within Adobe AIR applications. A few months back I reviewed Object-Oriented JavaScript which was also by Stefanov. JavaScript Patterns is an excellent followup and I’d definitely recommend it.

The book begins by discussing some JavaScript basics - just to ensure you have a proper understanding of what is - and what is not - supported in terms of object, inheritance, classes, etc. Issues surrounding variables and the global object are also discussed. Probably the most interesting aspect of the first portion to the book was the discussion on JSLint, a JavaScript code quality tool. Shoot - I didn’t even know code quality tools existed for JavaScript before reading this book.

The middle section of the book was a bit difficult for me. Stefanov spends a lot of time talking functions and defining them. He also spends an incredible amount of time discussing object creation patterns. I had a very hard time with this. I get that there isn’t “One Right Way” to solve a problem. I preach that all the time in the ColdFusion community. But I found a lot of this discussion to be hard to relate to. It’s not that he doesn’t provide examples. He does - quite a few. But I had a hard time relating them to practical uses in my own development. I decided to not stress out too much over it and return to the chapter later on. I had the same trouble with the section on inheritance. I just don’t see myself needing inheritance yet in my development.

The final two chapters though were really exciting. Chapter 7 is on “Design Patterns.” I feel like I’ve just recently gotten a hang on them in general - both in the ColdFusion and ActionScript world. Seeing them discussed in JavaScript and “getting it” was a great feeling. Chapter 8, “DOM and Browser Patterns”, was also great. Some of the material I already knew but Stefanov covered them in a fresh way that helped really bring home the concepts.

I’d definitely recommend picking the book up (and as a reminder, if you click via the pretty picture above I get a kickback) as well as the previous one I reviewed. Both together would be a great way to lift your JavaScript development up to a new level. While I still think I’ve got a lot to learn, I’m feeling more comfortable in terms of approaching larger, more complex JavaScript based applications now.

p.s. One final note - and it’s soapbox time so feel free to stop reading. I’m no Microsoft hater. Heck, I’ve dumped Apple and switched over to Windows 7. But it is truly a sad thing that every JavaScript book has to spend time talking about how IE has failed in some regard or another. I mean think of it - you have a browser that basically fracked over development as we know it. Ok, maybe that’s a bit dramatic, but it seems like someone at Microsoft should be ashamed of themselves. I hear IE9 is “better” (meh, I’m a Chrome guy now), but it’s like Microsoft has ‘stained’ the history of the browser and that’s pretty sad.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate looking for his next gig. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA https://www.raymondcamden.com

Comments