> While writing and dealing with all that code I realized something: While > programmers are usually heavily conditioned to think of case-sensitivity as > an attribute of the comparison, it's very frequent that the deciding factor > in which comparison to use is *not* the comparison itself but *what* gets > compared. And in those cases, you have to use the awful strategy of "relying > on convention" to make sure you get it right in *every* place that > particular data gets compared.
You have a point. Your case-sensitivity-aware string types will guarantee correctness in a large and complex program. I like that. Ideally though, they would only be compile-time constraints (i.e. not carrying any other data). Perhaps it's possible to create such types? CaseSensitiveString, CaseInsensitiveString, and the standard string type being unspecified.