Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Data Sanitation

Name: Anonymous 2011-05-02 18:32

Quick opinion question for you:

When you're instantiating an object based on unsafe input from a form in a loosely-typed language, do you leave the sanitation up to the form handler, or to the object?

Ex:

p = new Pokemon();
p.name = sanitize(form.name);

vs.
p = new Pokemon();
p.setName(form.name); // sanitizing code in the method

Name: Anonymous 2011-05-03 2:59

>>14
It's what I call "mental masturbation", when you engage is some pointless intellectual exercise that has no possible meaning. -- Linus Torvalds

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List