bookmark - What Are The Advantages Of Java Vs C++?

What Are The Advantages Of Java Vs C++?

 
 Discussion by silverkirfsco with 22 Replies.
 Last Update: September 20, 2010, 8:18 am (View Latest)
Page 1 of 2 pages.
bookmark - What Are The Advantages Of Java Vs C++?  
    
free web hosting
 
what are the advantages of c++ and what are the advantages of java?

what one is more userfriendly, and what one has more capabilities?

Sun Mar 6, 2005    Reply    New Discussion   


I'm primarily java programmer, but some years ago I used c++ as my primary programming language.

I can list some(not all) features which are big adventages in java:
1. garbage collector (you don't think about empty pointers)
2. numerous libraries (especially open-source libraries)
3. almost full object programming
4. cross-platform programming and running
5. you can write programs and pay nothing for licences(free IDE, free frameworks etc.)
6. very big community

Sun Jun 19, 2005    Reply    New Discussion   

Replying to silverkirfscoWhat Are The Advantages Of Java Vs C++?

No one reinvent the wheel.

Every language is built over the shoulders of other(s).

In the beginning there was machine code.You need to know the native code of the target machine where your application will run.

The they invented Assembly Language that will be translated (or assembled, as it was called at those times) to machine code.

C was created to made easy the developing of system-level application without the need of using Assembly Language. With C you don't need toKnow the machine code of the target machine, and, even better, theSource code was machine-independent.

C++ is some kind of superset of C. It has all the features of C, plus all the features of a full flegged OOP language (classes, objects,Inheritance, polimorphism, ...)

Both C and C++ take advantage of the full speed of the processor.Both languages can even use the internal registers of the CPU forVariable storage. They are the best languages to develop system levelSoftware. 

Despite some people said that C is obsolete, this is a huge error. For automation, control, and many other hardware oriented applications,We donīt need OOP, so we don't need the extra features of C++ over C.So, in those scenarios, C is enough.

Java was created to be plataform independent, and because of that,Java don't produce machine codo. Only an intermediate code (bytecode asWe call) is created, and because of that we need extra software toTranslate the bytecodo to machine code. This is called JVM (Java Virtual Machine) or JRE (Java Runtime Environment). 

The first aim to create Java was the developing of software forGadgets. Suddenly the invertors of Java rethink the issue and saw thatJava is a goog language for the internet. 

The negative side is that Java is veeeeeeeeeeeeeeeeeeeery sloooooooooooooow (despite some java-lovers said the contrary).

As a final note, when Microsoft created .NET framework and all the .NET languages, they don't invent nothing new.

Microsoft simple take the idea of SUN and produce a similar techology with anather name. 

Even C# is a clone of Java, and the purpose of MS was to get Java developers to Windows. 

In common, Java, C#, VB.NET and even C++/CLI, all produceIntermediate code, and all have lack of security in protecting sourceCode. It's very easy to get the source code be disassembling theBytecode (Java) or the MSIL (.NET). 

All these languages are useless for system developers. 

-reply by Paul Nilton

 


Mon Sep 20, 2010    Reply    New Discussion   

QUOTE

Java is designed to be simple, object oriented and similar to C++ while removing the unnecessary complexities of C++. It is also said to be a robust, architecturally neutral, portable, interpreted, threaded, dynamic and high performance language. Java enables the development of robust applications on multiple platforms in heterogeneous, distributed networks. C++ is not truly portable nor is it suited to heterogeneous, distributed networks. While C++ excels in high performance, its powerful features and complexities are often the source of many errors.

Sun Mar 6, 2005    Reply    New Discussion   


C++ is new generation computer language.

I like both : )

Sun Mar 6, 2005    Reply    New Discussion   

Oh, and you can run Java programs and applets on any computer, no matter what the OS, as long as it's equipped with the Java Virtual Machine, which is free. :)

Mon Mar 7, 2005    Reply    New Discussion   

C++ can be a very fast language when compiled hence its use in device drivers and other core applications (alongside C). Java is moer userfriendly for writing applications for that will contain a GUI as it is mostly self contained and will run completley indipendantly of system or operating system. C++ does not have this advantage and external compile files or systems may be required to run software you design, this is especially true on linux and unix.

Mon Mar 7, 2005    Reply    New Discussion   

what one is easier to create graphics with?

and what one requires more computing power?

Fri Mar 11, 2005    Reply    New Discussion   

It depends on what you mean by graphics. For a simple GUI, Java's Swing API is easy to use, and usually built in or included as an add-on package to install. There's another GUI API, but it slipped my mind. I always just used Swing.

Java, as stated before, can be complied to run on the JVM. This creates a multi-platform application that you can easily distribute. The only negative part about this is performance, where the JVM is often sluggish and not fully robust enough for me to trust. I'm using a Yearbook creation software for a school, and it's the most poorly designed (and hideous) program I've seen in years, and I suspect that the problems lie mostly in the Java architecture rather than program design (could be wrong, but honestly, would anyone purposefully write a program that requires you to quit the application to open a new file?) I hated the JVM, and probably always will.

C++ has its downfalls as well. It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors. Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again. The OOP concept is essentially the same, so that's a moot point here.

If I had to classify Java and C++, I'd say Java is for learning, and C++ is for coding. C++ has significant advantages when it comes to performance, and can smoke Java in equal settings.

Fri Mar 11, 2005    Reply    New Discussion   

QUOTE

C++ has its downfalls as well. It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors. Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again. The OOP concept is essentially the same, so that's a moot point here.


You mean each Operating system has its own API's.
C++ if coded with portability in mind, is very very very easy to port.
Just re-compile.

aslong as you stick to C++ standards ( for example using fstream for file access instead of microsofts FILE class, < which does exactly the same thiing as fstream, except its not portable>)

Infact, The only parts that are difficult to port between windows, and the rest of the OS's is the GUI. and this can be nullified by using the GTK, QT or SDK libraries in c++ for GUI control.

In other words... IF a c++ project is designed with portability in mind, porting is as simple as a re-compile.

ANYWAYS... advantages of Java which nobody has pointed out jet...

1) Garbage collection. in java you dont have to delete memory when you have finished with it, it is virtualy impossable to wrte a program in java which suffers from memory leaks.

2) No Raw memory access. Although c++ raw memory access is lightning fast, Java takes away memory manage,ment from the porogrammer, making it virtually impossable to make a mistake which could result in a buffer overflow vunerability.

Some aspects or very confusing though.
for example in c++ you can simply declair an array of user defined object, and begin using them..

example

CODE

myObject  objectArray[ 100 ];


BUT in java, to do the same thing you need to

CODE

myObject[ ] objectArray = new myObject[100];
for(int n=0; n<100; n++) {
   objectArray[ n ] = new myObject;
}


this is because, in the java virtual machine, line one one creates an array of 100 pointers to myObject, you then need the loop to create 100 objects and assign them to pointers

This part of the java language only makes sence if you understand memory management and pointers (which you will only get from learning c or c++)

Fri Mar 11, 2005    Reply    New Discussion   

QUOTE (Soleq)

It depends on what you mean by graphics.  For a simple GUI, Java's Swing API is easy to use, and usually built in or included as an add-on package to install.  There's another GUI API, but it slipped my mind.  I always just used Swing.

Java, as stated before, can be complied to run on the JVM.  This creates a multi-platform application that you can easily distribute.  The only negative part about this is performance, where the JVM is often sluggish and not fully robust enough for me to trust.  I'm using a Yearbook creation software for a school, and it's the most poorly designed (and hideous) program I've seen in years, and I suspect that the problems lie mostly in the Java architecture rather than program design (could be wrong, but honestly, would anyone purposefully write a program that requires you to quit the application to open a new file?)  I hated the JVM, and probably always will.

C++ has its downfalls as well.  It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors.  Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again.  The OOP concept is essentially the same, so that's a moot point here.

If I had to classify Java and C++, I'd say Java is for learning, and C++ is for coding.  C++ has significant advantages when it comes to performance, and can smoke Java in equal settings.
[post="21701"]<{POST_SNAPBACK}>[/post]
I don't think that's the JVM's fault, it sounds more like a creation of a dumb programmer. After all, Oracle SQL was written in Java....

Sat Mar 12, 2005    Reply    New Discussion   

Let me share my knowledge about Java and C++.
C++ was here before Java came and its obvious for C/C++ to grab large portion of the market. but it does not make C/C++ the only programming language. Everyone Prefers C and C++ because it works as a middle tier of highlevel language and lowlever language. you get both power of programming at root as well as at the top. due to this popularity there are more C/C++ compiler than other languages. like GNU C++ or G++, Turbo C++, Borland C++, Devshed C++, MS C++ and many more they come in many flavour. some are specifically for windows. like VC++. I have not heard any one coding application in VC++ for Linux.
Due to this popularity C and C++ has become powerful more and more day by day and today it stands as a ruler in languages. And Microsoft had added a new flavour to C and C++ called C#. Though C# is made from the scratch. It is based on the same norm of C and C++.
C++ is handy as it supports both the structured programming and OOP. It is easy if you do not get overdriven by Pointers and end up crashing your software with an error reading "Illegal Referenc to this and that" or "Null Pointer Assignment". Memory management in C/C++ is totally on hands of a programmer. Though there are software to check the memory leaks and garbage collection. But memory management is tedious in C/C++. If you are well with Pointers and memory management then C++ should be your choice.
And talking about Graphics and others there are plugin API specially for Graphics, I think much of the graphics software or games are made in C/C++ and their other flavours.

Java is great Programming language. And I like to code in Java than in C/C++ because of its ease of use. I have heard that the codes in java are 4 times smaller than the codes written in C/C++ for the same job. Java manages memory itself by its garbage collector. and it eliminates the pointers and itself is based on references. I mean any variable you create are references. Java is easy to use for the programmers from the C/C++ background coz it has the same look and feel of coding.[The curly braces I love Curly braces{}]

Graphics in Java is good. The new JDK2 comes with more powerful Graphics API and I think you will hardly need 3rd Party API.

Moreover Java is platform independent and secure. You can port your program to any platform without any hassle.
I code Java program in windows and use it in Linux and viceversa. Its fun. you need not bother about portability as long as you have JVM running....

And there are many to follow...
Now you make choice which one is better..

Wed Mar 16, 2005    Reply    New Discussion   

In short...stick with C++ unless you need cross-platform usability and don't need anything complex.

Wed Mar 30, 2005    Reply    New Discussion   

i know people have already posted alot on this, but here'e my 2 cents.

java is easy. there are a HUGE number of libraries that sun and other people have provided. No matter what you are trying to accomplish, if you look hard enough, you'll find that someone has already written a function to do it for you. In C++, there are quite a few default libraries, but you deal with alot more in depth coding using system calls and whatnot. THis is even more true if you use C (which I do). Besides this, the syntax for the languages are pretty similar, and each could be written to look like the other. The real difference, as I see it, is the performance. C/C++ has very little abstraction between the program and the operating system, making it very fast. Java, on the other hand, has a virtual machine between it and the OS, which increases portability, but decreases speed immensly. Also, java is an entirely interpreted language, which (very basically) means is compiles each line as it reads it, slowing it down further. In the end, unless you're writing an applet for use on a website, theres no reason to use java if you've got a decent amount of programming skill.

-afrothunder

Mon Apr 4, 2005    Reply    New Discussion   

The whole reason java and C++ are so similar is because java is based on C++. It was acctually made to be used more in web development anyway, something which C++ was lacking. Java cut down on all the memory management and such in order to make web programming easier (try programming the memory managment when you have to think about IE or some other random browser in the mix too....).

Mon Apr 11, 2005    Reply    New Discussion   

Quickly Post to What Are The Advantages Of Java Vs C++?  w/o signup Share Info about What Are The Advantages Of Java Vs C++?  using Facebook, Twitter etc. email your friend about What Are The Advantages Of Java Vs C++? Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print


Question On Enterprise Java Beans Answer me  Question On Enterprise Java Beans Answer me (2) (2) Java Swing Ui With Xml Java SWING UI With XML  Java Swing Ui With Xml Java SWING UI With XML