473,788 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

java, c or c++

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 ?

Sep 30 '07 #1
12 1594
>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

On Sep 30, 11:41 am, call_me_anythin g <sgiitne...@gma il.comwrote:
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 ?

Sep 30 '07 #2
call_me_anythin g wrote:
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".

--
Phlip
Sep 30 '07 #3
On 2007-09-30 16:41, call_me_anythin g wrote:
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.

--
Erik Wikström
Sep 30 '07 #4
On Sep 30, 8:37 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
On 2007-09-30 16:41, call_me_anythin g wrote:
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.

--
Erik Wikström
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.

Sep 30 '07 #5
call_me_anythin g wrote:
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!

-------------
Walter Bright
http://www.digitalmars.com/d C, C++, D programming language compilers
Sep 30 '07 #6
On 2007-09-30 19:16, call_me_anythin g wrote:
On Sep 30, 8:37 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
>On 2007-09-30 16:41, call_me_anythin g wrote:
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.
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.)

--
Erik Wikström
Sep 30 '07 #7
call_me_anythin g wrote:
What efficiency? Memory, CPU, development time?
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?

--
Phlip
Sep 30 '07 #8
Why? Are you only concerned about speed? The most important resource to
optimize is
programmer time.

(Witness my short-term memory issues!;)

--
Phlip
Sep 30 '07 #9
call_me_anythin g wrote:
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.
Sep 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6816
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what the issue is. Thanks Ravi
1
6919
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
9273
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
0
5656
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to connect to the DB I get the following exception at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2120)
1
9654
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
12
5927
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it says: usage: java fit.FitServer host port socketTicket -v verbose I think this is because I do not understand the jython mechanism for inheritance (yet).
0
3288
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)) and in both cases, get the following list returned from calling getDeclaredFields() on java.lang.ClassLoader via this code snippet: Field fields = loaderClass.getDeclaredFields(); for (int i = 0; i <...
1
4307
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in Linux there is an error. The code that fails is the following: SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); I´m sure that code is ok. In fact, I´ve found that in several...
0
3290
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.