Boost logo

Boost :

From: Paul A. Bristow (boost_at_[hidden])
Date: 2002-04-09 04:26:02


> -----Original Message-----
> From: boost-admin_at_[hidden] [mailto:boost-admin_at_[hidden]]On
> Behalf Of Mattias Flodin
> Sent: Tuesday, April 09, 2002 8:59 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] Proposal: Logging library

> > Please not that ugly format string again! Streams was invented to get
> > out of this cryptic, type-unsafe and processor-time-consuming feature,
> > so why not just to:
> >
> > log << log_debug << log_errno() << " config file not found";
>
> Which is more readable?
>
> cout << "CPU " << cpu_number << " (mem" << free_mem << "): multiply " <<
> rows << " X " << cols << " matrix, mode = " << "'" <<
> transpose_mode <<
> "'" << endl;
>
> versus
>
> printf("CPU %d (mem %d): multiply %d X %d matrix, mode = '%c'\n",
> cpu_number, free_mem, rows, cols, transpose_mode);
>
> Personally, I think the latter.

But that's because it is more familiar ?

I MUCH prefer the latter (not having learnt C before C++, and never having
used a printf statement yet!).

Isn't the virtue of PRINTUSING is that the format can be reused by several
statements? The saving of space was rather useful when one only had an 8k
machine. And that it is a 'picture' -like layout device (drawn from COBOL
and PL/1 rather than FORTRAN).

We DO need a PICTURE formatting device like that, but nobody has produced
one yet.

Paul


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