Hacker News new | past | comments | ask | show | jobs | submit login

> That said, 99% time when doing upper- or lowercase operation you're interested just in the 7-bit ASCII range of characters.

I think it's more the exact opposite.

The only times I'm dealing with 7-bit ASCII is for internal identifiers like variable names or API endpoints. Which is a lot of the time, but I can't ever think of when I've needed my code to change their case. It might literally be never.

On the other hand, needing to switch between upper, lower, and title case happens all the time, always with people's names and article titles and product names and whatnot. Which are never in ASCII because this isn't 1990.




> Which are never in ASCII because this isn't 1990.

This is a very silly statement. I'm willing to believe that you have lots of cases where those things are outside the ASCII range. Perhaps even most of the cases, depending on where you live. But I do not believe for one second that it never happens.


Never stored in ASCII, never limited to ASCII. They're UTF-8, usually.

If somebody's name happens to fit into ASCII that's irrelevant because it's not guaranteed, so you can never blindly do an ASCII case conversion.

For text data meant for users, I literally cannot remember the last time I used a string in ASCII format as opposed to UTF-8 (or UTF-16 in JS). It's certainly over a decade ago.

So yes, when I say never, I literally mean never. Nothing "very silly" about it, sorry.

(Again, excepting identifiers, where case conversion is not generally applicable.)


And you could argue that if the internal identifiers need to be capitalized or lower-cased, you've already lost.

On an enterprise app these little string manipulations are a drop in the bucket. In a game they might not be. Sort that stuff out at compile time, or commit time.


You can't always control the case you get but often you can not care about anything outside ASCII. Scripts and configuration or text-based data formats are common examples.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: