Thanks for your reply.
You can assume it's available in a general sense but you may not be allowed to use it, sometimes this happens.
Stroustrup made a bold claim that no program exists, I pointed out strlen and malloc - that there exist programs that can be written more efficiently by his metric - your e.g. qsort, I do not dispute, but I refuted his claim. I didn't say implementing strlen faster, I merely said implementing strlen is not by any of his metrics a superior experience in C++.
C would just use hardcoded strings or defines, with sizeof(). This is also a possibility in C++, but I was talking about the implementation of strlen not the usage.
Neither strlen nor malloc (nor qsort) count as programs under any pragmatic, non-nitpicking, definition.
Even the assumption that implementing, e.g., a memory allocation algorithm in C++ is not more comfortable than in C, does no lead to the conclusion that writing a device driver (your example) in C++ is not more comfortable than doing it in C.
I agree with you. Just to be clear: I'm not making bold statements like "I don’t believe such a program could exist.".
But you do admit they are programs! That was all I was trying to do, refute his ridiculous claim - albeit with something marginally less ridiculous. How about a program calling a C library?
The driver thing doesn't automatically lead to the conclusion - but it's not a far stretch to picture it being so. A simple thought exercise does not make a water tight argument.
I can imagine writing certain parts of drivers being better under his metrics in C++ than C but I don't see it in black and white terms like he does. I can see the opposite being the case also.
All that needs to happen for Stroustrup to be wrong is for one program to exist that beats his metrics in C instead of C++.
No, I don't – not in the sense that Stroustrup was using the term "program". strlen or malloc are not programs in the way that this term is commonly understood. His claim is not ridiculous, unless you're nitpicking by using definitions which are just not useful for the discussion at hand (i.e., is C++ better suited for developing non-trivial software).
As for the driver example: I guess we'll just have to agree to disagree, unless someone actually implements a device driver in C and in C++ ;-)
At least we can agree that a driver is non-trivial.
How about a program that calls a C library?
The only project I know of that publishes in multiple languages, vtd-xml - the C++ library has 40k lines of code versus C which is 60k. I don't dispute that C can be more verbose - but it's not a stretch of the imagination to think there's a program somewhere out there that meets Stroustrup's requirements better in C than C++.
Not sure at what point we will have a certain agreement on what is trivial and what isn't. Here's an example of someone writing a lot of code to wrap a C library in to C++, and then doing a few calls to it.
Stroustrup made a bold claim that no program exists, I pointed out strlen and malloc - that there exist programs that can be written more efficiently by his metric - your e.g. qsort, I do not dispute, but I refuted his claim. I didn't say implementing strlen faster, I merely said implementing strlen is not by any of his metrics a superior experience in C++.
C would just use hardcoded strings or defines, with sizeof(). This is also a possibility in C++, but I was talking about the implementation of strlen not the usage.