Andrew Halliday wrote:

>
>
>Ive coded in both PHP and ASP and in both OO and function oriented.
>Ultimately, i find functionally oriented PHP to be the best ... what do
>other people think?
>

As much classes/objects as possible, imo.  'functions' by themselves are 
OK for smaller stuff,
but when you start getting larger projects, and need to make changes - 
heaven help you, unless
you're smart enough to have made most/all of your parameters passed into 
the functions into one
big array.


having multiple function calls in various places like

$x = calculateFreight($sku,$state)

when you then need to add 'weight' as a parameter is a pain.

It's more of a pain if I have to remember what order the parameters go 
in - I have to do

$x = calculateFreight($sku,$state,$weight);

not
$x = calculateFreight($sku,$weight,$state);

else my function will be problematic.  Being able to do something like

$x = new item();
$x->weight= 1;
$x->state = 2;
$x->sku = 3;
$x->calculateFreight();

without worrying about the order of the parameters helps a lot, imo.

To each his own tho.

----------------------------------------------------------------------
Michael Kimsal
PHP training courses
http://www.tapinternet.com/php
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to