Sunday, April 24, 2016

Digest for comp.lang.c++@googlegroups.com - 13 updates in 5 topics

Marcel Mueller <news.5.maazl@spamgourmet.org>: Apr 24 09:34PM +0200

On 23.04.16 01.22, Mr Flibble wrote:
> libstdc++ creates a separate temporary sprintf format string for EACH
> number you want to output and then uses that string in an internal call
> to sprintf (or its equivalent) for each number.
 
Well, it's up to the implementation.
 
> This isn't a problem with C++ iostreams per se it is a problem with the
> quality of their implementation.
 
Indeed. But it is one reason why I do almost never use iostreams.
 
> C++ iostreams could easily outperform
> the C alternatives if a bit of effort was put in to leverage argument
> types.
 
Obviously no one did the job for the last 20 years. And since the syntax
of the iostreams is that crazy (operator overloading just because it can
be done, stateful formatting) I'd rather implement my own I/O classes
than use iostreams. BTDT.
 
One of the first things when coding a new C++ application is a xprintf
function which returns std::string or whatever string class the
application prefers. *printf is still part of the C++ standard, so why
not to use it, unless something better exists? Modern compilers do type
checking with reasonable warnings for printf like functions.
 
 
Marcel
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 24 09:58PM +0100

On 24/04/2016 20:34, Marcel Mueller wrote:
 
> application prefers. *printf is still part of the C++ standard, so why
> not to use it, unless something better exists? Modern compilers do type
> checking with reasonable warnings for printf like functions.
 
Why not use old inferior language features you ask? The same question
could be why use 'new' when you could use 'malloc'? Why use classes
when you can not use classes? Apparently you are unaware of the concept
of progress.
 
/Flibble
Paavo Helde <myfirstname@osa.pri.ee>: Apr 25 12:44AM +0300

On 24.04.2016 23:58, Mr Flibble wrote:
> could be why use 'new' when you could use 'malloc'? Why use classes
> when you can not use classes? Apparently you are unaware of the concept
> of progress.
 
How do you define "progress"? Not every change is progress. Or
alternatively, not all kind of progress is good. I could draw examples
from former USSR and current North Korea, but to stay on topic I just
mention export templates and exception specifications.
 
When something like Boost.Format or C++ Format Library gets
standardized, printf() will become obsolete indeed. But not before.
 
Cheers
Paavo
Marcel Mueller <news.5.maazl@spamgourmet.org>: Apr 25 12:40AM +0200

On 24.04.16 22.58, Mr Flibble wrote:
 
> Why not use old inferior language features you ask? The same question
> could be why use 'new' when you could use 'malloc'? Why use classes
> when you can not use classes?
 
Well, all of the features you mentioned have significant advantages.
 
> Apparently you are unaware of the concept
> of progress.
 
Progress for its own sake in this case. IMO iostreams are no progress
but just a proof of concept for the rather new language (at that time),
far away from pretty good concepts like STL that are born later. They
should be marked obsolete and replaced by something better. And awaiting
a better solution I am stuck with printf so far.
I have never seen any language with a comparable bad concept of string
formatting in my life. OK, if you include assembler languages iostreams
are not that bad. But even a PDP11/24 with a macro assembler is quite
usable.
 
Don't misunderstand. I like C++. Actually I prefer it - except for
iostreams.
 
 
Marcel
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 24 11:54PM +0100

On 24/04/2016 22:44, Paavo Helde wrote:
> mention export templates and exception specifications.
 
> When something like Boost.Format or C++ Format Library gets
> standardized, printf() will become obsolete indeed. But not before.
 
You can use Boost.Format NOW rather than waiting for it to be
standardized so there is no reason to use printf NOW.
 
/Flibble
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 24 11:56PM +0100

On 24/04/2016 23:40, Marcel Mueller wrote:
> [snip] And awaiting
> a better solution I am stuck with printf so far.
 
Boost.Format mate.
 
/Flibble
Marcel Mueller <news.5.maazl@spamgourmet.org>: Apr 25 01:05AM +0200

On 25.04.16 00.56, Mr Flibble wrote:
>> [snip] And awaiting
>> a better solution I am stuck with printf so far.
 
> Boost.Format mate.
 
Unfortunately Boost is not supported on some of my platforms.
 
 
Marcel
Wouter van Ooijen <wouter@voti.nl>: Apr 24 06:01PM +0200

Op 20-Apr-16 om 12:57 AM schreef Jerry Stuckle:
 
> So then please tell us - how does one implement C on an IBM mainframe -
> which does have a stack pointer nore does it support push, pop, call,
> return, etc. instructions?
 
As a last resort, write a Java VM and use gcc with a Java backend (write
one, if it doesn't exist).
 
Wouter "Objects? No thanks!" van Ooijen
Jerry Stuckle <jstucklex@attglobal.net>: Apr 24 04:49PM -0400

On 4/24/2016 12:01 PM, Wouter van Ooijen wrote:
>> return, etc. instructions?
 
> As a last resort, write a Java VM and use gcc with a Java backend (write
> one, if it doesn't exist).
 
So is that how they run Linux on an IBM mainframe?
 
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Christian Gollwitzer <auriocus@gmx.de>: Apr 21 07:34PM +0200

> 1. sumOfIntegersDivisibleBy3
> 2. factorial
> 3. power
 
That is a horrible user interface. The user has no possibility to
correct for erroneous input, only by starting over and typing the same
10 digit numbers again.
 
Good user interfaces are either graphical, where the user can correct
and update the data anytime, or command line option parsing, where the
facilities of the shell are used (history repeating, line editing, file
completion etc. )
 
Christian
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 24 05:18PM

On Thu, 2016-04-21, Christian Gollwitzer wrote:
 
> That is a horrible user interface. The user has no possibility to
> correct for erroneous input, only by starting over and typing the same
> 10 digit numbers again.
 
Yes, and I can't see why it's so common in the kind of exercises
people post for help with. It seems so much easier for teachers to
provide unit tests, and tell the students to make them pass.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
legalize+jeeves@mail.xmission.com (Richard): Apr 22 01:44AM

[Please do not mail me a copy of your followup]
 
Kate Gregory is awesome.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
legalize+jeeves@mail.xmission.com (Richard): Apr 21 07:12PM

[Please do not mail me a copy of your followup]
 
* Cross-Platform Mobile Development with Visual Studio 2015 and C++
* Modern C++
 
<https://legalizeadulthood.wordpress.com/2016/04/18/slides-for-utah-code-camp-presentations/>
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: