RE: [PHP] Advice on script length please!
| From: | Jay Blanchard | Date: | Thu, 05 Jun 2003 12:35:54 +0000 |
| Subject: | RE: [PHP] Advice on script length please! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150340@lists.php.net to get a copy of this message | ||
[snip]
> If I did this, would it make a huge amount of difference?
I'm almost certain it WOULD make a difference, but apart from the
execution time, I can't think of anything worse than scrolling through
2000 lines of code looking for the section I'm after.
Or, even if *I* could find my way around, what about other developers
who have to decipher it later???
[/snip]
Even if the functions are in an include and I called that include at the
top of the page wouldn't that just make the overall code the same
length? i.e.
<?pseudo-code
include("functions.php");
switch($action)
case "do this":
.....
function(s) called
break;
case "do that":
.....
other function(s) called
break;
case "do the other":
.....
no function(s) called
break;
?>
Now, it does make the code neater and easier to document no doubt, but
doesn't the script namespace above become the same length as itself plus
the included file(s)?
Jay