Whats the advantage of doing this?
PHP Code:
|
Re: Whats the advantage of doing this?
Only that, there is no advantage.
But if you have a lot of code, grouping in functions, I see 2 advantages : - More readable. You have a main function, then subfonctions grouped intelligently. You can understand better and have a better view what does the main function. ( Too many subfunctions could do the opposite effect ) - More easy to debug. In case of bugs, you will find more fastly the problem if you need to debug the main function since you can debug each subfunctions. |
Re: Whats the advantage of doing this?
- if random_bullshit() is called by another function.
|
Re: Whats the advantage of doing this?
so public funcs called slower than non-public ones?
|
Re: Whats the advantage of doing this?
No, there is no speed difference. The tag public is used because set_task() can only call functions that are labeled public.
|
Re: Whats the advantage of doing this?
Is only for delay the task
|
Re: Whats the advantage of doing this?
Quote:
|
Re: Whats the advantage of doing this?
What he is asking is if bridging a task to a function without the public modifier is an advantage. And the answer is: yes if you pass parameters so is visually nice to pass them as arguments to another function.
|
Re: Whats the advantage of doing this?
Ok thanks quim, so the only advantage is readability.
|
Re: Whats the advantage of doing this?
what if you just make all func public? anything gonna change?
|
| All times are GMT -4. The time now is 04:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.