|
Posted by d on 01/25/06 13:38
"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:1138151910.889433.106930@g43g2000cwa.googlegroups.com...
>
> bryan wrote:
>> lets say I have file, index.php that includes a file logic.class.php,
>> and inside of index.php i initialize the class, $logic = new logic;
>> now, lets say that the $logic object inside the class file uses ANOTHER
>> class, $template = new template; for templating it and lets say the
>> TEMPLATE object users ANOTHER class...my question is does it matter how
>> far down you go inside the files? will they all still work fine? Is
>> there a limit? Is this just bad design? Need some input.
>
> In my opinion, there is no "good" and "bad" in programming. Just "what
> works" and "what doesn't work."
But how good code is determines whether "what works" becomes "what doesn't
work" due to unforseen circumstances ;) I've seen some incredible spaghetti
code, which does work, but is a nightmare to maintain. That is not "good",
as when it breaks, it would take ages to even find the problem, let alone
fix it. :)
> IFAIK there is no limit to how many level of includes you have. It's a
> matter of personal preference. Personally I perfer to include only at
> the top level so that it's easier to see what files are involved in a
> particular script.
Very sensible.
Navigation:
[Reply to this message]
|