Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!rutgers!iuvax!pur-ee!uiucdcs!uiucdcsp!gillies From: gillies@uiucdcsp.cs.uiuc.edu Newsgroups: comp.lang.c Subject: String Fanaticism Message-ID: <77200033@uiucdcsp> Date: 14 Apr 88 15:33:00 GMT Lines: 29 Nf-ID: #N:uiucdcsp:77200033:000:1510 Nf-From: uiucdcsp.cs.uiuc.edu!gillies Apr 14 09:33:00 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@p.cs.uiuc.edu}