From owner-freebsd-chat Wed Mar 6 10:22:27 2002 Delivered-To: freebsd-chat@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id 8411E37B400 for ; Wed, 6 Mar 2002 10:22:21 -0800 (PST) Received: from pool0158.cvx21-bradley.dialup.earthlink.net ([209.179.192.158] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ig3F-0001Hr-00; Wed, 06 Mar 2002 10:22:09 -0800 Message-ID: <3C865E41.960B4E7@mindspring.com> Date: Wed, 06 Mar 2002 10:21:53 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Nate Williams Cc: Raymond Wiker , Giorgos Keramidas , "Steve B." , freebsd-chat@FreeBSD.ORG Subject: Re: C vs C++ 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Nate Williams wrote: > > Anyway, I *really* can't see any reason not to use , > > , 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