Why Java is Better than C++

preview_player
Показать описание
Do you know why Java is better than C++?

Java will usually run on any implementation, no matter which Java version you use. It also plays well with others.

Why do you say that?

I credit that to the Java Virtual Machine, which is so good that a few other software languages have been written to utilize JVM, too.

C++ is not as rigid as Java.

Java is better for beginners, whereas C++ is closer to the machine level logic.

That means C++ is used almost everywhere.

C++ is almost an all or nothing implementation. You can use it for sound card controls and graphics manipulation, but it lacks interfaces with other apps and takes massive manipulation to run as an embedded app.

If C++ has been around longer, you can find existing code modules for what you need.

Java code is more easily re-used, and you can find existing third party code modules for a lot of uses anyway.

So it is closer to open source.

Java has superior application interfaces, which is why users like it.

C++ is almost the foundation of computing.

Java is far better for mobile apps and concurrent applications on the cloud. That's the future of computing.

C++ applications tend to be efficient. C++ is better for scientific computing than Java.

C++ has also been voted easier to shoot yourself in the foot with. I don't consider that a vote of confidence for the language.

C++ has been rated better for real time applications.

Except for drivers and OS level interfaces, it isn't getting used for many real time applications. Apple even moved away from C++ to Objective C for their iOS development.

So Java can do almost everything.

Oh, you probably need HTML and dot-net to do a few things it can't. But it does almost everything else.
Рекомендации по теме
Комментарии
Автор

You should change the title to "Why Java is EASIER than C++"

MechMonstrosity
Автор

"Apple moved from C++ to Objective C"
Is that a reason for anything? I wouldn't hire any programmer who created or propagate Objective C.

Sydra.
Автор

"C++ is easier to shoot yourself in the foot with"
Why? Because you sometimes have to deallocate memory yourself? Or because pointer arithmetics you shouldn't use anyway?

You can easily forget to initialize an object (especially strings are extremely annoying) and to check for null*pointer* in Java just as you can forget to free heap space in C++. If you learn C++ properly, it's just as easy and much more readable.

Also, in C++ you simply say ifstream file("filename"); and "file >> variable" while you have to initialize about 3 objects before you can even think about actually reading the file. Not to mention that you can get confused by those many libraries

The problem is that too many people still use old C functions. C++11 has many convenient features that are not used by the people who teach C++. I know we are currently at C++17 which I haven't checked out yet but it can only make things easier.

MrVecheater
Автор

Hmm. C++ always works because it doesn't depend on JVM. And still C++ has better resource management than Java, where it's just non-deterministic. Java will die at some point, JVM might survive but it will be used for other, better languages than Java.

And by the way, all sound software is real-time software. Similar for video software that has to do things live. Java is not a good choice there. Drivers on the other hand don't usually have to be real-time, except for few cases. They need to be fast, but that means something a little bit different than "real-time".

michal.gawron
Автор

If I'd ran youtube, you know what I would do to this video? Nothing.
But I'd get the poster's address, and I'd go slap him with Bjarne Stroustrup's "The C++ Programming Language" untill he was afraid to say the word "Java" again.
Java does everything worse than C++ on basically any means of comparison except lack of security. Java is way better at lacking security than C++

rrs_
Автор

C++ is a tank of kluges. Look through last specs!
Wanna be close to metal use plane C.

Otherwise C#/Java.
1)True C++ programmer doesn't know how data structures work. STL does everything.
2)True C++ programmer allocates memory about everything.
3) Programs of true C++ programmer never work without Boost.
4)True C++ programmer makes simple complicated.

zzSerg
Автор

Lol! C++ is quick.

PlayStation games are written in C++, though admittedly and especially in the past, there were huge volumes of bugs that were the result of uncanny programmers using habitual C paradigms which often didn't make full use of the encapsulation abilities of C++. Massive C++ system development is a difficult undertaking and requires high standards of professional software engineering practices during the development life cycle. Yeah, C++ can bite you in the ass so hard - and it's easy to run into cost overuns if there be closet idiots in the team.

Java is nice. It is a pleasant multiplatform language that is more forgiving than C++. However, C++ can be very pleasant if good development practices are maintained and encapsulation paradigms are adhered to.

It all depends on what you want to do. If you want to make website or mobile apps, then Java is the way. If an instance of higher speed is neccessary, then it is possible to use the Java Native Interface (JNI) to call some C++ code anyway, if required.
 
If you want to engineer the machines' states of being, say for bizarre game console architectures or high speed performance systems, then C++ tightened with Assembly code is the way.

It's important to use the right tool for the right job.

Eezapropageeza
Автор

java :D :D its such a joke compared to C++...

bracka