473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Is it good to include unuse files?

Sorry for the noob question!
My project have alot class files(>100), in one request I only need some
class(1-5), but I dont like to have to specifies needed files so I make
a include.php, that include all my class files.

In action file, I only include the include.php! Is it good for
performent? Does it make any problem?

Thanks!

Sep 14 '06 #1
2 1128
ngocviet wrote:
Sorry for the noob question!
My project have alot class files(>100), in one request I only need some
class(1-5), but I dont like to have to specifies needed files so I make
a include.php, that include all my class files.

In action file, I only include the include.php! Is it good for
performent? Does it make any problem?

Thanks!

Including 100+ files while you only need 5 will always hurt your
performance. Includes are slow.

Even so, it shouldn't necessarily be a problem unless you run over the
maximum execution time limit.
Just keep in mind that users who have to wait a lot, may not stay for long.
Sep 14 '06 #2
ngocviet wrote:
Sorry for the noob question!
My project have alot class files(>100), in one request I only need some
class(1-5), but I dont like to have to specifies needed files so I make
a include.php, that include all my class files.

In action file, I only include the include.php! Is it good for
performent? Does it make any problem?

Thanks!
No, it is not good for performance, as has already been stated.

The bright side is that you don't have to specify each include that you
need to use seperately anymore. Have a look at autoload [1]. With
this function, you tell php that whenever I want an ABC object, include
the file class.ABC.php, or whatever naming convention you are using.
This way, php only includes the files which are referenced in your
code. Just define it in your include.php file and you'll never have to
think about it again.
*Disclaimer: PHP 5 only

[1] - http://us3.php.net/manual/en/language.oop5.autoload.php

Sep 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
4
by: serge | last post by:
I am thinking about replacing the INSERT data script files that I have with XML files. This way I can open the XML file using an XML Editor and see the values in a GRID and make changes easier. ...
16
by: Protoman | last post by:
Is this a good way of making use of OOP? Also, is this a good way of computing Fibonacci numbers? Code: #include <iostream> #include <cstdlib> using namespace std; template <class T>
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
18
by: Chad A. Beckner | last post by:
I am (and have been trying!) to find a good way to do the following few things: 1. When a user requests a .aspx/.htm/.html file, the file needs to be automatically integrated into a page...
1
by: Pugi! | last post by:
Because my functions tend to become rather lengthy I split up the functions for each subject or action in a function (a) that checks user input (filter and validation) and if this checks out ok it...
4
by: James Kanze | last post by:
On Jul 16, 10:53 pm, Mirco Wahab <wa...@chemie.uni-halle.dewrote: It depends. You might like to have a look at my "Hashing.hh" header (in the code at kanze.james.neuf.fr/code-en.html---the...
1
by: Sarvesh1989 | last post by:
I have one main div & in that main div i have included 2 differrent div it show good result in firefox but in ie it doesn't show that same result div just get one above the other.plz do help me. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.