syntaxerror Posted September 18, 2007 Share Posted September 18, 2007 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... Quote Link to comment https://forums.phpfreaks.com/topic/69730-weighing-modular-programming-versus-server-loadperformance/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.