Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-20 18:02:49


----- Original Message -----
From: "Beman Dawes" <bdawes_at_[hidden]>
To: <boost_at_[hidden]>; <boost_at_[hidden]>
Sent: Sunday, January 20, 2002 5:13 PM
Subject: Re: [boost] Boost.Format review comments - [] vs %

> At 07:49 AM 1/20/2002, Samuel Krempp wrote:
>
> >Now that I think there is a better candidate than '%', I'll add some
> >arguments for 'operator[]' in the doc. but it's rather a matter of
> >taste, so I'm not sure I will be able to convince people with only a few
> >lines..
>
> I'm sorry. I just find:
>
> cout << format("writing %3, x=%1 : %2-th try") % 40.23 % 50 % "toto";
>
> to be a lot easier to write and read than:
>
> cout << format("writing %3, x=%1 : %2-th try") [40.23] [50] ["toto"];
>
> I have the sense that Ed's operator[] suggestion would solve some
technical
> problems, but it just plain looks too ugly to me.
>
> What do others think?

It's not so much a matter of ugliness for me. It's more tokens to process
visually, more typing, and more opportunities to get things wrong. Plus, by
the time I've typed the format string, my fingers already know where '%' is
;-)

-Dave

P.S. The argument for it being like array indexing took me about 5 minutes
to figure out. It's really a stretch, especially when you consider
non-integer arguments to operator[].


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