Which coding style is better?
having one file that does all functions.
- index.php?action=add
- index.php?action=edit
- index.php?action=delete
index.php does and if/switch statement to include which files needed for which action.
ie.
if ($action == 'add') {
include('add.php');
add();
} else if ($action == 'edit') {
include('edit.php');
edit();
}
OR
having multiple files doing only one function?
- add.php
- edit.php
- delete.php
Is there a big performance loss if done using one file? Any comments?