On Sat, Mar 15, 2008 at 1:18 PM, Dominic Watson
<[EMAIL PROTECTED]> wrote:
....
> There are times when slimmer code makes less readable code but the
> inverse can also be true. I think that the extra local variable is more
> confusing than clarifying.
Maybe that was a lame example, however the idea itself (delineating
between sanitized, and unsanitary user-entered variables) has merit.
I honestly haven't done it much, and the thing Dave linked me to
suggested a simple prefix, vs "clean" and "unclean", but it just sorta
seems like one of those ideas that might save your butt, in one of
those coding till 3am, blurry-eyed deadline-racing situations.
The concept could help prevent trained-monkey-coder mistakes too, conceivably.
I don't doubt it would make more sense applied to something dealing
with a lot of user-entered values, vs. a single string...
As far as clean = unclean, and English, it might have "looked" better like this:
cleanString = rereplace(uncleanString,'[-]+','-','all');
assigning the value with that final cleansing, so to speak (as it's
not so shocking an assignment, spoken-word-wise).
However, with the way it is, the point where unclean becomes clean
really jumps out at you, neh? :]
I'm reminded of a blog post about java, and the kingdom of nouns...
"language" is one of the more interesting bits of programming!
That said, I don't really practice this "sanitary" best practice. I
like stuff short, to the point of doing "var a = arguments"--I think
the actual variable is more important than the scope,
readability-wise... I have to fight that urge to write Perl-ish-ly
(hey, look what I can do with one line of code! ;), and whatnot, so...
eh. [:
Dunno. Maybe the reward isn't worth the effort. YMMV, etc..--
just threw it in there for kicks, really.
"Real Men don't Eat Quiche" :-)
-Denny
--
http://www.pbm.com/~lindahl/mel.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301375
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4