[Effective-cpp] Item 2: The String Formatters of Manor Farm, Part 1: sprintf

White Wolf wolof at freemail.hu
Sun Oct 31 08:51:04 EST 2004


Paul wrote:
>> Also, I don't think it
>> is really relevant to the discussion as it is non-standard
>> (hmmm...that kinds counts boost::lexical_cast out too, but at least
>> it works on
> multiple
>> platforms).
> 
> This is an accu/C++ duscussion, not c.s.c++. IMHO we shall
> talk about what is good to use and what is bad -- standard
> has some edge but something
> getting in doesn't mean it is good too.   Especially
> std::string  looks more
> like a monster.
> Though string discussion is really beyond thos thread -- we
> can take it to clcm.

While this is all true, CString is absolutely MS specific, and therefore no
use for many programmers (including myself).  So while it is worth to
mention that it exists for the Windows platform, I do not think it belongs
to the same discussion where boost and the standard library is mentioned.
First of all it may confuse people (who do not have it or have it and they
do not know it is non-portable).  Then in additoon I have read once a very
nice article from a well-known name (which I am sorry I cannot recall) about
why CString is plain bad C++ design (along with most of MFC).  Which may be
convenient at times, but it is rather Java (Smalltalk) than C++.  All that
said, std::string is a monster in itself, but that is a monster due to
existing practice/lazyness (called compatibility by the politically correct)
rather than bad fundamentally wrong desing ideas (cosmic hierarchies etc.).

To cover it from another angle: we could discuss here Qt strings, old
RogueWave strings and many more - which would also be inappropriate, unless
we point out (which, I am sorry, I could not see in your mail) what design
decisions are good/to be followed/convenient etc. in their design - IOW
their merits.

Or IOW again: I will not port MFC to Solaris or Linux (or buy its port
either for that matter) to use CString.  And I also get pimples when I see
class names starting with C...  Sorry, I just think that Hungarian notation
brought more shame on Hungarians than (m)any politicians and two lost World
Wars...  But that is really getting off topic. :-)

Attila aka WW





More information about the Effective-cpp mailing list