Slashdot Mirror


PHP4 Web Development Solutions

honestpuck writes "Wrox Press seem to have become masters at putting together volumes from a large number of authors. This 600-page volume is another example. This way of working does have some drawbacks, there is a little repetition of some basic stuff throughout the book, but not enough to truly detract from it." Read on for the complete version of honestpuck's review. PHP4 Web Development Solutions author Raj Kumar Dash, Bryan Waters, Alison Gianotto et. al. pages 601 publisher Wrox Press rating Fair reviewer Tony Williams ISBN 1861007434 summary Mid to high level exposition of web site development in PHP

In brief: The book, after some expository material, details 11 projects of increasing complexity. They use PHP, MySQL, PEAR::DB, Smarty and PHPLib. The target audience, according to the book jacket, are programmers who already have a good knowledge of PHP, SQL Databases and XML. Frankly, I think they overdo the amount of experience you need to use and benefit from this book. If you are on top of all those topics well enough to consider yourself "professional" then this book may be too simple. If, on the other hand, you are, like me, conversant with PHP and SQL but would like to take yourself up to "professional" use of technologies like XML, templating and WAP enabling then this book will be good.

What's Good About This Book

The book is stuffed full of code examples -- and while you can download them in a ZIP file of over 3Mb you shouldn't think of this book as a "cookbook" as such. It shows various methods for performing most of the tasks you need to build solid backend web site systems to deal with a large variety of data. The projects cover importing and exporting of XML, messaging systems, forums, content management, using templates for both HTML and WML, search facilities and both simple and complex content management among other topics.

The projects are well designed. I'd have to say that among the 11 projects most web site requirements are covered somewhere. The code is well engineered and some thought has gone into making it readable, understandable and useful. The explanatory material is well written, if too short.

One thing I did appreciate about this book is how much they left out. No coverage of PHP fundamentals, SQL fundamentals and simple stuff like web forms might be covered once, at most. I certainly didn't need another book on my shelves explaining the basics.

What's Bad About This Book

My largest criticism of this book is one shared by too many modern titles for computer programmers; there is too much explanation and too much repetition. The section on SQL is the perfect example. Most projects contain some tables describing each database table, a diagram of the relationships and then the full SQL required to build them, their indices and some example data. For their proposed target audience this is way too much information, and as it is safe to assume that everyone who buys this book has a decent 'net connection, why put a printout of SQL available online in a PHP book? I could have easily written the SQL myself and having it in the book doesn't make it much easier and since it was available online it was a total waste of space.

I also have to take exception to, an (admittedly short) chapter devoted to installing and configuring PostNuke. It gives you no more information on this simple task than the online documentation. As someone who has installed PostNuke a couple of times and never needed any assistance beyond the readme files (and the first was long before I considered myself a good PHP programmer) I felt this was a complete waste of space and not "web development" at all.

My final criticism is once again shared by too many modern titles, there isn't really enough discussion of the design decisions and complications. There are enough code examples and walk throughs to satisfy anyone, but not enough key design decisions are discussed at all, with only a few short examinations of any real design problems. I would have appreciated some walk throughs of such things as code that was too slow, problems with race conditions, methods for mixing static and generated parts of a site and all the real world stuff that intrudes when your site gets slashdotted and that code that was so neat with a hundred visitors a day becomes a thousand. Then show how the code they provide is better, avoids the problems and how to get my code to the same state. Since this book is "professional" a little more real world, please.

You can purchase PHP4 Web Development Solutions from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

8 of 107 comments (clear)

  1. Honest Question by evronm · · Score: 4, Interesting

    I've been using Perl and XSSI for all my active web page content for a couple of years now. Is there any compelling reason for me to learn PHP?

    I really don't want to start a flame war here, but what are the advantages of PHP over the Perl/XSSI combo?

    1. Re:Honest Question by Anonymous Coward · · Score: 1, Interesting

      PHP is designed more for database applications, although it can be extended (like Perl) to do a lot more. The routines PHP uses for database management have been thoroughly refined and optimized to achieve maximum speed. I believe it is generally accepted that for databasing, using PHP will result in faster, more streamlined, and smaller code. Obviously, your needs may vary.

    2. Re:Honest Question by daperdan · · Score: 2, Interesting

      You be the judge for your application.
      If you haven't seen this report you should take a look at it:

      http://www.bagley.org/~doug/shootout/

      This site compares many of the modern languages. PHP really doesn't fare well in this test. Of course, PERL doesn't prove to be the top of the heap either.

      Ultimately, I think the most important thing to look at here is lines of code required to do the job. Execution time continues to be less of a concern as processor speeds increase and hardware tends to be cheaper than man hours. (Unless you work in a sweat shop in a 3rd world country.)

      There's no one language that adresses all problems.

    3. Re:Honest Question by Anonymous Coward · · Score: 1, Interesting
      The ONLY reason you prefer PHP over Perl is because you were never able to actually, fully GROK perl and its beauty.

      Perl's beauty is the sort only masochists can truly understand. It's well on its way to becoming the new COBOL.

    4. Re:Honest Question by czth · · Score: 2, Interesting

      PHP is designed more for database applications

      No, PHP was designed (and I use that term loosely) to make dynamic web pages, and the database functions were - like most of PHP - thrown in as an afterthought, unlike perl's DBI, which was designed to be OO and have a consistent interface.

      although it can be extended (like Perl) to do a lot more. The routines PHP uses for database management have been thoroughly refined and optimized to achieve maximum speed

      That's content-free. All languages can be extended, even Visual Basic, and they all (except perhaps INTERCAL) claim that their libraries have been "thoroughly refined and optimized to achieve maximum speed." Of course, some do better than others (see Doug's shootout).

      I believe it is generally accepted that for databasing, using PHP will result in faster, more streamlined, and smaller code.

      And I believe the earth is flat, but it isn't. Or, BZZZT, WRONG (zero for three)! And databasing? PHP isn't neither particularly fast nor compact.

      Sad but true: PHP sucks. It's a half-assed attempt by some lame twits to make a programming language for non-programmers, which is sort of like trying to make a car for non-drivers. Whether they succeeded or failed at that goal, we all still lose, because of the horrible proliferation of all the crap PHP scripts on the world.

      Dijkstra would probably revise his famous quote for PHP's benefit to: It is practically impossible to teach good programming style to students that have had prior exposure to PHP; as potential programmers they are mentally mutilated beyond hope of regeneration.

      czth

  2. Re:PHP 5? by Andreas+Rueckert · · Score: 2, Interesting

    It depends. PHP 5 will be a step forward for OO developers. We are working on a UML module for PHP (4 at the moment) here, and I think the differences are noticable (and are causing us a couple of problem in areas like PHP parsing).

  3. Wrox no longer does... by tsqlnerd · · Score: 2, Interesting

    I used to be a huge fan of Wrox books.. my bookshelf is filled with many of their older "big red books". One of my favorite technical books ever is their Professional SQL Server 2000 Programming book.. but it was written by ONE author -- Robert Vieira. The books chapters flow smoothly, the author is well-informed, has a great way of presenting the information (much like a conversation) and the book overall is a pleasure to read. Wrox's newer books, including the one reviewed above, have too many authors. They are often disjointed as each chapter is written by one author. "Too many cooks spoil the broth" applies here so well. I've moved on to a new favorite publisher -- Addison-Wesley. Their books are often more advanced and although they are often used at Universities, their books are written very well and aren't too "textbookish". I find that Dietel Press and O'reilly are too textbook-like. I used to love Wrox's conversational style of writing that most of the authors had..but its just not the same. Some of Wrox's reference books are well written and have many authors that created the book, but they are just a reference. You don't need flow. In conclusion (;) if I need anything other than a reference, I'll consider a Wrox book if there are one or two authors..but anything more than that, and I'm looking more closely at Addison-Wesley, Apress and Morgan Kaufmann.

  4. Re:good if you like that sort of thing by Sad+Loser · · Score: 2, Interesting

    I agree, I don't like the wrox style either.

    Being a sad php-geek, I buy pretty much all the PHP books which come out, but the ones I use the most are the O'Reilly ones, (partly because they are written by the PHP team).
    However the best one [IMHO, IANAL etc] for learning and as a reference is the one by Atkinson, by Core.
    Well edited, with well thought out examples.

    If you can hold out, PHP5 is not that far off.

    --
    Humorous signatures are over-rated.