I do not have a ton of PHP experience, but whenever I have been given legacy code or even recent PHP code, one thing that always strikes me is how BIG the functions are. In seems like every .php file as at least one page-long function in it. Is there any intrinsic reason why functions and methods in a dynamic, high-level language like PHP should be so huge? The only kind of code I can think of that exceeds it in lines-per-function is C code. Why does PHP code always look this way?
+13
A:
No, there isn't any reason why the functions should be larger in PHP.
If the functions are huge, they were the result of a bad design.
Perhaps you're dealing with PHP scripts written by people with little programming experience, who didn't know how to write well-structured programs.
Artefacto
2010-08-12 22:00:30
These weren't scripts, they were full enterprisey applications.
newtophp
2010-08-12 22:14:48
@newt PHP is a scripting language; full applications are composed of several script files.
Artefacto
2010-08-12 22:43:18
@newtophp 'enterprise application' is not synonymous with 'well designed application'
Michael Robinson
2010-08-12 23:01:37