3 ms·
Having locales by itself makes sense, you after all want to map real world information into the digital realm and for that to work you have to stick with whatev
by grumbel 5y ago
Having locales by itself makes sense, you after all want to map real world information into the digital realm and for that to work you have to stick with whatever real world conventions are already established. Keep in mind that computers are often just used as better typewriters and a lot of information exchange still happens on paper. Moving from paper to fully digital is a process that takes decades, so you can't just decide that digital uses '.' instead of ',' as all your printouts will be wrong.
The part that doesn't make sense in C and other languages is that locales are forced on you as global state. And not just by default, they don't even provide locale-free alternatives, you have to modify the global state and reset it after every use, which is cumbersome, slow and error prone. C++ added the locale-free `std::to_chars()`, so things are slightly improving at least, but it's still an ugly and largely unnecessary mess.