Friday, January 2, 2009

Tutorial Errors

One thing I can't stand is when a tutorial (online or in print) features an error. Debugging is certainly a good skill to have as a programmer, but when you're just getting started a tutorial needs to be free of errors.

Page 9/10 in Headfirst Javascript features a neat starter exercise. On page 9, they show a page of code with a few sections circled, and prompt you to write what you think those things are (to prove that JavaScript really isn't all that scary and a lot of it is common sense). For instance...
function validateZIPCode (value) {
// Validate the ZIP code
// if (!isZIPCODE (value))
alert("Please enter a ZIP code in the form XXXXX.")
...means enter a zip code with five digits (page 10 fills me in on this answer.)

I guessed it meant "enter a zip code, and if it is a certain value, validate it." Close, but not quite.

Lower down the page, another section is circled...
onclick="findHouses(this.form);
Except, on page 10 there is no answer for what this means. The wrong section is highlighted, so I still don't know what onclick="findHouses(this.form);" means. I guess I will have to keep reading and learning to find out.

No comments:

Post a Comment