More about the book

During the @media conference several people asked what the book is about. Although the short answer is obviously "JavaScript!", they wanted a more detailed reply. This entry gives them (and anyone else who's interested) more information.

Book positioning

When I started writing the book I had a pretty good idea where I wanted it to fit into the JavaScript book market. Basically I wanted it to be exactly mid-way between Jeremy Keith's book and David Flanagan's, to sort of bridge the gap between non-programming web designers and hard-core programmers.

Jeremy Keith's DOM Scripting: Web Design with JavaScript and the Document Object Model is aimed at web designers who are fluent in HTML, CSS, and design, but for one reason or another have never made the step to programming JavaScript. Because of this target audience, it explains everything simply and doesn't go into too much technical detail when that's not necessary.

David Flanagan's JavaScript, the Definitive Guide (note: 5th edition now available), on the other hand, is aimed at experienced programmers who come from another language and now have to understand JavaScript. For this reason it is complete: it treats even those aspects of the language that are rarely used in web development.

Both books are exactly what they need to be. Nonetheless, I had the feeling that there is a market for a book that's somewhere in between: a book that explains more of the technical details than Keith's does, but not quite as much as Flanagan's does.

Unfortunately I didn't entirely succeed. Especially during the last round of frantic editing I removed quite a few advanced (hence technically dense) subjects and concentrated on the simpler stuff every JavaScripter needs to know. All in all I abandoned my exact mid-position and moved a few steps away from David Flanagan, towards Jeremy Keith.

Therefore right now the best way to describe my book is as the sequel to Jeremy's. Once you really understand all that he explains, the time has come to immerse yourself in the more advanced features and problems of the language, as well as some nasty browser incompatibilities that can ruin your day (and your hair).

The content

The book page contains the table of contents, and as soon as you gloss over it you'll notice that it differs somewhat from a traditional JavaScript book ToC. The first really technical chapter is chapter 5; the first four treat several non-technical (or less-technical) aspects of JavaScript: its purpose (why use it at all), its context (web standards and accessibility), the browsers and how to herd them, and the preparation phase in which you take fundamental decisions about how your script is going to cooperate with the HTML structural layer.

Only when these theoretical subjects are out of the way, the practical, technical part starts. I divided this part into six chapters, each of which treat one specific subject: Core, BOM, Events, DOM, CSS modification, and data retrieval. This subdivision has been in the making for years and years; when I created my 2001 book proposal (that never came to anything), I was already convinced that many JavaScript books mix up their topics too much. Although I didn't find a solution back then, while writing the 2005 proposal (that has become this book) the simple six-fold subdivision sort of popped into my head.

In fact, ordering your material is one of the most difficult problems of writing a JavaScript book. When you create even the simplest example script, you use Core, Events and DOM at the least; Core because you're writing a program, Events because you wait for the user to do something, and DOM because you need to create some sort of visual feedback.

Does that mean that you should treat these three vastly different topics in the course of one chapter? On the pro side, in order to explain the script well you should explain Core, Events and DOM, because your readers need that knowledge. On the con side, if you keep doing that the book will quickly become a confused jumble of topics and subjects, where Events basics are explained in one chapter, a few more basics in another, and some advanced topics in yet another.

My solution is to strictly separate all these subjects, and to make every chapter treat all the important aspects of its topic. However, to be able to do so I had to do some serious thinking on the example scripts themselves. As I said, even the tiniest example script uses Core, Events, and DOM. How can the reader understand the entire script when the chapter he's reading only explains the Core features, but not Events and DOM?

The short answer is: he can't. However, the level of incomprehension really depends on how you use the example scripts. It was only when I came up with a new idea for using example scripts in a JavaScript book that the strict subdivision by subject began to make sense. I'll explain this idea in a next entry.

This is the blog of Peter-Paul Koch, web developer, consultant, and trainer. You can also follow him on Twitter or Mastodon.
Atom RSS

If you like this blog, why not donate a little bit of money to help me pay my bills?

Categories:

Comments

Comments are closed.

1 Posted by Small Paul on 27 June 2006 | Permalink

Just one question: what's BOM? Browser Object Model?

2 Posted by Scott Dowding on 29 June 2006 | Permalink

I second that question! What's BOM?

3 Posted by aaron on 29 June 2006 | Permalink

ahhhh i was hoping to get the advanced and dense stuff from you, but i'll prob get it anyway. Yes, BOM is browser object model.

4 Posted by Ross Bruniges on 29 June 2006 | Permalink

You mentioned Jeremy and David's books in comparison to yours - how would you that it compares to Stuart Langridges DHTML Utopia book???

5 Posted by ppk on 3 July 2006 | Permalink

BOM is Browser Object Model, or those objects that are not part of JavaScript Core, and not part of the DOM, either.

Chapter 5, especially, is quite dense enough, thank you. Some other chapters feature a bit of lighter stuff.

As to Stuart's book, I'm not sure how to compare it to mine. It's really hard, this comparison stuff.

6 Posted by gusc on 6 July 2006 | Permalink

Man, You rock! I'm pretty well with JavaScript, but sometimes I just can't find some little information that is missing in my head (like data types or regexp pattern syntax) - then I must search through bunch of books and mostly test it on my own. But as it seems to me (from the TOC of your book) It will cover almost every little thing - atleast I hope so. :) I can't wait to see it.

7 Posted by Carlton on 12 July 2006 | Permalink

Hi Peter, just wanted to say I'm looking forward to this book...I have to say the your articles on Javascript have been a great help and I'm sure the book will be just as good...I think the best way to show my support is to buy it :)
Hope it sells well!

8 Posted by Tadeusz Szewczyk on 14 July 2006 | Permalink

So it really sounds like a book that would work for me, as I did JS back in 1999 and haven't for a few years now. What I miss in the TOC are examples where JavaScript could be useful "besides" layer ads and other annoyances nowadays. It seems to explain how but not why or not what for...

9 Posted by Brayn Flexeril on 17 July 2006 | Permalink

Plz tell me where can I find more info about Browser Object Model?

10 Posted by ppk on 18 July 2006 | Permalink

In chapter 6 of my book, obviously.

11 Posted by Alex on 20 July 2006 | Permalink

The main thing I use my current JS bible (Quickstart Guide - http://www.amazon.com/gp/product/0201735172/104-8909427-5091136?v=glance&n=283155) for is JS and CSS object tables. The tables in the back of that are pretty cool- does you book have that kind of thing?

12 Posted by ppk on 20 July 2006 | Permalink

No, all compatibility tables will remain on this site, where they belong. A compatibility table in a book is outdated the moment the book is printed, and I want to continue updating mine.

13 Posted by Frederick C. Lee on 30 July 2006 | Permalink

Do you cover Javascript 1.6?
We have all these versions but I don't know what browsers cover which versions of what.

What's the difference between versions 1.5 and 1.6?

Do you cover XAJAX technologies? I want to know how to process DOMs between PHP and Javascipt. And which browser best supports the W3C standands of these technologies.

I want to buy a JavaScript book but I'll wait for the one that covers 1.6, etc.

... Looking forward to reviewing your book.

14 Posted by ppk on 2 August 2006 | Permalink

The book doesn't cover JS 1.6, just plain old 1.5 . Remember that at the moment 1.6 is supported only by Mozilla.

I don't know what XAJAX is, and in general my book steers clear of the Ajax hype. It doesn't treat PHP either, since it's a JavaScript book.

So the answer is: No, my book doesn't treat all that.