Hacker News new | ask | show | jobs
by kccqzy 16 days ago
It’s unclear whether you are talking about the ergonomics of dealing with strings, the flexibility of using encodings other than UTF-8, or whether you mean human-oriented or computer-protocol-oriented string handling. It’s also unclear whether you are talking about using the standard library only or if you include other ubiquitous libraries like ICU.
1 comments

I was considering standard library here. That said, of the languages I worked in, C/C++ is the most annoying to add additional dependencies in.

I will concede that most languages lack support for anything except ASCII and Unicode these days (usually just UTF8 and UTF16), but legacy encodings are mostly pointless these days. I would argue you should if possible reject them, or if you have to handle them: convert on ingress/egress and use UTF8 internally.

As for your first question I was considering general string handling, how painful is it to do the sort of things I typically end up doing with strings: concatenating, stripping leading / trailing whitespace, finding substrings, splitting on lines or other delimiters, splitting after a specific substring, checking if a string is a prefix/suffix of another, search and replace, etc. What exactly people do will differ from person to person, but I would think these are not uncommon operations. And here traditional C and C++ are really unpleasant (again things have improved a bit in modern C++ but still not great).