lagu2653 — 2012-12-04T10:48:55-05:00 — #1
Coming from an application development environment (Java, C#, C++);
Is there no limit specified by a PHP (Zend) coding standard which sets a guideline to how long the body of a method can be? When programming an application a method should only have one task, delegate everything else. And the body of a method should never be so long that you can't view it in one page (about 40-45 lines, the shorter the better).
Are there some similar guidelines in PHP. I've never seen a guideline concerning PHP for how long methods should be.
cups — 2012-12-04T13:49:38-05:00 — #2
Here is an old thread which deals with the overall question -- OOP Methods
kylewolfe — 2012-12-04T14:07:20-05:00 — #3
Ha, I just had to bring this up from that thread after reading it, too funny. From @lastcraft ; on post #8
Currently your class is a well topped cheesy pizza. If you try to separate pieces of it you will find the pieces remain joined with strands of melted cheese and some of your vegetables drop off. What we want to do is gather like vegetables together so that we can cut it cleanly without stringy bits.
cups — 2012-12-04T15:00:24-05:00 — #4
Yeah, always class stuff from @lastcraft; I think I bookmarked half of his threads. I miss him a lot, but we never venture into anything dangerous on here any more.
kylewolfe — 2012-12-04T15:21:38-05:00 — #5
What do you mean?