• tunetardis
    link
    fedilink
    English
    arrow-up
    1
    ·
    18 days ago

    Oh, so you’re talking about text representation in an editor or something along those lines? That’s kind of a separate problem isn’t it?

    At the lowest level though, I suppose you still need to consider whether to use null-terminated segments. I think I’d still be going length + data, though I wouldn’t worry about packing down the length representation like with serialization formats. Your code will need to be highly cognizant of the length of strings and managing dynamic memory allocation all over the place, so it’s good to have those lengths quickly accessible at all times.