Argh! Has nobody but you figured this stuff out? I did see a clever technique from Kamkinsky (http://intoverflow.wordpress.com/2010...) where he tries to maximize the difference between the string and escaped string so that any lapses in escaping become immediately obvious, but that's only useful for database escaping, I think.
- Amit Patel
That intoverflow post is interesting. The bit where he says "we still need to address the fact that we’re abusing the String type" is exactly what I've been thinking for years. Though he goes on to say that "User-input should be its own distinct type". While I think that's potentially useful, I think that kind of solves the 10% problem rather than the 90% problem. The more fundamental problem is that HTML and CSS and JavaScript and SQL and plaintext are not all the same type of thing even though we use a single type to represent all of them: string.
- Laurence Gonsalves
We put lots of differently-typed stuff into string, just as we put kilometers and hours into float. :-(
- Amit Patel