Example scripts and errata

I added some information to the Book section: an example scripts page and an errata page.

The example scripts page lists the example scripts, links to the working version and the JavaScript files, and gives a detailed list of where in the book the scripts are treated.

The errata page, unsurprisingly, contains the few errata I've found so far. I still haven't found a typo, though I did find three plurals that should be singulars, one of which is smack bang on the very first page of the very first chapter. As far as I'm concerned these aren't really typos, typos are just words taht are speled incorrectly.

Even though I went through most of the book now and found no typos, I'm still not convinced the book is actually free of them. No doubt a few will turn up once people start actually reading it.

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




Comments are closed.

1 Posted by Prasand J. on 8 October 2006 | Permalink

PPK, congratulations on the publication. It is definitely well deserved. I'm sure most of the devout readers of your resources will overlook the errata. =)

As I was looking at the excerpts, I was curious. Have you ever thought about writing your for loops with linear pre-incrementations, and semi-static loop-tests?

Congrats again.

2 Posted by ppk on 9 October 2006 | Permalink

Sorry, Prasand, I have no idea what linear pre-incrementations and semi-static loop-tests are, so I've never used them.

3 Posted by Prasand J. on 10 October 2006 | Permalink

pre-incrementation with a linear check:

for (var i=-1,x=item.length;++i<x;){}

the previous method uses three well documented optimization techniques, and has many performance benefits over traditional for loops.

for (var i=item.length;--i>-1;){}

The latter method, uses four techniques, and is faster than the first. Though I personally don't use it, because I don't like going through arrays backwards, nor flipping them.

The logic of a standard for loop works out to 9 steps performed on "i" (it's set, refered, tested, and used - then upon completion of the loop is refered, copied, incremented, refered, then tested). Compounded with that "length" is re-evaluated each time, when it remains the same.

Linear checks with semi-static loop tests, reduces the total 10 operations, to three (in some languages it's four, or five depending on how referencing is handled in the language).

Just wanted to extend that, cause I know you're a stickler for optimization. =P

- Prasand