strings

Bjorn Engsig bengsig at oracle.nl
Tue May 16 18:28:47 AEST 1989


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 at socslgw.csl.sony.JUNET> diamond at 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 at oracle.nl           / \     take into account Hofstadter's Law"



More information about the Comp.lang.c mailing list