On 1/6/2010 7:18 PM, clanc...@cybec.com.au wrote:
I have a flexible program, which can do many different things according to the 
type of
data it is fed.  Ideally the flexibility is achieved by calling different 
though when the functionality is ill-defined I sometimes just include blocks of 

Ideally, from the point of program maintenance, each module should not be too 
long --
preferably just a page or so. This doesn't raise problems in a compiled 
language, but in
an interpreted language like PHP the programmer must decide whether to lump a 
whole lot of
functions into a single large include file, or to include lots of little files 
as the
particular functions are needed.

The first case can lead to memory bloat, as there are likely to be a lot of 
functions in memory on any given pass, whereas the second case may require lots 
of little
files to be loaded.

Are there likely to be significant performance costs for either approach, and 
what are
your feelings about the relative virtues of the two approaches?

It is highly unlikely you are going to create any significant "memory bloat". Your code will likely be infinitesimal compared PHP's memory requirement.

I suggest 3 files, one with your configuration settings, so they are all in one place and easy to find and change, another file with your functions and the third file contains the code for handling the internet interface. Obviously, the interface file controls everything by calling various functions as needed.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to