Jump to content

Weighing modular programming versus server load/performance


syntaxerror

Recommended Posts

hey guys, i just need a little bit of insight on this one

 

 

I'm trying to weigh the pros and cons of using php functions... creating a  modular program (though in some cases, only 2 or 3 pages may utilize the functions )

 

as opposed to just writing all the code in one page, and perhaps just separate the database query functions...

 

 

let me give you a picture :

 

    i have a product line to be maintained in the system...

    i have 6 configurations/general types...

    they may have similar areas but also have some differences that may affect layouting on the input form

 

 

    so i'm not sure if perhaps i should just write one function that will take care of all these, and that would probably involve more than 3 parameters, and most certainly one array.

    on places on the layout i might have to do some case statements to handle for the variations,

    and in others an if then branching....

 

    while it allows me to centralize all editing in only one spot/ function

    i believe it also adds load to php, that it would have to do some extra operations

    and passing some variables, writing the final layout to the calling page...

 

    and here i cannot decide firmly which approach to favor. or by which guideline i should adhere

 

    at some point i realized that this is not like creating a program that is compiled only once and then      the  compiled code executed the way it is, in its lifetime...

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.