Have you ever wondered why toUpperCase and toLowerCase were deprecated in Kotlin? The original reason was Turkey.

You see, depending on location, uppercase or lowercase of some letters might differ. Uppercase of i in English is I, but in Turkey it is İ (notice the dot). As minor as it might look like, it might make a serious difference.

Since toUpperCase was under the hood toUpperCase(Locale.getDefault()), the same code might work differently on machines located in different countries.

To fix it, Kotlin creators wanted to change actual implementation to toUpperCase(Locale.ROOT), but for backwards compatibility, they renamed the method to uppercase. The same happened with lowercase.

BDW, it was a missed occasion to name this function UPPERCASE instead of uppercase. It would break standards, but at least it would be a truly self-descriptive function.

This Tweet was inspired by the talk Why we can't have nice things in Kotlin by Vsevolod Tolstopyatov
https://lnkd.in/dnKnaKCk