Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
SDS: Simple Dynamic Strings library for C
11–20 of 48 posts
Re: SDS: Simple Dynamic Strings library for C
#12Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
To actually answer your question (beyond the snark/appeal to authority replies you’ve already gotten), there are a couple good reasons: — You're working in embedded development (but somehow need a full-fledged dynamic string library). — While it's true that C++ is (almost) a strict superset of C, and “you don’t pay for what you don’t use” is a good rule of thumb, it can be very hard to restrict a team of developers t…
The situation isn't all that implausible: e.g., many ESP32-based devices want to work with strings to interface with HTTP servers, and they do have C++ support, but the size limit is small enough that you can easily bump your head into it if you aren't careful.
Re: SDS: Simple Dynamic Strings library for C
#13Earlier quoted context omitted.
To actually answer your question (beyond the snark/appeal to authority replies you’ve already gotten), there are a couple good reasons: — You're working in embedded development (but somehow need a full-fledged dynamic string library). — While it's true that C++ is (almost) a strict superset of C, and “you don’t pay for what you don’t use” is a good rule of thumb, it can be very hard to restrict a team of developers t…
> You're working in embedded development (but somehow need a full-fledged dynamic string library). The situation isn't all that implausible: e.g., many ESP32-based devices want to work with strings to interface with HTTP servers, and they do have C++ support, but the size limit is small enough that you can easily bump your head into it if you aren't careful.
Re: SDS: Simple Dynamic Strings library for C
#14Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
(Also, as a comment to other responses: C++ is not a superset of C, it is a fork from 95 with divergent language evolution since then).
Re: SDS: Simple Dynamic Strings library for C
#15Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
Suggesting C++ as a solution in the face of "masochist obsession" is... an interesting choice :-D
Re: SDS: Simple Dynamic Strings library for C
#16Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
Re: SDS: Simple Dynamic Strings library for C
#17Re: SDS: Simple Dynamic Strings library for C
#18Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
Re: SDS: Simple Dynamic Strings library for C
#19Re: SDS: Simple Dynamic Strings library for C
#20Why not just use C++ strings and string_views? So weird to see this masochistic obsession some people have with doing everything in plain C. It's 2026, there are better, more memory safe, more efficient solutions out there.
To actually answer your question (beyond the snark/appeal to authority replies you’ve already gotten), there are a couple good reasons: — You're working in embedded development (but somehow need a full-fledged dynamic string library). — While it's true that C++ is (almost) a strict superset of C, and “you don’t pay for what you don’t use” is a good rule of thumb, it can be very hard to restrict a team of developers t…
Even this has a lot of "payment" for what you don't use. Even some C++ libraries forbid it just because of the size of debug symbols.