Re: Null-terminated strings: the final analysis.




"Bartc" <bartc@xxxxxxxxxx> wrote in message
news:CFusl.4007$Lc7.1359@xxxxxxxxxxxxxxxxxxxxxxxxxxxx

"Tony" <tony@xxxxxx> wrote in message
news:vsnsl.13862$W06.5350@xxxxxxxxxxxxxxxxxxxxxxx
Null terminated strings are premature optimization when considered in
modern times. Null-terminated strings are baggage and C suffers from
holding on to this obsolete implementation. (No question here, just
wondering now why a computer programming language should age like a
person?). Comments welcome of course.

This was discussed here recently, quite extensively too.

And they are not just a C thing, they were and are used ubiqitously
elsewhere, very successfully.

Your alternatives I recall would not fit easily into the low-level C
model.

"easily" is a subjective term, so your thought needs qualification to be
understood. I have a R&D design where a one-character string is one byte
(read no overhead), small (Pascal) strings have one byte of overhead (the
length) and larger size strings have a few bytes more (but so what? they're
larger strings!). The usage though is via one abstraction.

As criteria for string implementation analysis, I see: space efficiency,
time efficiency, practical usage (usage patterns are much different now than
then and the std implementation may be/may have impeding/impeded progress),
_maybe_ "one technique to cover all string types" (like literals, e.g.),
character set requirement (Unicode highly overrated IMO), and some decidedly
not that important issues.

Tony


.



Relevant Pages

  • Re: Null-terminated strings: the final analysis.
    ... modern times. ... Null-terminated strings are baggage and C suffers from ... holding on to this obsolete implementation. ... The usage though is via one abstraction. ...
    (comp.lang.c)
  • Re: D7 Compiler Bug
    ... Such considerations already appeared in COBOL, with the USAGE COMPUTATIONAL vs. ... strings for file I/O, and have records, or better objects, with dynamic strings ... directory part in every file name eat up too much memory. ... don't have to separate and merge the directory parts at all, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Whats the meaning of egin{table*}
    ... I try to find information about table*, but this forum seems unable for ... us to find strings with * attached. ... I am confused with the usage of \beginand \begin. ... UKTUG FAQ: ...
    (comp.text.tex)
  • Re: Null-terminated strings: the final analysis.
    ... The usage though is via one abstraction. ... FYI byte-counted strings aren't new and predate pascal - ... BIT VARYING) years earlier, and classic BASIC had varying ...
    (comp.lang.c)
  • More newbie questions
    ... (newbie question thread consolidation thread) ... see us maximize the usage of the collections framework whenever possible. ... I have an ArrayList of Strings. ... ArrayLists or TreeSets of Strings. ...
    (comp.lang.java.programmer)