Hey everyone.
I'm working on a fairly large project (about 70% done, running about 6000 lines right now). I've done it entirely myself so far, but I recently recruited a friend to help out.
Now he's gone and started bitching about how I have my functions organized.
The project is a message board, similar to phpBB. It is partially that I have some unique requirements and partially that i wanted to "see if I could" do it by myself.
Now that I know that I can do it, I'm sensing that we're close to the final product.
Right now, I have the system set up as such:
index.php is the main index and merely calls several functions which display headers, generate the main SQL query and display the index line by line. This function REQUIRE()s one other file that has all of it's sub-routines in it.
there is also a MESSAGE file that displays the content of messages, which calls one OTHER file where the majority of the code is stored.
In addition, there is a POST file which handles posting of new messages. This file also REQUIRE()s a few other files which contain the primary functionality of the code.
Each of these modules is divided up into between 2-10 functions, each having a specific purpose.
There is also an administrative file, which calls a few of it's own functions from another file, as well as pulling a few of the funcitons off the remainder of the database.
There's also an authentication routine, which is in it's own file and is called by all of the others to check usernames and such.
Does this sound way out there? or is it solid?
The problem I have is that my friend has decided it's best to put ALL of the routines in one file. so now every request is handled by the index.php file.
to view a message, your pass the variable "action=message" such as:
index.php?action=message&m=200
He also wants to run all of the functions that are REQUIRE()d together into one central "repository". He says it is more secure and easire to find things when the system is set up this way.
I'm asking because I don't want to put my foot down and say "no, this is HOW IT IS" and the only reason I have is "because I think it's better"
If someone can let me know what they think and perhaps cite some examples, I would appreciate it.
I am open to whatever you all have to say about this, but I really am curious what most people consider "good practice" in programming. (I think I already know, but maybe I'm wrong)
Thanks,
Eric