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...

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.