Why C++ and not Java??

Question: Is C++ really faster than Java?

The main argument for C++ against Java is that C++ can deliver the lowest latencies. However that does not seem to be true if you use Java as a syntax language, in other words, if you ditch the JDK. The JDK is slow, not the Java platform/language.
Fair enough.
But the Java vs C++ war is over, IMO.
My 2 cents. It is a non-issue.
 
Then why NYU teaches JAVA rather than C++?
Anyone could share opnions?
Why not?
Java allows programmers to harness the power of the network. Because Java runs on browsers, desktops, servers, and even consumer devices like smartphones, it is widely used for web-based applications by software developers and by companies building in-house applications. Designed for those with prior programming experience as well as anyone just entering in the field, this certificate program is a student’s passport to a career as a Java programmer.
 
Last edited:
As a study abroad consultant in nagpur and career guidance provider, I got some of the coding expertise in C++ JAVA ORACLE n so... According to me C++ is better because of following points :

C++ is compiled language whereas Java code is compiled as well as interpreted. That means execution of C++ programs is faster than Java program.

C++ supports operator overloading (ad hoc polymorphism) it means we can perform computation on objects. Whereas Java does not support operator overloading.

C++ supports multiple inheritance but Java does not support multiple inheritance using classes, which is accomplished using “interface”.

C++ use pointers whereas Java does not use pointers. So, directly we cannot do system level programming using Java
 
C++ supports multiple inheritance but Java does not support multiple inheritance using classes, which is accomplished using “interface”.

C++ use pointers whereas Java does not use pointers. So, directly we cannot do system level programming using Java

These are design features of Java, not defects. Also, multiple inheritance is a headache and using interfaces a step forward.
 
As a study abroad consultant in nagpur and career guidance provider, I got some of the coding expertise in C++ JAVA ORACLE n so... According to me C++ is better because of following points :

Ah, click bait, but I'm going to bite (I love this s#!t)

First, let's get some things clear. Either you are very young and have never written systems in either Java or C++, or you have never had to maintain any application written in either Java or C++. In any case, you ain't no expert based on your claims.

C++ is compiled language whereas Java code is compiled as well as interpreted. That means execution of C++ programs is faster than Java program.

This is not necessarily true. It depends on which sort of process are you running. Usually for trivial cases they are true but for long running process like server processes, things that run non-stop, Java has proved to be as fast as C++ in the recent versions.

C++ supports operator overloading (ad hoc polymorphism) it means we can perform computation on objects. Whereas Java does not support operator overloading.

You can achieve the same goal using functions. Operator overloading is just syntactic sugar to make things look nicer but can lead to confusion because you can obfuscate the meaning of the operator and make the code hard to maintain and read. For example, think about redefining the plus ("+") operator to do division on numbers. People will come up with all sorts of clever things when you give them the tools.

C++ supports multiple inheritance but Java does not support multiple inheritance using classes, which is accomplished using “interface”.

Oh no! It has been shown that multiple inheritance is a disaster waiting to happen because the code becomes intractable and hard to maintain. So the recommendation is to do in C++ what Java and C# do, just inherit virtual functions

C++ use pointers whereas Java does not use pointers. So, directly we cannot do system level programming using Java

And this is a problem how? Smart pointers came to the picture because all the problems that having pointers create. You can do system programming in Java if you want. People don't usually do it not because of pointers but because of the garbage collector. As a system programmer you like to have deterministic outcomes and timings in certain situations and the Java garbage collector gets on the way some times.

Java and C++ have their place in the "programmer's toolset". I don't think one is better than the other at this point. It just depends on what you want to do.
 
Last edited:
Operator overloading is just syntactic sugar to make things look nicer but can lead to confusion because you can obfuscate the meaning of the operator and make the code hard to maintain and read.

Not if it is done properly, by sticking to the mathematical foundations. Don't go overboard.
 
The C++ vs Java wars ended a lot time ago. It is a non-discussion these days.

As a study abroad consultant in nagpur and career guidance provider,
Self-promotion/spam to me!

The list is sooo 90s.
I just notice that. Clear spam/self-promotion.
 
Last edited:
Back
Top Bottom