For instance, RFC 1945 (HTTP 1.0) specifies three acceptable date formats. Add ISO dates, and now you're writing software that needs to handle 4 different formats. Easier to just use a heuristic parser that's capable of accepting HTTP, email, Usenet, and ISO timestamps.
Fortunately, these days it's generally considered a bad idea to use anything but ISO timestamps, with the exception of a former colleague who tried arguing that DD/MM/YYYY was an acceptable format to be transmitting and storing dates in.
Parsing floating point values correctly is not a trivial amount of work - to the extent that there have any been security vulnerabilities in implementations.
That is, if I do this
float f = 123.456;
Console.WriteLine(“value is “+f);
The output shouldn’t vary depending on whether it’s run in France or the US (which it does by default).For parsing, the argument should even be explicitly required I think. So
float f = Float.Parse(“1,23”, frenchLocale);
So that it’s not ever forgotten or the reader has to wonder if the author forgot it.Otherwise I agree with you whole heartedly - I have been stung by absurd locale dependent behaviour in the past (windows’ font loading APIs inexplicably translate the font variant in the programmatic api)
Same with dates. Don't try lots of formats on an arbitrary string, force the user to specify the expected format somehow.