I've got a script that pushing 2,000 lines. Is this a threat to performance? Should I split it up?
Originally posted by futang:
well, since its about 10 different things why not split up each function, put each in its own file and then if you have to execute it just include it ? Not only will this cut down on the size of the file, but it will also make the overall functionality of the whole thing more obvious and make it easier to change the functions. i think you answered your own question
...
elseif ($action == 'editGroup' && !empty($submit)){...}
elseif ($action == 'editGroup' && empty($submit)){...}
elseif ($action == 'newGroup' && !empty($submit)){...}
elseif ($action == 'newGroup' && empty($submit)){...}
...
Originally posted by futang:
im not suggesting you make the different functions the target of your url. keep your big if block but when you find the one you want import the function and run it. i doubt you'll be gaining much speed but at least from my point of view its a lot easier to work with a bunch of 100-200 line files than one monster.