DEV Community

Cover image for Should I learn Java or C++?Lets discuss!
Lindiwe
Lindiwe

Posted on

Should I learn Java or C++?Lets discuss!

Happy New Year fellow developers👩‍💻👨‍💻!

I’m a self-taught developer with a background in JavaScript and Python. I’ve been considering which language to learn next: Java or C++.

Here’s my situation:

  • I don’t have a formal CS degree, but I’m passionate about learning and expanding my skill set.

  • I’m pursuing AWS certifications, so cloud technologies are my big focus.

  • I’m looking for a language that will complement my existing skills and potentially open more opportunities in backend or systems programming.

I’d love to hear your thoughts! Here are a few questions to guide the discussion:

  1. Which language did you find easier to learn as a beginner, Java or C++?

  2. How do you see the relevance of each language in today’s job market?

Your insights will not only help me but also guide other self-taught developers in making similar decisions. Let’s share experiences and learn together! 🚀

Top comments (27)

Collapse
 
pgradot profile image
Pierre Gradot

It's been almost 9 years since I've stopped Java, and have been working with C++ then, as a professional developer.

  1. Java is probably easier. The language itself is (was?) quite simple. As least, much simpler compared to C++.

  2. It depends a lot on your geographic situation and whether you are open to world-wide full remote positions. However, I believe Java is more widely used in the software industry. I also believe it's especially true in cloud development.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for sharing your experience! 🙌 It’s insightful to hear from someone with professional expertise in both languages.
I’m glad to know that Java is simpler and more widely used, especially in cloud development. Your observation about Java’s prominence in this field is particularly valuable, as I’m currently pursuing AWS certifications.
As someone who transitioned from Java to C++ professionally, do you think C++ skills still complement cloud development, or should I prioritise Java for that path?

Thanks again for your input—it’s really helping me weigh my options! 🚀

Collapse
 
pgradot profile image
Pierre Gradot

I don't work in cloud development, I don't event work in web development in general, but I have the feeling that C++ is "almost never" used in this domain, while Java is heavily used, at least in the geographic area I work in (west of France).

Thread Thread
 
lindiwe09 profile image
Lindiwe

Thanks for sharing your perspective!
It aligns with what I’ve observed so far, especially regarding Java’s dominance in cloud development.

Collapse
 
akbaran profile image
akbaran • Edited

TL;DR C++ = No, but depends Java = Yeah, but... I'd recommend looking at Golang

Pierre, and taijidude make good points about Java.

C++
Honestly though, C++ -- I wouldn't bother with unless you were looking to get into game engine development, or graphics optimization for games, or working at companies that make hardware like hospital equipment, etc, or wanted to work building software like Maya.

Java
Java has tons and tons of jobs available. But the buzz I've heard for years is that Java devs don't really like working with Java even though it pays well. Ostensibly, it's a "safe bet." And while Java can be used for systems programming, any work done with it now would probably be maintaining code written long ago (maybe even before Java 8 was released). I doubt any new development would be done with Java for systems. The impression is that Java is used in stuffy, dry environments. I work on a team that does Java (though I'm not a dev on that team), in a bank.

Go
Go does seem to be the language that would satisfy your interest in cloud, backend, and system work. Frontendmasters.com use Go for its backend development, on a AWS. (I learned this while watching their Go with AWS course.) On top of that Go is well-regarded by its practitioners as easy to use, and easy to be productive with, and easy to learn. It's a joy to use for practitioners, seems likely to be used for new initiatives, or augmentations. Go was built with the then early trend toward cloud computing, distributed systems and applications which aligns well with your interest. It seems like a brighter, more enjoyable day-to-day, and path than Java. And you seem like an enthusiastic person, I'd hate for Java houses, and projects drain that zeal out of you.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for the breakdown! I really appreciate the insights on C++, Java, and Go. I totally agree with you on C++—it's best suited for specific use cases like game development or hardware-related work.

I hadn't considered Go much before, but it sounds like a great fit for cloud, backend, and systems development, especially with its focus on productivity and ease of use. I’ll definitely look more into it!💪💪💪

Appreciate your perspective—it's helping me make a more informed decision. 🚀

Collapse
 
akbaran profile image
akbaran

I appreciate you reading it, and feeling like you received something possibly helpful (I felt it was a bit wordy, and not well-edited). Yeah, I was just seconding the other poster who mentioned Go. I've gone down this same road for a over a year and half, wondering the same thing, and trying out a slew of technologies. Let me further advise you to concentrate on something in particular with whichever language you choose. Sharpen your skills by working on something that it's used for in the real world.

Thread Thread
 
lindiwe09 profile image
Lindiwe

Thank you for the advice and for sharing your journey. Your emphasis on focusing on real-world use cases for whichever programming language I choose is indeed a most valuable insight. I shall keep this principle in mind as I endeavour to narrow down my learning path. I appreciate your encouragement, as it shall undoubtedly serve as a source of motivation moving forward.🙏🙏🙏.

Thread Thread
 
akbaran profile image
akbaran

Awesome awesome awesome!!! :D Thank you too.

Collapse
 
linkbenjamin profile image
Ben Link

All comes down to use cases, as many have said.

C++ programmers (tend to) write locally-oriented applications that are computationally intensive, or "close to the metal". Want to do gaming with graphics? C++ is a great foundation. Want to do hardware automation / robotics? Systems like Arduino use C++.

Java programmers want their code to run everywhere - and it's very much the language of the web server (though modern JS, and even Python to an extent, are gradually supplanting that).

Cloud Technologies like AWS are heavy in Python and JS-adjacent things (specifically Typescript). Java programmers don't seem to have a huge benefit/advantage in cloud from my experience.

Java will be an easier learn primarily because it's a memory-managed language. You declare your variable, you forget about it... the runtime will clean up after you. In C++, you manage memory yourself, and you have the ability to do some altogether unholy things with that memory 😳. Incredibly powerful, but also incredibly dangerous.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for the detailed explanation! I completely agree that C++ shines in use cases like gaming, hardware automation, and systems development. Java definitely seems more versatile, especially for web servers, although I see how Python and JavaScript (with TypeScript) are dominating cloud tech, including AWS.

Your point about memory management is really helpful—Java’s automatic garbage collection does make it easier for beginners, while C++ gives you more control but with higher risk.
I appreciate your insights, as they have undoubtedly provided me with ample food for thought.

Collapse
 
taijidude profile image
taijidude • Edited

I think Java is more in line with your cloud dev goals. That beeing said have you considered go because of your cloud Focus?

Im also curious why are you considering c++? I see Java and c++ beeing used in different fields or for different use cases.

Btw... I'm a Java Dev. So Take everything with a grain of Salt.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for sharing! Java does seem to fit my cloud goals better, and I’ve considered Go but haven’t explored it deeply yet. I’m looking at C++ mainly for its performance benefits, though I see it’s used in different areas. I’m also looking for something with a gentle learning curve, which is why Java stands out.
Your perspective as a Java developer is super helpful—appreciate it! 🚀

Collapse
 
elyasi2142977 profile image
H.elyasi

If you need a language that is flexible, simple and versatile, then C++ is undoubtedly the best option, unless a company or organization specifically asks you to learn Java... I have come to the conclusion that if you start with C++, you will have no problem with any other language, both in learning and in programming and implementation. But if you start with Java, you have to use Java, learn Java and use it.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for your thoughts! Starting with C++ does seem like it builds a strong foundation for learning other languages. I can see how Java might feel more limiting in that sense. Appreciate the insight!🙏

Collapse
 
mark_ellis_fc53cc851d3822 profile image
Mark Ellis

I can’t say I’ve ever seen a much point to Java especially on server/cloud, why do you need cross platform on server side when there is only going to be 1 platform, and you know which one it is at development time? C/c++ rust are going to run much faster, and there’s no reason you can’t use in in the cloud, as for cross platform if you really need that on server for some reason, you’ve got web assembly, which I’d still going to run a hell of a lot faster then Java.
Also if you a Python, node developer you can write c code and import it into those languages, the vast majority of libraries in Python are written in c anyway.
Bit of your just learning low level languages, if day have a close look at rust, which is just as capable without all the memory safety issues.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for your input! You raise valid points about performance and platform specificity in the server/cloud space. Rust does sound appealing with its memory safety features. I appreciate the reminder about Python and Node.js being able to integrate with C—it's a great way to leverage performance. Lots to think about here—thank you!

Collapse
 
nadun_udaraka_db556562d0c profile image
nadun udaraka • Edited

Not self-taught anyway. But I first started with C++, the fundamentals of programming. Learned OOP with java and bit of C#. Learned Web Development with JavaScript. But I mostly work with Python. Since you know python and js they are enough for cloud development. To learn quick it's better to start with java. If you dig deeper the base of every language is the same.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for sharing your journey. I concur that Python and JavaScript are adequate for cloud development. Commencing with Java appears to be a judicious choice for a more expeditious learning curve, and I find merit in your observation regarding the shared core principles that underpin all programming languages, once one delves deeper into the subject matter.

I appreciate your insights, as they are undoubtedly shaping the trajectory of my learning path.

Collapse
 
taqmuraz profile image
Taqmuraz

If you consider working in team, my experience tells, that, in general, C++ programmers are least comfortable to communicate with.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for sharing! That’s an interesting point.
Do you think it’s due to C++’s complexity or team culture? Your insight gives me a lot to consider! 🚀

Collapse
 
taqmuraz profile image
Taqmuraz

I don't know exact reason of that, would be interesting to discover.
Probably, it's both -- C++ complexity and team culture.
What disturbed me most -- it is really difficult to get recognition of your knowledge from C++ developers, for them you are always inferior, even when you do things they could never do.
Working with C++ programmers, you are risking to be considered Junior only because you are young.

Thread Thread
 
lindiwe09 profile image
Lindiwe

Thanks for sharing your experience—it’s an eye-opener! It’s unfortunate to hear about those challenges, especially the difficulty in getting recognition. Team culture and respect for diverse skills are so important.

Collapse
 
taijidude profile image
taijidude • Edited

What did you before? You said you have experience in JS and Python? Can you tell us a little?

Collapse
 
lindiwe09 profile image
Lindiwe

I’ve extensively used JavaScript for building web applications for small-scale companies, leveraging frameworks like React and Next.js for the frontend and Node.js for backend APIs. Python is my go-to for backend and cloud tasks, where I primarily use FastAPI to create REST APIs and automate workflows. Both languages have enabled me to deliver scalable and efficient solutions tailored to small business needs.

Collapse
 
citronbrick profile image
CitronBrick

In my opinion, learning Java is a lot easier than C++.
C++ has a lot more low concepts like pointers, references, operator overloading etc. which are absent in Java.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for sharing! I agree—Java’s simplicity compared to C++ makes it more beginner-friendly.
Your input reinforces my leaning toward Java—appreciate it! 😊