[Pdx-pm] Too much validation

Michael G Schwern schwern at pobox.com
Thu Nov 20 02:54:15 CST 2003

On Wed, Nov 19, 2003 at 10:39:05PM -0800, Joe Oppegaard wrote:
> So as a general rule of thumb, when should data validation be done?
> Catch it early or catch it when it actually matters? Or both? (Ugh,
> duplicate code).

Depends on what you're doing, but in general I'd say catch it as the new
data comes in.  That way you an put the checks in one place and won't
forget to validate on the way out.

Michael G Schwern        schwern at pobox.com  http://www.pobox.com/~schwern/
Cottleston, Cottleston, Cottleston Pie.
A fly can't bird, but a bird can fly.
Ask me a riddle and I reply:
"Cottleston, Cottleston, Cottleston Pie."

More information about the Pdx-pm-list mailing list