I don't think I've ever encountered a common practical programming situation where I wanted null-termination as the convention for strings.
I would argue no, you never put the length in the first N bytes. It should be separate. I think this is better.
-
-
I think it's likely better both in terms of flexibility _and_ performance.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yes, not even a discussion. Otherwise you can't slice strings.
-
With null termination, you can slice suffixes. But with separate length, you can slice any substring.
- Show replies
New conversation -
-
-
At runtime it's useful to have them together so it's a single pointer. In files - sure, do whatever.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.