News for hackers. Stuff that matters.
Re:Ask HN: What Happened to Borland? by nwiswell on Friday December 10, 2021 @02:03PM (#29514036)
Obviously C-style strings can still remain an option where they are needed, but in most cases using the 4 bytes for a length field is a sane default. How many buffer overflow attacks have been enabled by that four byte savings over the years?

> "Sane" strings that discourage the developer from just coming up with a simple memory management scheme that fits the situation at hand.

"Sane" compilers that discourage the developer from considering the machine level instructions. It's turtles all the way down.

There's a reason that Python is so popular and it's not performance

Re:Ask HN: What Happened to Borland? by jstimpfle on Friday December 10, 2021 @03:18PM (#29514982)
This is not Python so that's a strawman.
Re:Ask HN: What Happened to Borland? by nwiswell on Friday December 10, 2021 @03:55PM (#29515351)
By that I meant that there is obviously value in abstracting away tasks and details that the programmer would otherwise need to manage. That is why compilers exist. The value-add for abstracting a string is certainly more than the cost of 4 bytes of memory in the typical case.

Put another way: optimizing the management of strings in memory is almost never the best use of time to make progress toward an organization's objectives, and doubly so when that kind of micro-tuning can actually introduce security risks