Re: performance question
George Neuner wrote:
Again not comparing like programs. Java knows the length of the
string at each point whereas C has to recompute it every time you ask
for it.
Each approach has drawbacks: Java imposes an arbitrary limit on string
length and C has a performance issue when it needs to determine the
length.
Language Wars are like Editor Wars. George, your comment is nicely balanced,
as a few others' have been, pointing out that different languages have
different strengths.
This hardly refutes Steve Wampler's point, indeed, it validates it. He was
pointing out that one can easily construct a benchmark that exploits the
difference(s) between languages to prove whatever point, either side, one
wishes to make. A good knowledge of the different tradeoffs between languages
lets one construct a benchmark that exploits a strength in one language (Java
in his case) that is a weakness in another (C), with respect to what the
benchmark measures.
He was also subtly making the point that the OP was "again[,] not comparing
like programs".
I like Java not for its speed, which is plenty fast enough in the real world,
but for its features as a language and the richness of the API, and not
incidentally, for the abundance of job opportunities. In particular, its
fundamental architecture for portability, network awareness (anyone remember
"The network is the computer"?), inherent multi-threaded power, dynamic nature
(sure, reflection is dangerous, but shoo! it's powerful!) and yet, perhaps
paradoxically, its straightforwardness make for an extremely useful
development platform.
--
Lew