What's type of strings do you think is best? Why?
(related: https://www.joelonsoftware.com/2001/12/11/back-to-basics/)
[ ] C style (null terminated)
[ ] Pascal (length prefixed)
[ ] Rust (length metadata)
[ ] Other (reply w/ details!)
What's type of strings do you think is best? Why?
(related: https://www.joelonsoftware.com/2001/12/11/back-to-basics/)
[ ] C style (null terminated)
[ ] Pascal (length prefixed)
[ ] Rust (length metadata)
[ ] Other (reply w/ details!)
@codesections I'm honestly torn, but Pascal style is also SQL style, and it does have distinct advantages over null terminated.
It allows optimizations and checks that null terminated doesn't, and also allows you to prevent string buffer overflows by the simple expedient of *stopping the read when you hit the length of the buffer*.
@codesections hmm, what about the 9 string varieties in Ada? Fixed, bounded, and unbounded versions of character, wide, and wide_wide. Right tool available for the right job
Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.
All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.