String Fanaticism

gillies at uiucdcsp.cs.uiuc.edu gillies at uiucdcsp.cs.uiuc.edu
Fri Apr 15 01:33:00 AEST 1988


This comment is probably a little bit late, but I'm disgusted by the
number of string functions in XJ311 (as described in Harbison &
Steele, 2nd edition).  There are 18 functions of the form "strMUMBLE"
in the standard.  This seems absurd to me.

When I worked for Xerox, we had no less than three separate
implementations (representations) for strings, and PARC had a 4th type
(Ropes).  We had C-type strings [completely defunct], something called
XStrings, and also NSStrings.  The latter two string packages supported
internationalization, multi-byte characters, and length counters.

I believe that in ten years, when we throw all our mainframes and
glass TTYs out (except for the compute servers), the XJ311 designers
will stand with egg on their face.  Their strings will be completely
defunct on technical (international/WYSWYG) workstations.  These
machines will probably allow two-byte characters, and for reasons of
efficiency and functionality, all clients will reimplement C strings.
The efforts of compiler vendors will go to waste.

Given a choice, I'd make STRSPN, STRCSPN, STRPBRK, STRRPBRK, STRTOK,
and STRSTR bite the dust.  C has switch statements and pointers in the
language to accomplish these things efficiently.  Most future clients,
for reasons of efficiency or functionality, will throw out these
functions anyway.  That would cut this mountain (18) of functions down
to a merge tidal wave (12).

Don Gillies {ihnp4!uiucdcs!gillies} U of Illinois
            {gillies at p.cs.uiuc.edu}



More information about the Comp.lang.c mailing list