Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-01-30 03:55:48


> > I'm sorry:
> >
> > Let's see:
> >
> > - Java String - one meaning text, UTF-16 encoded
>
> Nope, in Java a String is a data type that derives from Object which
> stores an immutable sequence of 16-bit characters. Not necessarily
> *text*, and it just so happens that it chooses the UTF-16 encoding.
> AFAIK you can still stuff arbitrary bytes when constructing a String
> object -- try reading from a binary file and see what I mean.

http://download.oracle.com/javase/6/docs/api/java/lang/String.html

Some methods:

- toLowerCase()
- toUpperCase()
- trim();
- equalsIgnoreCase();

They don't have any sense for non-text storage.

The fact you can fill it with garbage does
not change the fact it is text oriented storage

>
> > - C# string - one meaning text, UTF-16 encoded
>
> Sequence of UTF-16 characters. Not sure if it's immutable.

http://msdn.microsoft.com/en-us/library/system.string.aspx

Some methods:

- IsNormalized()
- Normalize()
- ToLower()
- ToUpper()

etc.

They don't have any sense for non-text storage.

The fact you can fill it with garbage does
not change the fact it is text oriented storage

>
> > - C++/GTKmm ustring - one meaning text, UTF-8 encoded
>
> Sequence of characters, just so happens to be UTF-8 encoded.
>

http://library.gnome.org/devel/glibmm/unstable/classGlib_1_1ustring.html

Some member functions:

- collate_key()
- normalize()
- uppercase()
- lowercase()
- casefold()

They don't have any sense for non-text storage.

The fact you can fill it with garbage does
not change the fact it is text oriented storage

-------------------------------------------

As you probably understand
same for QString, wxString and others.

>
> No, maybe *you* say string when TEXT is what you mean.bytes*.
>

No I mean that when you say "String" you mean "Text" and not
only me but all language developers around who developed
so many tools for string/text provessing.

It is not accident that String means Text in CS context.

You may not agree or say English is wrong or Translation
is Wrong - but the fact remains:

   String is Text Storage in most common CS context.

If you still not sure about it make a poll and ask you colleges
what string means for them - sequence of objects or text.

Artyom

      


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk