Re:The Most Expensive One-byte Mistake (2011)
by hyperliner on Monday September 29, 2014 @06:32PM
(#8385716)
Bingo: "Length + data strings have various disadvantages. For one thing, how wide should be the length? Two bytes? Four? Eight? "
[ Parent
| on HN ]
Re:The Most Expensive One-byte Mistake (2011)
by andreasvc on Monday September 29, 2014 @06:36PM
(#8385731)
That's easy, it should be of type size_t. Yes that is wasteful for short strings, but then again I believe null-terminated strings are the most widespread and worst case of premature optimization, and correctness & safety should take precedence.