News for hackers. Stuff that matters.
Re:Switching to C over 'Modern' Programming Languages by flohofwoe on Friday April 14, 2023 @03:29AM (#35566554)
I don't even know where to start with C++ stdlib string problems, but being mutable and doing a unique heap allocation (above a certain length) are definitely at the top of the list.

std::string_view would have been a good thing if it hadn't added another memory corruption foot gun.

A general string type is one of those things where you can either have convenience or performance, but never both.

Re:Switching to C over 'Modern' Programming Languages by pjmlp on Friday April 14, 2023 @04:56AM (#35567139)
They are still better than str...() and mem...() all over the place, and all relevant C++ compilers have options to turn bounds checking on.