Apress books

Posted on July 15, 2008 by Tommy McGuire
Labels: notation, books
Has anyone else noticed that many of the books from Apress are really not very good?

I was just reading Beginning JavaScript with DOM Scripting and Ajax (left by the previous resident of my cube), and discovered the following code in a section on "Changing Attributes of Elements" in the DOM:

var firstLink=document.getElementsByTagName('a')[0];
if (firstLink.getAttribute('href') =='search.html')
{
firstLink.setAttribute('href') = 'http://www.google.com';
}

This code immediately follows a paragraph saying,

The DOM specifications provide two methods to read and set attributes---getAttribute() and setAttribute(). The getAttribute() method takes one parameter---the attribute name; setAttribute() takes two parameters---the attribute name and the new value.


On the one hand, the code has clearly been formatted by a non-programmer, someone who has no particular experience with reading or writing code. (Of course, the paragraph doesn't sound like it was written by someone with no particular experience reading or writing.) On the other hand, it's just wrong. Not only does it not match the text, it is just wrong.

Similar problems plagued the Apress O'Caml book, which had simply atrocious code examples and was very poorly written.

I have heard many good reviews of the Apress Common Lisp book (and have a copy on my to-read shelf along with a couple of other Apress books which I have not noticed being so bad). But after these examples, I am dubious.

[Edit: added the missing "not".]
active directory applied formal logic ashurbanipal authentication books c c++ comics conference continuations coq data structure digital humanities Dijkstra eclipse virgo electronics emacs goodreads haskell http java job Knuth ldap link linux lisp math naming nimrod notation OpenAM osgi parsing pony programming language protocols python quote R random REST ruby rust SAML scala scheme shell software development system administration theory tip toy problems unix vmware yeti
Member of The Internet Defense League
Site proudly generated by Hakyll.