Re: C++14: Papers
On Wednesday, April 10, 2013 2:46:39 PM UTC+1, Scott Lurndal wrote:
James Kanze <james.kanze@gmail.com> writes:
With the major difference that there doesn't seem to be any new
competition. C++ seems to have beat out Ada-95, and in a more
distant past, Objective-C and Modula-3, but since then, there's
not really been any new language which realistically attempts to
replace it. If something new does come along, that is to C++
what Python is to Perl, I'd jump on it, but I don't see it
happening. In the case of C++, the total is simply too large:
in the time it would take to redesign a new language with all of
the expressivity of C++, but clean, simple and elegant, C++ will
have added new functionality that are missing in the new
language.
One could argue that Java is the "python to perl" for C++. It is much
cleaner (or was prior to java 7) than C++, more maintainable and more
readable.
Java's "cleaner" because it doesn't try to address many of the
issues C++ addresses. It's actually an interesting case: where
C++ has a less than optimal solution to a problem, Java solves
it by pretending that the problem doesn't exist, and banishing
all solutions to it. Thus, for example, in a large project, you
definitely want to keep the public interface definition (the
class definition) is a separate file from the implementation
code. The C++ solution is probably about the worst one could
conceive of: textual inclusion of the class definition, the
requirement that private data members be defined, etc. But
Java's answer wasn't to create a better solution; it was to
totally forbid the practice, even though it is clearly
desirable. (I know, there are work-arounds: in Java, you define
an interface or an abstract class, with static factory functions
to construct the actual objects. It can usually be made to
work, but it's not really flexible enough.)
The obvious downsides are bytecode and non-determinism which
are antithetical to many classes of problems that are solved by C++.
I don't think byte code has much to do with it (although it does
mean that you can't test your program in all of the possible
environments in which it might run). And Java is actually less
non-deterministic than C++---you need garbage collection to be
truly deterministic, for example.
--
James