View Single Post
Old 06-19-2004, 03:33 AM   #5 (permalink)
npa
Code Monkey
 
Join Date: Jul 2003
Location: canada
Posts: 82
npa is on a distinguished road
there is absolutely no way java can be
faster then c++, in the specialised case.

secondly, the code on the site is not even
well-written, nor does it include the actual
timing code that he has implemented ...

consider this, 'fibo', from the c++ version:
Code:
    if (n < 2)
	return(1);
    else // useless else
	return(fib(n-2) + fib(n-1));
and the 'else' is left out of the java version:
Code:
	if (n < 2) return(1);
	return( fib(n-2) + fib(n-1) );
, despite this - the original comment stands - there
is absolutely no possibility for java to beat c++ in a
specialised case.

that said, i prefer developing in java.
__________________
direct entry file specification.
npa is offline   Reply With Quote