Re: Where is stringbuilder?



"Rob Kennedy" <me3@xxxxxxxxxxx> wrote in message
news:4pr1kqFk8t34U1@xxxxxxxxxxxxxxxxx
J French wrote:

What an odd idea
A string is just a block of memory

In Win32 Delphi, yes. In Java and .Net, no. In those, a string is an
object. If it had methods that could change its contents, then anything
that stored a reference to a string would be in danger of having that
string change later.

There is that. Plus, a string does not contain amorphous bytes but
*characters*. These may be two bytes in length. Or one-or-more bytes.
They may be encoded in US-ASCII, with high bits implicitly cleared
because they're not used anyway. Or in ISO-8859-1. Or ISO-8859-15,
or Windows-1252. Or KOI-8. UTF-8. UTF-7. EBCDIC.

If you want a block of memory, it seems to me that a dynamic array of
byte would be a choice less laden with semantic baggage.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: C++ vs Java "new" (no flame war please!)
    ... of such objects that would fit in available memory. ... memory and much more time than would the JVM for the equivalent Java ... The "allocation" ... If you have a small object with a string, ...
    (comp.lang.java)
  • Re: Container library (continued)
    ... You mean I can store an 8 character string in 4 bytes? ... > I'm not sure what you mean by a "Java heaps", but yes, server side Java ... > applications can require a lot of system memory. ... OF COURSE you can spend $$$ in another server, ...
    (comp.lang.c)
  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Discovering variable types...
    ... >- but I suppose MS expect us to use wrappers ... memory allocations for your variables from disk as well. ... >They most certainly are of fixed size, changing the size of a String ... >>me to keep buffer size and current postion right in the memory block. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Container library (continued)
    ... Your string class would output 12 or 24 in your sample code. ... > I'm not sure what you mean by a "Java heaps", but yes, server side Java ... > applications can require a lot of system memory. ... You are a very common Java programmer. ...
    (comp.lang.c)