java, c or c++

C

call_me_anything

choice between c and c++ is pretty obvious if the program is even
moderately big.

how does java score in comparison to c++ in terms of efficiency ?
i guess java definitely has more libraries, more verbosity (for
clarity to programmers) etc etc.
The only concern is efficiency. How does java compare with C/C++ on
that ?
 
L

Lucas Kanebley Tavares

From what I've seen in its early days Java was much much slower than C+
+, however "lately" I've noticed a big speed increase in Java
programs. The way I see it, if you're building an application that
will be ran for 10 min at a time, you should stay away from java
because it'll have to recompile everything every time you run it.
However if it's a program that'll be ran for days, in terms of speed C+
+ and Java are just about the same.

What Java is still worst at is memory. It simply uses way too much
memory. But it has more libraries, as you pointed out yourself. So
weight memory vs "libraryfulness", and decided.

Anyway, that's my two cents.

Lucas
 
P

Phlip

call_me_anything said:
choice between c and c++ is pretty obvious if the program is even
moderately big.

Why? Are you only concerned about speed? The most important resource to
optimize is
how does java score in comparison to c++ in terms of efficiency ?

Pitiful. Java is a platform, but you already have one, so another one on top
of it is a complete resource hog.
i guess java definitely has more libraries, more verbosity (for
clarity to programmers) etc etc.

Verbosity is not clarity. If you want clear lines, use a language like Ruby
that stays out of your way. Then you only write what's important, not the
endless paperwork Java makes you fill out just to get anything done.
The only concern is efficiency. How does java compare with C/C++ on
that ?

Google for "premature optimization is the root of all evil", then "alternate
hard and soft layers".
 
G

Guest

choice between c and c++ is pretty obvious if the program is even
moderately big.

how does java score in comparison to c++ in terms of efficiency ?
i guess java definitely has more libraries, more verbosity (for
clarity to programmers) etc etc.
The only concern is efficiency. How does java compare with C/C++ on
that ?

What efficiency? Memory, CPU, development time? For what application
domain? How good is the developer's knowledge of the languages? A good
developer with a language they know will will always produce better (for
almost any definition of better) than a bad developer in a language he/
she does not know. Other factors that needs to be considered are what
platform the code will run on and what other applications/devices it
needs to interact with.

Java and C++ are both good and efficient languages, just not always for
the same kinds of problems. My advice is to go with the language that
you know best, unless for some reason that is not possible.
 
C

call_me_anything

What efficiency? Memory, CPU, development time? For what application
domain? How good is the developer's knowledge of the languages? A good
developer with a language they know will will always produce better (for
almost any definition of better) than a bad developer in a language he/
she does not know. Other factors that needs to be considered are what
platform the code will run on and what other applications/devices it
needs to interact with.

Java and C++ are both good and efficient languages, just not always for
the same kinds of problems. My advice is to go with the language that
you know best, unless for some reason that is not possible.

A strange reply to my question...
I am surprised that the meaning of efficiency wasn't clear.
What is the first thing that comes to mind when you talk about a
program's efficiency ?

A good developer... is amazing !
Nearly as bad as walking on road is equally dangerous as flying in a
plane because vehicles ply on road.

Answers like the others ones above were much better I guess.
This one was just consideration of too many factors many of which do
not apply.
 
W

Walter Bright

call_me_anything said:
choice between c and c++ is pretty obvious if the program is even
moderately big.

how does java score in comparison to c++ in terms of efficiency ?
i guess java definitely has more libraries, more verbosity (for
clarity to programmers) etc etc.
The only concern is efficiency. How does java compare with C/C++ on
that ?

I'd choose the D programming language!
 
G

Guest

Please do not quote signatures.
A strange reply to my question...
I am surprised that the meaning of efficiency wasn't clear.
What is the first thing that comes to mind when you talk about a
program's efficiency ?

It depends on your background of course. For someone writing embedded
systems that do not perform any time-critical tasks memory efficiency
can often be much more interesting than speed. If you are in database or
some other storage-related industry then storage efficiency is more
interesting. Currently I am more interested in developer efficiency
since for the stuff I work with I have more than enough of both memory
and CPU power.
A good developer... is amazing !
Nearly as bad as walking on road is equally dangerous as flying in a
plane because vehicles ply on road.

Sorry, you lost me there.
Answers like the others ones above were much better I guess.
This one was just consideration of too many factors many of which do
not apply.

And you would have said the same thing if you had asked the same
question in a Java group and gotten the answers that Java was much
better than C++ because someone had written a slow C++ app once and some
other guy did not like the C++ syntax. (I meant no offence to Philip or
Mr. Tavares, I just want to point out that the OP did not have enough
information to make even an educated guess.)
 
P

Phlip

I am surprised that the meaning of efficiency wasn't clear. What is the
first thing that comes to mind when you talk about a program's efficiency
?

In the olden days, with 1 megahertz CPUs, of course program efficiency meant
carefully writing to avoid bottlenecks.

We all know that, and we have all taught ourselves to be very careful when
discussing abstract efficiency. The standard answer to this question is that
programmer efficiency is more important, because that frees up time in your
schedule to tune your code.

Premature optimization is the root of all evil.
This one was just consideration of too many factors many of which do not
apply.

Then share with us: Where is the "efficiency" requirement coming from?
What's the true meaning behind it?
 
J

Juha Nieminen

call_me_anything said:
how does java score in comparison to c++ in terms of efficiency ?

It depends on what you are going to do.

There's a reason why almost all high-end computer games are made
in C++ and not in Java. OTOH, not all applications need that level
of efficiency.
 
P

Phlip

Juha said:
There's a reason why almost all high-end computer games are made
in C++ and not in Java. OTOH, not all applications need that level
of efficiency.

Yet Java does not even offer programmer efficiency...
 
J

James Kanze

Yet Java does not even offer programmer efficiency...

It depends on your target. On the whole, I'd agree with you
(and it's no accident that, knowing both languages well, I do
most of my work in C++). But in cases where absolute
reliability isn't important, and portability---even to systems
you might not know exist---is, Java has its place. When you
have to deliver client software to a large, heterogeneous park,
you do gain programmer productivity by only having to compile
and test on one (virtual) platform. You don't have the
reliability of having actually tested on every target, but if
the code isn't critical (e.g. just some flashy interface, to
make things look good), the JVM is generally sufficiently
reliable for that. Thus, for example, I've seen more than a few
applications which use Java for a comfortable interface for
editing their configuration files, or displaying an overall view
of the system: which machines are running, which aren't, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top