Group: comp.lang.c++
From: Jerry Coffin
Date: Sunday, April 13, 2008 11:37 AM
Subject: Re: Help add commas to int on console output

In article b7fba863ae9c@c65g2000hsa.googlegroups.com>, james.kanze@gmail.com
says...
> On 13 avr, 03:52, Jerry Coffin wrote:

[ ... ]

> > By itself, no -- except that doing so would have reopened the
> > whole subject of locales, and I can hardly imagine a way to
> > even discuss them without leaving somebody (usually quite a
> > few somebodys) quite rightly feeling that their needs are
> > being slighted or ignored completely.
>
> Yes. You're certainly right about that. I guess my real
> question is more along the lines of why they even used string to
> begin with, given that the abstraction behind the char* in C
> wasn't a string.

Right -- and I honestly doubt anybody really knows the answer to that
anymore. Even the people who designed have probably lost conscious
memory of it (though their spouses might be able to tell us about times
they wake up in a cold sweat without an explanation...)

[ ... ]

> Globally, given the context, I think that the C committee did a
> pretty good job. (The context was that the ANSI C committee was
> ready to adopt the standard without any i18n support, and
> someone from ISO mentionned that ISO would have to add it
> anyway, thus making ISO C different from ANSI C. So the
> committee went back and added all of the original i18n support
> in a year, so that ISO C could be ANSI C.) I'm a lot less
> enthousiastic about the C++ locales, although it does recognize
> one thing missing in C, that you need a stream specific locale.
> But the entire header seems to be designed to be
> difficult to understand and to use.

I think it tends to show some of the shortcomings of OOP in general --
it went along with the idea that you'd just derive a new class, override
a function or two, and be on your way.

In a way, they even did reasonably well: ignoring the overhead of a
class header and such, you can often create and use a facet (for
example) in half dozen lines of code or so. The problem, of course, is
that you need to read and understand hundreds of pages of dense
documentation before you figure out how to write those half dozen lines
of code -- and even then, I think most who do it have just worked out a
template that works, and modify a few specific parts to do what we want;
real understanding of the whole mechanism is relatively rare.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Safety Articles | Usenet Groups | Usenet News | Bluegrass