To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-04-2004, 04:03 PM   #1
adnan1983
Member
 
Join Date: Aug 2002
Posts: 92
php include file

my boss wants me to write an include file, with all the function the application is going to use. The include is already over 2700 lines of code. I hate doing in such a method, I like having different include files for different sections.

How do you guys write your code?
adnan1983 is offline   Reply With Quote
Old 02-04-2004, 04:12 PM   #2
daynah
PHP Princess
 
daynah's Avatar
 
Join Date: Mar 2001
Location: CA, USA
Posts: 324
I usually write them in classes and then include those files when I need them. Splitting them up into files/classes is easier to comprehend, especially when I don't look at the code for months.
daynah is offline   Reply With Quote
Old 02-04-2004, 04:14 PM   #3
adnan1983
Member
 
Join Date: Aug 2002
Posts: 92
yeah, I know splitting them up into different files/classes will be much easier. But he wants me to do in one big file, and then use that include file.
adnan1983 is offline   Reply With Quote
Old 02-21-2004, 06:44 PM   #4
ednark
Senior Member
 
ednark's Avatar
 
Join Date: Oct 2002
Location: DC
Posts: 846
well an include file can always incude an include file


so... you can have one main one to include on each page... and then have that call each sub include
__________________
Depth First Baby!!
Code:
                     i
        think                  poem       
    that     never        as          a     
 i    shall see   a  lovely as  binary tree
ednark is offline   Reply With Quote
Old 02-21-2004, 08:43 PM   #5
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,128
I've seen situations where each function was in its own include file; every function that called others used include_once() to load just those other functions. I don't know how good an idea that is in general: it was being used in a situation where standalone apps were being generated from the code in the library, and it was necessary that only the code that was actually used in any given application would be included. There was also a tool for tracking these include() dependencies.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.

Last edited by Weedpacket; 02-21-2004 at 08:48 PM.
Weedpacket is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:48 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.