February 20, 2007
Interview with Nicholas C. Zakas
Nicholas C. Zakas, author of Professional JavaScript for Web Developers and Professional Ajax, works at Yahoo! in Sunnyvale CA as a frontend engineer has been involved in web development since way back in 1996. Nicholas was nice enough to give me some of his time to answer some questions concerning JavaScript, Ajax, and web development in general.
JW: You have been involved in web development for a number of years
now, but what got you started originally?
Nicholas C. Zakas: I first got interested in web development watching CNet on television. At the end of the show they gave a web site address for more information, so I hopped onto AOL to look for it. Since AOL had no web browser at the time, I was stumped as to how to get that content. I crossed paths with someone on a message board that said he could teach me how to make my own site. The instructions he sent overwhelmed me initially, as I had never heard of HTML. So I went out and bought a book on HTML (at the time it was on version 3.2) and setup my first web site in 1996 to keep in touch with friends. Even though my college had no Internet courses, I kept learning on my own, updating my site as I learned new techniques and eventually got a job working on the college's web site.
JW: What were your first experiences using JavaScript? What difficulties did you first encounter?
Nicholas C. Zakas: My first experiences in JavaScript were simply outputting different things to the page using document.write(). Silly things like saying "Good morning" if it was before noon or "Good evening" if it was after 5 pm. I quickly got ramped up at my first job, developing for Netscape Navigator 4.0 and Internet Explorer 4.0. Only then did I start to understand what a complex language JavaScript truly was. My initial difficulties all centered around cross-browser issues. As CSS and the DOM were in their infancy, trying to make solutions that worked in both browsers was extremely challenging.
JW: For someone trying to get more acquainted with JavaScript (past the beginner level) what would be a good route to go in learning how it is really used on the web?
Nicholas C. Zakas: My advice to anyone who wants to learn JavaScript is quite simple: read every book you can find. You can learn a lot online, but oftentimes you won't get the full story. There are some highly intelligent, extremely talented engineers writing JavaScript and blogging about it, but in my opinion, most of these posts are slanted towards that particular person's preferences, tendencies, and use cases. Books (good ones, anyways) tend to supply arguments on both sides of an issue. I'm not just saying this because I'm a JavaScript book author, either; I'm saying this because it's how I learned and I've seen people led astray by a passing comment on someone's blog. Books first, blogs second, then back to books to cross-reference.
JW: You have another Ajax book coming out (Professional Ajax, 2nd Edition). What are your thoughts on the future of Ajax and is there too much hype now?
Nicholas C. Zakas: Last year I predicted that the excitement over Ajax would minimize in 2007, eventually being swallowed up as another web development technique, and I think we're already starting to see that. There was way too much hype over Ajax last year, everyone wanted Ajax this or Ajax that...I think Mark Twain said it best: "To a man with a hammer, everything looks like a nail." What we came to learn was that Ajax was not a golden bullet, it didn't solve all of our problems with web development. I think we've now come to the point where people understand that Ajax is really about creating an enjoyable, rich experience for users. Initially the focus was on the technology (XHR specifically), but it's now come back around to where it should be: usability.
All that being said, Ajax isn't going away. What I think has changed is the view of Ajax's impact on a product outside of usability gains. We're starting to see a slowdown of people saying, "this has to have Ajax", and I think that's definitely a good thing. In the future, the focus will be more on the user experience and what can possibly be done to improve it; Ajax will be one tool in the engineer's toolbox.
JW: There has been so much talk about the pros and cons of JavaScript libraries recently, how do you know if you should use one or not? Do you personally use them?
Nicholas C. Zakas: I've gone on record several times speaking about my disdain for JavaScript libraries. Personally, I find most libraries to be bloated, poorly-documented, poorly-maintained and designed without practical usage in mind. Many force you to change your programming style to adapt to the library, which I also don't like.
When should you use one? When you don't have the time or inclination to understand JavaScript at a deeper level. In many environments where Rapid Application Development is the norm, JavaScript libraries allow much faster development than writing code by hand. They also enable developers to come up to speed faster, without worrying about cross-platform issues (which are presumably abstracted away with the library). The real problem is that once you use a library, you can become dependent on it. What happens when you need something that the library doesn't include? Do you know enough to make it happen, or do you write it off as not possible?
The only library I've ever used, and would ever recommend, is the YUI library. I've been a big fan of YUI since before I joined Yahoo!, and now, working with it almost on a daily basis, I remain convinced that it's the best option for those looking to use a JavaScript library. Besides being written in an "a la carte" manner (I wish more libraries were), it also has the backing of one of the most trusted names on the Internet and is staffed full-time with an incredibly talented groups of engineers.
JW: I heard a quote from Douglas Crockford recently saying that JavaScript is probably the most popular programming language in all the platforms it is deployed. Do you think its popularity will continue?
Nicholas C. Zakas: Now that people understand the power of JavaScript, I do believe that its popularity will continue into the foreseeable future. It is a truly unique language that seems to have infinite possibilities, which is why I believe it has been picked up for so many other uses (Flash's ActionScript, Websphere's ECMAScript for XML, JScript.NET, etc.). This isn't to say that JavaScript doesn't have any roadblocks, because it does. The folks at ECMA are hard at work trying to define the next generation of JavaScript, which really pushes the language further and gives it more powerful features, but unless we can get agreement by all browser vendors to implement the new JavaScript, we could be caught in a crossfire between browsers with different feature sets similar to when the Web was in its infancy (think of the additions to HTML that both Netscape and Microsoft made). The real key to the evolution of JavaScript isn't really what Firefox starts implementing, but what Internet Explorer starts implementing. I know there's a lot of anti-Microsoft sentiment when it comes to the Web (and other technologies), but the fact of the matter is that they still have most of the browser market and until a technology can be used on Internet Explorer, it is really just a toy for geeks rather than a useful tool for practical development.
JW: What developers really excite/inspire you?
Nicholas C. Zakas: I've been very inspired by Douglas Crockford's work. He's the first person I came across who publicly said, "hey, JavaScript isn't a toy language, it's really powerful." While I can't say I always agree with his conclusions, he has done more than anyone else I can think of to really promote JavaScript and its usage in enterprise situations.
I've also recently been inspired by Hedger Wang. I've had the pleasure of working with Hedger at Yahoo!, and he never met a problem that he thought was unsolvable. The sort of stuff that he comes up with on a regular basis is just incredible. His blog is a treasure trove of brilliant techniques using HTML, CSS, and JavaScript.
I was also very inspired by the work of Erik Arvidsson and Emil Eklund at their site, WebFX. They were doing all of this DHTML and JavaScript hacking long before it became popular. I learned a lot from their work and was pleased to get to meet Erik on my first trip out to California. Those two guys, both now working for Google, are two unheralded but very important frontend engineers in the era of increased JavaScript use.
JW: Is it just me or have web standards suddenly become another hot topic? Are people (developers and web community) finally realizing it is important?
Nicholas C. Zakas: I think standards are coming back around as an important part of web development, and I think many people have taken important steps to make this happen. The emergence of WHAT-WG and the new HTML working group over at the W3C are examples of the increasing realization that the push for XHTML and other "next step" standards were out of touch with the reality of the market.
It is heartening to see people excited about standards and working hard to use them, but also tempering that with a realistic sense of balance with functional and user requirements. I've argued before that tables shouldn't be overlooked for difficult layouts
JW: It seems that everybody is working for Yahoo! nowadays. Are they grabbing up all the best people for some sort of world takeover?
Nicholas C. Zakas: I think it's an arms race of sorts with Yahoo!, Google, and Microsoft. All the best web developers in the world seem to be getting invites from all three, which I think points to the fact that these companies all realize that the next great frontier is the Web, and they all want to be staffed to appropriately take advantage of it. There are incredibly talented web engineers working at all three companies and I think that this bodes well for the future of the Web as a whole. Competition breeds innovation, and with three major players (plus countless other smaller companies) all in the game, I expect to see some really incredible strides within the next 5-10 years.
JW: Thank you so much for your time.
Nicholas C. Zakas: Not a problem. ![]()
