3 ms·
I'd be happy if developers did that, but they don't: So many C developer seem to think they're "smart enough" to handle strings correctly using only the standa
by Pesthuf 2y ago
I'd be happy if developers did that, but they don't:
So many C developer seem to think they're "smart enough" to handle strings correctly using only the standard library, not needing "training wheels" like the plebs - but then where do the countless string related memory safety errors and all the broken Unicode handling come from that plague every C program, no matter how clever the programmers, no matter how tough the review process, no matter how much static analysis is used?
The issue is that many C developers simply can't seem to admit that C string handling, as it was invented many decades ago, was simply fundamentally flawed. So easy to misuse with catastrophic results, even for plain 1-byte-strings.
It has nothing to do with how "smart" you are or how careful you are.
- johnnyanmac 2y agoAre there really people defending string manipulation in C? C is a slight abstraction on top of assembly. Assembly speaks in addresses and bytes. It's always been bad at trying to interpret human text because Assembly's job lies in the digital realm. I think it's more a case that programming is English skewed and localization concerns are rare for the programmers these day who still need to work in the realm of C (so, mostly for older legacy software or the embedded realm).
- Pesthuf 2y agoIt doesn't matter if anyone is defending it - C developers still use C strings and the broken C standard library's string functions (exclusively) rather than using one of the many good string libraries they have available. The result is that the same mistakes with string handling get repeated again and again, often with catastrophic results.
- johnnyanmac 2y agoDevelopers do a lot of unoptimal things for unoptimal reasons. Ultimately what's "right" or "wrong" is a case by case basis. So I don't see much point in venting against those developers without knowing their circumstance. I mostly ask who's defending it for holistic purposes. Right or wrong, It would be nice to hear other perspectives on the matter if possible.
- bluGill 2y agoSmart is not the issue. I'm smart enough, but I'm lazy and forgetful. C makes it really accidentaly once in a while.