Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.lang.java.programmer Subject: Re: The greeting code in Java Date: 20 Jun 2011 19:21:37 GMT Organization: None Lines: 30 Message-ID: <969ku1FjduU7@mid.individual.net> References: <3d6aab49-9a4a-4614-af12-bb1c95bebbe7@w4g2000yqm.googlegroups.com> <4dfdf77e$0$4132$426a74cc@news.free.fr> <06cf6f85-5473-47da-b599-de2e7f81976d@d1g2000yqm.googlegroups.com> <4dfe0ce7$0$4853$426a74cc@news.free.fr> X-Trace: individual.net EHYsq/9OfXROh6fbDTY/LwwX5aCLdZZ3dU42jw2jq049B5ZNQr X-Orig-Path: not-for-mail Cancel-Lock: sha1:6+Hutbbbb8F+liJgJvX8fTPUYiA= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5430 In article <4dfe0ce7$0$4853$426a74cc@news.free.fr>, Aéris wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Le 19/06/2011 15:44, Saeed Amrollahi a écrit : [ snip ] > And in your code, I don't no if you know the difference, but std::endl > is very very dangerous. It's not just equal to EOL but also flush the > buffer. > This bad shortcut lead to very poor i/o performances in most of > applications, all outputs flushing continuously buffer instead just send > EOL. Huh. There's actually an explicit "flush" in the implementation? Interesting. How did you find this out? I'm not a C++ expert but had not come across a mention of this detail. Of course, if writing prompts to stdout with the implicit assumption that the program is being run interactively, flushing the buffer is what one wants. Just sayin'. -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.