Hello Alex,

Wednesday, February 11, 2004, 3:47:09 PM, you wrote:

AH> How large can that file be?

How long is a piece of string? :)
It's as long as you need it to be.

AH> I have a func.php file that I'm putting all my reusable functions in but I
AH> can see that getting pretty large if this project starts getting eaten up
AH> with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;->>)

Are you using classes? If so that should naturally break your project
down into more meaningful chunks.. i.e. you could have a user class,
an order class, etc etc.

If not then you'll end up with hundreds of functions in a single file
which will become a nightmare, so split them into more sensible groups.

AH> So how large is too large?  I have about 50 constants and globals right now
AH> and it's probably going to get a little larger.  At what point do you break
AH> up the files for performance versus convenience and maintainability?

Bear in mind that it is PHP that has to load and use the file, not the
web browser. So to be honest I would say you can easily fit all of
those constants in a single file - my common include at the moment is
35k.

AH> I read the article that someone posted the other day about "good php coding
AH> practices" and found that it contradicted a lot of what I have seen not only
AH> on php.net but in this forum.  Some of what was written though made a
AH> tremendous amount of sense.  Other was just common sense, like not putting
AH> function calls in loops.

There is no "standard" so you have to find your own middle ground. I
don't know which article you are referring to though. Some things make
sense, some make you think "now that's a good idea" and others are
just downright stupid. Trust me, you will NEVER find two PHP
developers who do things the *exact* same way. That doesn't mean write
bad, poorly formatted code - it just means no-one can turn around and
tell you "it's wrong".

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to