DEV Community

Cover image for So you wanna say C++ is better than Java?

So you wanna say C++ is better than Java?

filatovv profile image Yuri Filatov Originally published at Updated on ・2 min read

No, I don't want to say that way or other way.

Nowadays, we hear a lot of crazy things in a dispute about langauge to write your code. First of all, you have to always keep in mind one phrase:

Programming is not a code - it is the algorithm

Let's mark some visible advantages and disadvantages of them:

  1. It is easier and faster to write cross-plattform applications on Java

  2. It is easier to write multithreaded applications on Java, but faster on C++

  3. When you work extensively on memory, then faster is C++

  4. C++ is good, when your perfomance and memory is critical (large calculations and etc.)

  5. Java is easier to study and faster to write a code

  6. C++ is too strict. One small mistake can make a fatal lose in "game". Some people compare it to "playing chess"

  7. There a lot of libraries for C++, that allow writing "beautiful" and fast GUI

  8. A lot of desktop applications are still being written on C++

  9. Some say, that Java is a good start, but not "continue". C++ compilation is generic for every plattform, but not Java.

  10. So C++ is merciless. How much time do you need to make an ideal code?

Have I marked everything? Of course, no. There is no general answer to this question, everything is individual. Every language is good and needed today as well. In conclusion, I wanna say NOT "C++ vs Java", but "C++ and Java" (Because of JNI, you can make one good of two)

I really want to hear your opinion on these points and I really want you to write your suggestions in comments to discuss.

Good luck in your job!

Discussion (3)

Editor guide
hanpari profile image
Pavel Morava

Is comparing Java to C++ that meaningful as of today?

I mean, I see people discussing Java vs Kotlin or C++ vs Rust. But Java vs C++ was a thing about 10 years ago. 😁

If you put a gun to my head and told me to choose between Java or C++, I would volunteer for being shot dead, just to avoid further suffering. 😂

filatovv profile image
Yuri Filatov Author

I do not want to put the language out of "top" languages just because it is not widely used nowadays (yes, only 8-10% use c++). It is still strong language-base for others.
As I know, a lot of people start their coding life with c/c++ just to try. So I thought it would be interesting :(

hanpari profile image
Pavel Morava

I see your point. But honestly, I would never recommend to start programming with Java or C++.

Or with Rust or Kotlin.