It also means that you only need to change one function or that changing one sub-function/method will not affect the others.
The overhead will be pretty minimal but there is always a balance between readability and overhead.
Obviously you can set CONST for the flags so
const OBJECT_NOT_EXIST=0
const OBJECT_EXIST=1
contst CREATE_OBJECT=2
You can also expand easily by adding another const/flag and then another subfunction by expanding the SELECT/CASE.
SELECT / CASE can be ordered so most frequent options are placed at the top and least frequent at the bottom.
Long function calls are not a problem for people 'using' the code. If you're expecting people to look at your code in-depth or maintain the code then comments (e.g 'Calls' and 'Called by' statements) and/or UML (or other diagrams) will help.
The overhead will be pretty minimal but there is always a balance between readability and overhead.
Obviously you can set CONST for the flags so
const OBJECT_NOT_EXIST=0
const OBJECT_EXIST=1
contst CREATE_OBJECT=2
You can also expand easily by adding another const/flag and then another subfunction by expanding the SELECT/CASE.
SELECT / CASE can be ordered so most frequent options are placed at the top and least frequent at the bottom.
Long function calls are not a problem for people 'using' the code. If you're expecting people to look at your code in-depth or maintain the code then comments (e.g 'Calls' and 'Called by' statements) and/or UML (or other diagrams) will help.