* Alan Brown:
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?
As always the FAQ is a good place to start getting a handle on such questions.
In this case, FAQ items 6.5 and 6.6.
<url:
http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5>
<quote>
In 99% of the cases, programming language selection is dominated by
business considerations, not by technical considerations. Things that
really end up mattering are things like availability of a programming
environment for the development machine, availability of runtime
environment(s) for the deployment machine(s), licensing/legal issues of
the runtime and/or development environments, availability of trained
developers, availability of consulting services, and corporate culture/
politics. These business considerations generally play a much greater
role than compile time performance, runtime performance, static vs.
dynamic typing, static vs. dynamic binding, etc.
</quote>
The FAQ isn't perfect, though (what is?). It should have stated _main_
programming language selection. For example, long ago, in a galaxy far
far away, there was a Java project where we needed to maximize windows
(not possible in Java then), to deal with the Windows clipboard (not
possible in Java then except for pure text), and where we needed a decent
help system (not available in Java then); I implemented those things in
C++, used by the main Java code. Only a couple of months later a Java
help system much like the standard Windows one became available, and half
a year or so later Java got better support for clipboard operations, I
think, it's possible I have the timeline reversed now, t'was long ago. It
was easy to then switch from the C++ implementations to pure Java because
the interfaces were clean (a single language improves maintainability).
In an even earlier Java project, possibly even farther away, I created
interfaces to the Windows security system (access checks, impersonation)
in C++ -- impossible to do in Java then.
C++ lets you do those integration things that a canned language like Java
doesn't, and it lets you access hardware, and it can be more efficient for
some things, although the set of such things has become smaller and smaller
over the years (Java-like JIT compilation can be superior to a fixed once-
and-for-all C++-like compilation wrt. efficiency, but not always).
With C# there's less need for C++ because C# lets you access basic OS
functionality, but then, with C# it's easy to get stuck not only in the
Windows world, but in a particular version of Windows, .NET and toolset. C#
is great as a beginner's language, though. And so is Java, but IMO not quite
as good for that as C# (here's much room for opinion), the Turbo Pascal heir.
I am not asking for personal opinions on which is the *best* language
Ah, but you are...