Skip to content

Comment on Never create Ruby strings longer than 23 charactersparent

Comments

Look up a C++ string implementation sometime, and you'll find that this is almost exactly how most efficient C++ string implementations do this too.

And it doesn't need to alternate between length specified or null terminated - they're all length specified (or how do you think short Ruby strings are also able to store ASCII NUL)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.