💬 A Q&A with… David Flanagan Author of JavaScript: The Definitive Guide David has been programming since 1981 and getting paid for it since 1985. In 2011, he started working at Mozilla. Since then he's worked as a full-stack engineer on MDN and at Khan Academy. He currently works on cloud software at VMware and is in the process of releasing the seventh edition of JavaScript: The Definitive Guide, a hugely popular JavaScript book published by O'Reilly. Why a seventh edition now? I allowed the sixth edition to become badly out of date (sorry!). So the seventh edition is a major, and long-overdue, update. Importantly, it covers ES2020 and even mentions some features expected to be formalized in ES2021. Also new in this edition is a detailed chapter on Node, reflecting the reality that JavaScript isn't just for web browsers anymore. (Ed: David has written more on what's new in the seventh edition here.) What was the story behind writing the first edition? I started on it shortly after I wrote Java in a Nutshell. In those days the buzz around Java was that Java "applets" could add dynamic content to web browsers. JavaScript seemed like a promising alternative and I remember talking to an engineer from Sun Microsystems (the company that created Java) about what I was going to work on next. When I told him I thought JavaScript might become more important in the browser than Java, he scoffed. But seven editions of my book later, I'm starting to think I was right(!) What's your favorite chapter? Most interesting JavaScript code is asynchronous, and now that Promises are a core part of the JavaScript language, I dedicate chapter 13 to asynchronous programming with callbacks, events, Promises and async/await. Promises are a revolutionary addition to JavaScript, but once you move beyond the simplest examples, it becomes very easy to misuse them and you need to understand them deeply in order to use them correctly and with confidence. So I devote more than 20 pages to explaining them in depth. These are some of the most complicated pages in the book, but if they increase the understanding of Promises, I'll feel I've provided an important service to the community. You've spent so much time writing books about JavaScript, but what other technologies interest you? I'm intrigued by both Go and Rust and would enjoy documenting those languages. I've thought about writing short books about React and Angular. And I've wondered whether it is possible to write an interesting book about coding for a non-technical audience. What's the secret to being able to write so many programming books? No secret, really: from about 1991 to 2011 I was self-employed and for most of that time, writing books was my primary job. This 7th edition of JavaScript: The Definitive Guide is the first book I've written while also working a regular software engineering job. You can find David on Twitter @__DavidFlanagan or more about JavaScript: The Definitive Guide at O'Reilly Media. |