Best Practices of PHP Development

5 comments

  • comment by Lukas 31 Oct 06

    Just to make sure history is not changed. PEAR actually took Hordes CS and not the other way around :)
    Anyways today I would probably look at the ezC CS. Its an expanded version of the PEAR CS. Though I do not like their directory structure.

    As for DocBook it seems to me like none of the PHP doc teams have really addressed how to documented OO code. Also the tool chain is kind of heavy, but hopefully with Livedocs this will improve over time. One cool thing that was created in PEAR recently is doc coverage analysis:
    http://pear.php.net/package/QA_Peardoc_Coverage

    BTW: You do know that phpt testing used for internals testing is based on var_dump and print_r()?

  • comment by Sebs 31 Oct 06

    very interesting slides, the part about unittesti8ng worries me a bit:

    When you tell people they must test first you indoctrinate them a whole new way of development. It is simply not true that unit testing == test first design.
    The approach is nice, but very unreal in mostly ongoing projects or when using already implemented code (like OS components that do not come with tests).
    I am not that sure if the hints come out of a big expirience or the timeframe was just too small to present that topic as good as it needs to be presented to enlight people that testing a close to a guarantee to a met deadline and not a passed one.
    I dont thaink that content will make people hungry on the testking thing .. but anyway .. its a step forward, in comparasion to the other php testing slides that are put there …

  • comment by Mike Naberezny 31 Oct 06

    Sebs,

    You are correct that writing unit tests is not Test Driven Development, and we did not present it as such. Just beginning to write unit tests in any form is a great step forward for most PHP developers, so we focused on the concept of testing and the anatomy of a test case. We had a separate slide on TDD at the end of the testing section.

    Understand that testing is a very large topic that requires a dedicated session to be properly covered. However, we consider both unit testing and TDD to be extremely important as best practices for professional developers, so we gave the best introduction we could within the constraints of our session time.

  • comment by Mike Naberezny 31 Oct 06

    Lukas,

    I like quite a bit of ezComponents but I do not like their directory structure either.

    Regarding DocBook, you might want to take a look at the stripped down build system from Wez used by the Zend Framework. It is limited but very simple to use. I agree that the toolchain is heavy but most of the trouble I see people having is getting started. It helps to have a simple build system as a template to start. I also agree about the difficulty of writing class docs in DocBook. I tend to embed tutorials in phpDocumentor docs for these. Our focus was more on using DocBook for product documentation, such as a user manual you would give customers using your application.

    You lose a little bit of context by seeing the slides without the talk. In the testing section, our point is that many PHP developers write a bit of code, sprinkle in functions like var_dump() or echo(), reload the browser, and repeat. This is not testing and these are not test tools. I personally find PHPT files to be cumbersome but it is an entirely different case because they use a test harness and not browser reloading.

    Thanks for your comments. I will see about extending the slides to clarify these points if we give the talk again.

  • comment by Ibrahim Abdullahi 29 Feb 16

    Thanks

Sorry, the comment form is closed at this time.