views:

110

answers:

4

i was wondering do you think i should keep all my functions in one file, or seperate them in different files!!

p.s if i put all the functions in one file, would it be easier for php to process that stuff!!

+6  A: 

It depends on how many functions they are, how long they are, and what they do. For any significant project, putting everything in one file is generally a bad idea. They should be categorized by what they do.

Having things in separate files is important not only for organization and legibility, but it also really helps during source control to see that a certain file has changed but all the others have stayed the same.

Reinderien
thank you very much, a very nice clear answer!! upvote for you
getaway
+1  A: 
bmarti44
+2  A: 

This is premature optimisation attempt. The time for processing of the actual file content is going to outweigh the time saved in opening one closing the files. So you are saving maybe .01% of the time by splitting the files.

kizzx2
+1  A: 

According to my experience, the fewer files you include the faster a PHP script runs. If separating the functions in several files means you need to use include or require several times, it's probably best to keep the functions in one file.

matsolof