Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!uunet!mcvax!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: comp.lang.c Subject: Re: strings Message-ID: <326.nlhp3@oracle.nl> Date: 16 May 89 08:28:47 GMT References: <10250@socslgw.csl.sony.JUNET> Reply-To: bengsig@oracle.nl (Bjorn Engsig) Organization: ORACLE Europe, The Netherlands Lines: 32 In some article, Doug Gwyn wrote that \0 terminated strings and strings with associated length both have advantages and disadvanteges. He also wrote >>If you want counted strings, C makes it relatively easy to provide >>them for yourself. In article <10250@socslgw.csl.sony.JUNET> diamond@csl.sony.co.jp.csl.sony.co.jp (Norman Diamond) writes: > >Yes. You throw away the C library (which I understand is part of the >proposed ANSI standard) and the language's definition of how strings >are represented, you define your own representation of strings, and >you implement your own library. [deletions] > Now come on, why should you not write your own handling of something (e.g. strings) if this can speed up your program. You would still do it in ANSI C; if you provide an interface to the outside world, you would either tell others about your interface or convert to the 'normal' representation, this is no big deal. >Good luck porting other people's strictly conforming programs though. >They might use C strings. So what? This is what your ANSI C compiler knows about. > >Good luck persuading someone else to port your programs. Well, our software is ported to very many Unix and non-Unix platforms, and we do a lot of speed improvements using our own internal representatino of various types of variables. In the very rare (measured in CPU cycles) cases, where we interface to the outside world, we convert between internal and external representation. -- Bjorn Engsig, ORACLE Europe \ / "Hofstadter's Law: It always takes Path: mcvax!orcenl!bengsig X longer than you expect, even if you Domain: bengsig@oracle.nl / \ take into account Hofstadter's Law"