in reply to Writing general code: real world example - and doubts!
Untainting variables that you've already checked to be good? That's the battle you should be fighting because it's a recipe for disaster. Don't wuss out: if you want taint checking, don't subvert it by giving programmers a way to ignore it. :)
The trick to any of these sorts of decisions is to look at the rest of the code and figure out which style it uses, then try to use the same model. If most of the interface changes arguments in place, do that. If most of the interface leaves arguments alone and returns the munged values, do that. Beyond that, figure out which one makes the problem easier to solve and the code easier to read ( the optimal combination of those!), and do that.
Once you figure out what you want, clearly document it.
But, if you're spending all your time worrying about little details like this, you're probably avoiding much bigger problems that you don't want to think about. Put something in place and move on. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Writing general code: real world example - and doubts!
by Zaxo (Archbishop) on Apr 05, 2005 at 02:57 UTC | |
by polettix (Vicar) on Apr 05, 2005 at 08:52 UTC | |
by Zaxo (Archbishop) on Apr 05, 2005 at 09:09 UTC | |
|
Re^2: Writing general code: real world example - and doubts!
by polettix (Vicar) on Apr 05, 2005 at 08:45 UTC |