10 ms·
It wasn't really that reasonable as soon as it was made global. It's exactly the kind of assumption that mostly works but has dark corners from the beginning.
by ska 7y ago
It wasn't really that reasonable as soon as it was made global. It's exactly the kind of assumption that mostly works but has dark corners from the beginning.
Some imaginable version of locales was probably a good approach at the time, but that wasn't what got standardized.
- mark-r 7y agoI don't disagree, I've run into those dark corners myself. But the ease of use of globals is undeniable - there's a reason the Singleton pattern is still popular after all the ridicule it attracts.
- ska 7y agoSure, it's easy to use. But that isn't the job of standardization bodies, or the right test to use on something as low level as this. It's harder to get right, but it is exactly these sort of failures in standardization that cause the most global pain, because they wend their way through everything.
- mark-r 7y agoIn this case I don't think the locale functions were designed by committee, I think they were accepted as-is from a popular implementation. And they were implemented that way because it was the simplest most straight-forward way (I'll admit I'm just guessing now). Were they part of K&R C?
- slrz 7y agoNo, of course not.