{"id":1953,"date":"2013-10-02T16:33:25","date_gmt":"2013-10-02T16:33:25","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=1953"},"modified":"2013-10-02T16:33:25","modified_gmt":"2013-10-02T16:33:25","slug":"book-review-secrets-of-the-javascript-ninja","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/book-review-secrets-of-the-javascript-ninja\/","title":{"rendered":"Book Review: Secrets of the Javascript Ninja"},"content":{"rendered":"<p>&#8220;<a href=\"http:\/\/www.amazon.com\/gp\/product\/193398869X\/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=193398869X&amp;linkCode=as2&amp;tag=thesecrelifeo-20\">Secrets of the Javascript Ninja<\/a>,&#8221; is a relatively new Javascript book (2013), written by developers with deep browser programming experience, John Resig and Bear Bibeault, It covers lessons learned over many years maintaining Javascript libraries. A lot of the practical guidance is valuable, even if you\u2019re an experienced developer &#8211; it includes a lot of notes about common problems developers encounter in browser APIs, many items which are otherwise difficult to learn without hard experience. If you\u2019re primary interest is server-side Javascript, the relevant examples are likely too basic, unless you\u2019re unfamiliar with things like closures.<\/p>\n<p>This is a very practically minded book, with lots of code samples. The book is divided into categories referred to as \u201cTraining,\u201d \u201cApprentice,\u201d \u201cNinja,\u201d and \u201cMaster, \u201d roughly splitting sections by the complexity and sophistication of material presented. While I find the \u201cNinja\u201d metaphor goofy, it is not overly pervasive in the book except as a literary prop (note the cover image is a Samurai). The progression of difficulty is consistent with what you might expect from people who work on a library like jQuery: \u201cMaster,\u201d for instance, involves patching a browser to handle events and CSS selectors correctly, rather than managing codebases of tens or hundreds of thousands of lines of Javascript code.<\/p>\n<p>For someone who has written a lot of Javascript code, there will be chapters you can skip or skim. I\u2019ve seen some of the material before &#8211; having read library documentation, I\u2019ve read numerous discussions of OOP in Javascript, but I found the chapter on Timers invaluable. The authors are big proponents of regular expressions, which I\u2019ve found to be atypical in most code I\u2019ve seen, and thus presents an interesting perspective.<\/p>\n<p>Since the book is relatively new, the authors structure certain chapters around how one might patch useful new constructs into legacy browsers (e.g. event handling improvements), which provides a window into how they think about design, what new features are coming, and how the new features actually work. This isn\u2019t about design patterns per se though, it is about specific APIs that have cause a lot of pain in the past (or currently), and are being improved.<\/p>\n<p>If you\u2019re not currently steeped in browser coding issues, or are only causually, &#8220;<a href=\"http:\/\/www.amazon.com\/gp\/product\/193398869X\/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=193398869X&amp;linkCode=as2&amp;tag=thesecrelifeo-20\">Secrets of the Javascript Ninja<\/a>&#8221; could easily save you the cost in time through understanding common nuances of brower APIs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Secreates of the Javascript Ninja is a great book on real-world Javascript development.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[90,302,313],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1953"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=1953"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1953\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=1953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=1953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=1953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}