Have you ever heard of O'Reilly's popular Hacks-Series? In those books they cover detailed stuff about special areas and they are very specific about those topics.
That was the reason to order PHP Hacks (by Jack D. Herrington) - a complete failure.
But continue reading!
Contents
Purely from the contents the book looks amazing - it covers some basics, focuses on Web Design and DHTML, talks about Graphics and Databases and even about Design Patterns and Testing. Perfect, isn't it?
So I started reading, skipped the first Chapter about the installation and continued with...
Chapter Two: Web Design
Within this chapter PHP must not be used at all - the chapters just describe the HTML/CSS basics, and they do it in a wrong way. For example on page 17 the printed option-tag is invalid xhtml, because it must be 'selected="selected"' and not just "selected".
And the examples are dangerous, because the author does not take care of XSS bugs --> the $_GET["style"] is just printed back to the screen without any validation or without even mentioning that there might be an XSS bug.
Again, to explain how to display simple boxes with HTML/CSS or how to format tabs - no PHP is needed at all!
The hack #6 about tabs is shows that the author did not think about application performance - the example executes the code of all tabs but displays only one of it, the rest of the output is just buffered and increases the memory usage of the script.
Almost the same for hack #8 - this is basic HTML formatting and should be in a beginners-book, but not in O'Reilly's famous hacks-series.
While reading about hack #10 (Send HTML Email) I got really pissed of - I've never seen such a circumstantial way of sending a mail. He is not using one of the installed PEAR packages or using a class design, no, he is sending the HTML mail in a crappy way so it can't be reused and does not hide the details from the developer. Sending HTML mails using PEAR would have been much easier that that.
Chapter Three: DHTML
The chapter about DHTML and Ajax is just advertising for various JavaScript frameworks, and not for OpenSource frameworks, but also for commercial ones. Over all there is absolutely no need of using PHP for those examples - they just make the code much harder to read and don't allow to focus on the problem or solution.
In hack #16 the author suggests to use the Google image search to search for arrow keys without mentioning that those graphics might be copyright protected. This hint is very dangerous and could bring readers into serious problems!
The most absurd hack is #18 - about how to obscure JavaScript code. This is as useless as those "Disable Right Click" scripts that can easily be bypassed.
Also very intersting is the binary clock - those little scriptlets can be found by searching the web and there is no magic behind it and there is no need of printing such a (useless!) scriptlet in a book.
The calendar (hack #26) is also useless, because noone creates an own calendar today. There are lots of good and free (free as in speech and free as in beer!) calendar creating frameworks out there, so save yourself a lot of time and don't reinvent the wheel!
The only almost good hack is about copying Googles map-scrolling-effect, but the whole thing does only work with one browser and therefore it is not really useful at all.
The rest?
Somehow the story could continue for every single chapter. But after chapter five or so I stopped reading and just fly over the rest of the book... just check out the table of contents and you will see that I'm right if I say that the book just sucks and is not worth the money.
Buy another book that is really professional and has something new in it...
Comments