Book Reviews



By James Mohr

Learning PHP Data Objects

Perhaps the greatest stumbling block in any kind of web development has been the interface to the database. If you are using PHP, this problem has been simplified considerably by the introduction of PHP Data Objects (PDO). The PDO extension offers a substantial speed advantage and a unified interface over existing database interfaces but lacks some of the features of other packages. Although this book helps to explain PDO, I would have liked a more in-depth introduction to what PDO really means at a conceptual level, particularly compared with existing packages.

After briefly introducing the use of PDO, the author goes into more specific topics - such as error handling, prepared statements (new to PHP 5), processing the returned data, and advanced topics like transactions - and offers examples.

Even when I thought the code was obvious, the author still provided a brief description of what it was doing. I find this is a much better approach than assuming everyone codes exactly alike, and thus one's code is "obvious." Also, each aspect of the code is addressed within the context of a real-world, task-oriented example, which helps readers understand the material.

The book rarely strays from the focus of PDO, which means this book is not for beginners. Readers should already be familiar with application development and database access with PHP, although this book does provide a good introduction to object-oriented programming in PHP 5.

Anyone who has done even a little programming knows how daunting it is to add error handling after you have been working on the code for awhile, so Learning PHP Data Objects gets bonus points for putting error handling up front.

Dennis Popel

Paperback, 174 Pages

Packt Publishing, 2007

ISBN: 978-1-847192-66-0

UK£ 24.99, US$ 39.99, EUR 33.91

Programming Collective Intelligence

Despite being an interesting read, the book is not light reading - it is filled with code for the algorithms discussed, in addition to conceptual details of these algorithms, so you might need a refresher course on basic statistics and software algorithms. Still, where it was necessary to understand the concepts, the algorithm coverage quickly got up to speed.

The book begins with an introduction to "collective intelligence," which is basically analyzing input from multiple people to aid in making decisions or evaluations. The examples that most people are familiar with are the site rankings on Google and the recommendations on Amazon. Why a site has a high ranking or why a particular book is recommended is not always straightforward, and this book does a great job of covering the details of how to code to address these issues.

Topics covered are not just related to search engine or e-commerce applications; for example, the "Document Filtering" chapter talks about how to filter or classify documents on the basis of their content (i.e., spam). For the end user, this is likely to be a different problem, but for the developer, the methodology is very similar. Like other chapters, this chapter is not just theory - you are guided through the code to implement functionality.

The author uses Python throughout when discussing the algorithms. Although I do not have much experience with Python code, this wasn't a problem because of the nature of Python, the comments in the code, and the author's easy-to-understand style. Also, many of the examples are described step by step with the Python command-line interpreter, so you can see immediately how things work.

Each chapter concludes with several exercises that were "go do this," "things to consider," or "how would you do X" in nature. Exercises supported the material and helped readers understand solutions rather than simply explaining how a particular algorithm or chunk of code works.

If you need to give your application more than just a little edge, Programming Collective Intelligence is worth a closer look.

Toby Segaran

Paperback, 334 Pages

O'Reilly, 2007

ISBN: 978-0-596-52932-1

UK£ 19.52, US$ 39.99, EUR 35.95