Re:Making Wrong Code Look Wrong
by tedunangst on Monday August 22, 2011 @10:59PM
(#2915147)
You're allowed to use prefixes longer than just one letter.
[ Parent
| on HN ]
Except now the combinatorial explosion gets even worse. How do you prefix a b64 blob which has been SQL-escaped, urlencoded and htmlencoded? `urlhtmlsqlb64String`?
It seems like 'combinatorial explosion' might not be the right phrase here. There is a combinatorial explosion of possible prefixes, but, since you're not going to search the possible-prefix space, it doesn't really matter. (For example, there is a combinatorial explosion of unprefixed variable names, and nobody's bothered by that!) The question is whether you can decode a given prefix, and, even in your example, that's easy. (Prefix ambiguities could easily be resolved with underscores, like url_html_sql_b64_string.)
I'm not arguing for this convention (I don't much like it myself); but I don't think your argument is a very strong point against it.
EDIT: Oops, sorry, I just noticed that it wasn't you who brought up the explosion in the first place.
Re:Making Wrong Code Look Wrong
by tedunangst on Tuesday August 23, 2011 @07:51AM
(#2916200)
uh, why would you have one of those except to crap on the idea? have you ever had a sql and html escaped string?