Using Files to Group Functions

We've shown that it pays to use multiple files for source code, but we encourage you to also use files for most other resources, such as configuration data; custom headers, footers, or other templates; and anything else that can be extracted from your project as a separate entity.

Using multiple files for a single project offers quite a few advantages:

  • You get smaller source code files that are easier to maintain.

  • You can create different revisions for each file instead of having to check in the whole project for a small modification.

  • You can detach resources from the project and reuse them in other projects.

  • Different team members can work on the project simultaneously, without having the trouble of merging when ...

Get Web Application Development with PHP 4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.