On 7/30/12, bearophile <bearophileh...@lycos.com> wrote: > Because sorting numbers as > strings is a very good source of bugs.
Thinking about this, pretty much any interpretation of strings is a very good source of bugs. I've been thinking how e.g. path manipulation might better be done with tokenization. For example if you build two paths it's easier to compare them if internally they're stored as tokens: Path path1 = Path("c:/foo/bar"); Path path2 = Path(r"C:/foo/bar/doo/../"); assert(path1 == path2); When you deal with naked strings you have to normalize the paths somehow before doing comparisons. But I haven't seen any libraries which use tokenization for paths.. maybe some exist out there..