Re: Looking for an informed opinion

From: Date: Tue, 28 Nov 2000 15:24:16 +0000
Subject: Re: Looking for an informed opinion
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-27605@lists.php.net to get a copy of this message
Larger scripts will become harder to maintain and debug - generous commenting can help with this. If most or all of your functions are related, keeping them in that file makes some sense, but again, maintainability/readability can suffer. Perhaps breaking various pieces of functionality into different files, but INCLUDE()ing them into just one file that gets executed is a good balance. What do you mean by 'big'? 100 lines? 1000 lines? 10000 lines? We don't have too many files that are >1000 lines in our code - but they include other files as well, so at the end of the day one script may be executing 2-3000 lines, but for readability and modularization purposes, the functionality is broken down into multiple includes. This is a very subjective topic obviously, and I'm not convinced there's a 'right' answer beyond what is best for your situation for the long term. Hope that helps some. Cybercandy wrote: > Hi All, > > I'm writing a php script to receive emails save them into a mysql db and > then another > script to list and view them. My question is: At the moment I'm keeping > all the viewing functionality > within one script which generates the a number of different pages. Are > there any major disadavantages to producing one big script rather than lots > of smaller scripts for this page generation functionality? > > Allan Goacher > Cybercandy Ltd > -- ========================== Michael Kimsal http://www.phphelpdesk.com/search/ PHP Training courses http://www.tapinternet.com/php

« previous php.general (#27605) next »