Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Mar 2002 10:21:53 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Nate Williams <nate@yogotech.com>
Cc:        Raymond Wiker <Raymond.Wiker@fast.no>, Giorgos Keramidas <keramida@ceid.upatras.gr>, "Steve B." <steveb99@earthlink.net>, freebsd-chat@FreeBSD.ORG
Subject:   Re: C vs C++
Message-ID:  <3C865E41.960B4E7@mindspring.com>
References:  <20020305132457.A4700-100000@alpha.yumyumyum.org> <001701c1c481$d0d5eab0$f642d9cf@DROID> <20020305231252.GC5328@hades.hell.gr> <3C8568E0.76415D99@mindspring.com> <20020306032029.GA7926@hades.hell.gr> <15494.13878.219807.949085@raw.grenland.fast.no> <15494.20631.682803.383406@caddis.yogotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams wrote:
> >         Anyway, I *really* can't see any reason not to use <iostream>,
> > <fstream>, <sstream> and friends.
> 
> The fact that the programmer has no control over *how* the data is
> displayed, and relies on the person who wrote the class to display the
> data is one good reason.

Not to mention that the libraries to which you link are
most likely written in C, and will use the conflicting
stdio paradigm.

Personally, I avoid stream I/O.  Java's reliance on stream
I/O is one of its worst attributes, IMO.  Java practically
*encourages* the interpretation of partial contents of a
stream before the who has arrived.

This is *precisely* the source of one of the worst security
problems within Microsoft OutLook: it attempts to interpret
the meaning of MIME components before it has the full message
in hand.

Java repeats Microsoft's mistake, and then codifies it into
necessity.

For this to work in Java, you pretty much have to save a
message to a local file, with a seperate stream, and then
interpret the stream from the file, once you are sure it
is intact.

Too bad the JavaMail API doesn't do this, and too bad it
instances uninitialized objects which it then has to post
initialize (e.g. new Message instances, etc.).

Maybe you can blame this on the design of MIME, such that
not everything can be done correctly in a single pass,
unless you know that you have the entire encapsulated
message in hand.  On the other hand, given that MIME is a
reality, maybe you can blame it on using the wrong tool
for the job.

Realize that I understand Outlook's desire to assign
meaning and intelligence to the contents of message
streams during download, so that the user can get the
warm fuzzies that something is happening, as the headers
for the downloading message are displayed in the UI.  And
don't think I don't understand that the JavaMail API is
trying for the same thing.  But realize that in all cases,
correctness and non-transmission of worms because of the
buffer overflows in the code that is nominally protected
from them by encapsulation by other code is more important
than "warm fuzzies".


-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C865E41.960B4E7>