> Hmm.. Although this sounds like a good idea at first, it seems like it
> would get pretty complicated really fast. Am I missing something?

        Well the idea is that on very large programs you create a number of
different components that can be used and changed independently.  To
give you an example, if you don't split up those two functions, and you
decide you want to modify the way the results are displayed, it is
possible you could accidentally "break" the database query when updating
the way tables are updated.  (i.e. debugging is easier because you can
test functions in seperate programs.

        The other thing is (again, on very large programs.  for small programs
the quick and dirty solution is almost always faster) that if, for
instance, you decided you wanted to create a second way to display
results you could either cut and paste the original big function and
modify it or create two functions that call GetAttributes.

        But if you cut and paste, when you go to change the way GetAttributes
gets attributes you will need to update /two/ functions and not just
one.  This is one of the reasons why breaking things up into components
makes creating and maintaining very large scripts easier.

-Dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to