|
Boost : |
From: Michael P. Wilson (mpwilson_at_[hidden])
Date: 2001-12-21 09:59:13
$.02
Yeah, but be careful. You could write the pluggable filter hierarchy
(complete with "readers", "writers", filters, and buffering classes) in
about 400 lines of C++ code that, when inlined, would scream. Then
you'd have the best of both worlds.
Add a couple adaptive functors and you could use them with iostreams and
sockets at will. We've done this over at LV and it works great. Best
of all worlds, very little code, and it's pretty tight. Now we can play
all those Alexandrescu-esque policy games because the code's nice and
granular.
Yummie Good Stuff
- M
Thursday, December 20, 2001, 3:06:34 PM, you wrote:
>> Seriously, though, even if you consider iostreams to be a bad design,
>> the Java streams are MUCH worse (at least from a C++ design
>> perspective). They are a huge pain to use and result in even more
>> overhead than iostreams.
JK> It's true that there is no single big fat stream class which would be
JK> immediately there to use, but filter design of Java io is more flexible,
JK> efficient and definitely better than iostreams. Using output of one stream as in
JK> input to another is a very powerful concept. You should not underestimate the
JK> powers of the dark side.
JK> Regards,
JK> Jani Kajala
JK> ----- Original Message -----
JK> From: "bill_kempf" <williamkempf_at_[hidden]>
JK> To: <boost_at_[hidden]>
JK> Sent: Thursday, December 20, 2001 6:28 PM
JK> Subject: [boost] Re: sockets library
>> --- In boost_at_y..., "Andrei Alexandrescu" <andrewalex_at_h...> wrote:
>> > From: "mfdylan" <dylan_at_m...>
>> > > > Besides, many people have never been very fond of iostreams'
>> > > design...
>> > > >
>> > > From what perspective? Certainly I've found that deriving a
>> > > streambuf class is unnecessarily messy. But in general it works
>> > > better than I/O in most other languages.
>> >
>> > An author of a very thick book on iostreams confessed about not
>> liking
>> > iostreams and preferring Java's streams.
>>
>> The author must have been smoking something ;).
>>
>> Seriously, though, even if you consider iostreams to be a bad design,
>> the Java streams are MUCH worse (at least from a C++ design
>> perspective). They are a huge pain to use and result in even more
>> overhead than iostreams.
>>
>> I don't consider C++ streams to be poorly designed, but there are
>> definate areas that need improvement or simply need to be covered.
>> For instance, locales are much more difficult to use then they should
>> be, and there's little portability in their use (for instance there's
>> no standardized IDs for given locales, so even if two platforms can
>> represent all the locales you need you can't write portable code for
>> constructing the specific locales). Some facets are remarkably
>> missing (for instance you can stream a date out, but you can't read
>> it back in... and this would be a GREAT facet for some aspiring
>> Booster to work on). I also find it vexing that there's no support
>> for binary output. I think a binary_stream heirarchy would be a
>> wonderful thing for Boost to address as well (however, it should be
>> designed on it's own, not "hacked" in because Boost.Sockets or some
>> other library needed it... this is too important to design with such
>> a narrow view). Speed is a bit of a concern with streams, but the
>> extensibility is too great to make this very relevant to me (though
>> it would be very nice to see faster implementations).
>>
>> In other words, they are far from perfect, but they are much better
>> than any known alternatives.
>>
>> Bill Kempf
>>
>>
>> Info: http://www.boost.org Send unsubscribe requests to:
JK> <mailto:boost-unsubscribe_at_[hidden]>
>>
>> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk