Re: should basic data validation go outside a function or inside?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brad Pauly wrote:

should basic data validation come before a function call or be performed
within the function?

I would do the validation inside the function. This avoids repeating the validation everywhere the function is called. It also makes the function more self-contained. It expects a certain input and complains, or returns false, if it doesn't get it.

yes, and of course shouldnt every function check it parametres before proceeding?


--
Sebastian Mendel

www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetime        www.sf.net/projects/phptimesheet

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux