On Feb 17, 2008 3:36 PM, John Siracusa <[EMAIL PROTECTED]> wrote:
> Maybe, but as I've said I'm not really a fan of runtime parameter
> validation.
I'm a horrible typist which makes me a big fan.
Doing it in just one place may have a minimal impact, but
> then the question becomes, why isn't it done everywhere? (Doing it
> everywhere adds significant overhead, both in terms of runtime cost
> and code bulk.) Do we add it on a per-request basis every time
> someone mistypes a parameter name? It's quite a sinkhole, IMO, which
> is why I do it nowhere: it's the egalitarian approach ;)
I think all public APIs should have validation. Using it for complex
internal APIs can have value too, but it's definitely not as big a win.
I'll admit that I don't always follow this prescription, but the more
comfortable I get with Params::Validate the more often I use it.
I think the maintainance hastle of maintaining param checking code is
greatly reduced by using a module like Params::Validate. It needs one hash
per method with one item per parameter. Compared to maintaining POD
describing the parameters it's a breeze!
As far as runtime overhead, there's only one way to know for sure what it
would cost. I'll play with it and report back.
-sam
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object