Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-07-02 11:17:47

David Abrahams wrote:
> Since people seem to feel allegiance to the printf
> conventions,

Not me :). I don't like the idea of full-fledged support of printf format
directives at all; conversion characters (type indicators) are unsafe,
non-extensible and error-prone at best, they are not technically needed,
it's clearly not a C++ way of doing things, and including a support for them
is like bringing to life a dead person that most of the people prefer to see
dead :). Flags and precision specifications are type-dependent (and
therefore error-prone) too, and, personally, using the libraries that
require you to learn some fancy small "language" (even if it has managed to
become a standard one) have never been a pleasant experience. In some sense,
of course, iostream manipulators form a "fancy small language" too, but for
me there is a big difference between '-' and 'left' (or 'align_left').

Summarizing the above, my point is that while embedded positioning of the
arguments is clearly one of the main printf's strengths, embedded
formatting/type specifications seem much more like a weakness that is not
worth to be replicated ;).

> I am willing to sacrifice terseness and live with
> %1%, %2%, etc if there is no better alternative.
> I don't like it, but would live with it.

I don't like it either, and I would prefer the short form (%1, %2, etc.).
Finding a good syntax for specifying the formatting of arguments (not
embedded into format string) can be hard, though.


Boost list run by bdawes at, gregod at, cpdaniel at, john at