PHP Developer Best Practices

  • Posted by Mike Naberezny in PHP,Testing

    Matthew Weier O’Phinney and I gave a tutorial session at ZendCon 2008 this year titled “PHP Developer Best Practices”. The tutorial touched on source control, coding standards, testing, documentation, and more.

    The slides are now available in PDF format.

    We were located in Hall B of the Santa Clara Convention Center, which is a very large room that’s also used for the keynotes. Andi told us the room was selected based on the number of people who registered for our session. We initially had doubts but the attendance was greater than any previous year and the room worked out quite well. We were thankful that unlike last year, everyone was able to get a seat.

    Thank you to all who attended. We enjoyed meeting many of you during the breaks and hope that you found our session helpful.

5 comments

  • comment by Vid Luther 16 Sep 08

    Great presentation/Slides Mike and Matthew, too bad I couldn’t make it to actually see it in person. I had one question.

    Why do an export from the SVN tag?, why not a CO of the tag? Is it because ideally once something is tagged, any maintenance fixes etc, will be done to a different branch, and hence a new tag will be created?

  • comment by Mike Naberezny 16 Sep 08

    Yes. Most users treat a tag in Subversion as a snapshot in time. Once created, the tag is not modified. A new deployment milestone will be a new tag.

    Using the export command instead of checkout prevents the repository information (.svn directories) from being created.

  • comment by Thomas 16 Sep 08

    Distributed VCS without a mention of Mercurial? That was surprising. Great presentation, although I was also surprised that you left off the Drupal project’s coding standards which are prominent. I think I finally get TDD now, and I’m going to see how I can use in (SimpleTest) in my business’ CakePHP app.

  • comment by Kevin Day 19 Sep 08

    Great slides. It finally convinced me to integrate testing into my development procedure. Thanks!

  • comment by Hodicska Gergely 20 Sep 08

    THX for sharing the slides: great work. A few comments:
    – I prefer TAB over space with a little rule: use TAB in the beginning of the lines, and use space after. This way every developer can use his own indentation width and the look of the code is consistent. Of course this needs a little more discipline from the developer.
    – I missed a little mentioning creating convention related to the database too. There could be a lot mess on this level too. (table name: plural or not, PK: id or user_id, index/trigger naming convention, “design patterns”: using the same data types in the same situations, field naming convention: is_ for bool etc., query formating and a lot more).
    – “Learn to design for testability”: a very important point and unfortunately this one is not really covered by PHP books.

Sorry, the comment form is closed at this time.