[wp-hackers] echo and return
Randy Peterman
randy at randypeterman.com
Mon Jul 26 19:49:17 UTC 2004
I can say I agree with Brian in the sense that an object is nicely
configurable and can have default values.
I don't see the problem with having a function call like this:
goMakeSomeCoffee(/*decaf*/false, /*ounces, defaults to 12*/ , /*flavor,
defaults to none*/ , /* cream, defaults to no */ , /* foamy, defaults to
no */ , 'splenda',1);
If the function is written correctly that should work fine. I should
get black coffee with one packet of Splenda [please no comments on my
coffee ;)].
The documentational benefit of set parameters is that users can learn
more quickly about the functions and how they work.
For brevity passing name=value parameters is nice if you've written such
a large function, but at what point have you created a monster rather
than a function?
Regards,
Randy Peterman
More information about the hackers
mailing list