Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2001-12-20 10:07:54


----- Original Message -----
From: "Ross Smith" <r-smith_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, December 20, 2001 1:16 AM
Subject: Re: [boost] sockets library

> Rainer Deyke wrote:
> >
> > From: "Ross Smith" <r-smith_at_[hidden]>
> >
> > > I'm convinced that iostreams should be reserved strictly for human
> > > readable text I/O, and not used for computer-to-computer
communication,
> > > such as sockets.
> >
> > Right now I'm using my own binary serialization layer on top of
iostreams.
> > This allows me to read and write binary files. Why should I need to
change
> > my code if I want to read from / write to sockets instead?
>
> Because that's a ridiculously inefficient way of doing binary I/O, and
> some of us don't want to be forced to pay the penalty merely because
> other people consider it acceptable.

The only real alternative is to build on top of 'streambuf', which is part
of the same system (i.e. if sockets provide streambufs, I can easily
construct iostreams on top of them).

> Iostreams are a disaster area; they violate the "you don't pay for what
> you don't use" rule right left and centre. Let's not throw good code
> after bad, please.

Much as I dislike the iostream design, it is the standard way of doing
streaming i/o under C++.

--
Rainer Deyke (root_at_[hidden])
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

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