3 ms·
How is that a good thing? There are ways of abstracting/handling strings that are strictly safer than other ways. In an unsafe language like C, you're inviting
by cliffy 8y ago
How is that a good thing? There are ways of abstracting/handling strings that are strictly safer than other ways. In an unsafe language like C, you're inviting problems by trying to do things in your own idiosyncratic way.
- jstimpfle 8y agoSometimes performance or flexibility are important concerns. But feel free to manage millions of small strings with std::string or even as GC'ed objects :). And incur the overhead of indirection when attaching bounded-size strings to other data.
- coldtea 8y agoRust manages to do it just fine...
- jstimpfle 8y agoHow?
- adrianN 8y agoDefaults are important. C++ provides a much safer string type as default and let's programmers do their own thing in case it doesn't work for their use case (I'd try providing a different allocator before writing a different string type tbh). C on the other hand doesn't really provide a string type at all and forces everyone to start by writing a string library if they don't want to hunt buffer overflows until hell freezes over.
- deleted 8y ago[deleted]
- pjmlp 8y agoApparently IBM and Unisys mainframe systems programming languages did just fine.