By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

one large, or many small files?

P: n/a
I'm asking: for the PHP parser, it's better to create one large file
with all the code inside or a lot of small files?
Can a large file slow down the execution of the script?

Oct 4 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ma***********@gmail.com wrote:
I'm asking: for the PHP parser, it's better to create one large file
with all the code inside or a lot of small files?
Can a large file slow down the execution of the script?


One large file doesn't necessarily slow down the execution of the
script, that comes all down to what the code inside it does.

However, a lot of smaller files does have the advantage that the whole
solution is easier to maintain, and you're able to re-use code in other
scripts without having to insert the same code segment inside every
main script.

Also, uploading a large script creates downtime in the time period
you're uploading the script, depending on the file size of the single
script and your own upload speed.

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Oct 4 '05 #2

P: n/a
JDS
On Tue, 04 Oct 2005 04:04:11 -0700, marco.avidano wrote:
I'm asking: for the PHP parser, it's better to create one large file
with all the code inside or a lot of small files?
Can a large file slow down the execution of the script?


Don't worry about it. Speed differences will be negligible.

From a programming practice point of view, though, multiple include()ed
files often make a large project easier to build and maintain. All of
your functions in one file, an HMTL header and footer in others,
business logic in still others...

Programming practices Haiku

Keep style consistent
Use comments, annotation
Remember to reuse code
later...
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Oct 4 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.