DEV Community

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

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

Lindiwe on January 02, 2025

Happy New Year fellow developers👩‍💻👨‍💻! I’m a self-taught developer with a background in JavaScript and Python. I’ve been considering which langua...
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 • Edited

I don't work in cloud development, I don't even 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
 
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
 
budgiewatts profile image
John Watts

Never prematurely optimise - particularly when it comes to choosing a language to further your career. Most projects don't require the potentially available performance of C++ and Java isn't really that slow in practice, especially not in a long running JVM. Search for jobs in your area over a few months and note which language is required and how much those jobs pay. Then make your decision based on that information. If one in twenty jobs are C++ then it's going to be much more than twenty times as difficult to get a C++ job than Java but if the C++ jobs pay twice as much, maybe it's worth the gamble?

Thread Thread
 
lindiwe09 profile image
Lindiwe

Great advice, @budgiewatts ! It makes sense to choose a language based on job demand and career goals rather than optimising too early.
Thanks for sharing!🙏

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
 
tensorprogramming profile image
Tensor-Programming • Edited

Both C++ and Java have sizable standard libraries and offer a broad range of features, but C++ tends to be more approachable, in my opinion, because it allows for imperative programming (you can basically write it like C), so you can avoid diving into its object-oriented features if you prefer. Java, on the other hand, is more opinionated in terms of how you should structure your software, while C++ offers more flexibility with fewer constraints which also means fewer guard rails (it doesn't hold your hand at all).

The choice between the two should depend on the domain you're interested in. Java is a great fit for large-scale, enterprise-level applications; web apps, mobile apps, games, whereas C++ is commonly used for developing performance-critical software with a lower level of abstraction, such as games, operating systems, and databases.

With C++, one of the main challenges is navigating its extensive and often confusing tooling ecosystem, especially for beginners. Additionally, its template system can feel like a language within a language. Java, in contrast, is known for its verbosity, and its object-oriented design can sometimes lead to unmaintainable code if not carefully managed.

Every language has its strengths and weaknesses, and there's no one-size-fits-all answer. My advice is to explore open-source projects on GitHub that interest you, check out what languages they use, and make your choice based on that while also contributing to those projects to gain experience.

The truth is, any language you choose—no matter how obscure—will ultimately benefit you as a developer, even if you don't use it for anything major. Exploring different languages gives you valuable insights into various design philosophies and broadens your perspective which makes it a worthwhile endeavor.

Collapse
 
jordantylerburchett profile image
Jordan-Tyler Burchett

I've been going through the same thing and done a lot of research on what I need to be learning at the current stage I'm in and I can tell you that for where you're coming from to where you want to be you should lean toward learning Java.

Java is going to suit your cloud based development needs more, you don't have to worry about memory management, it's less strick, and Amazon offers a Junior Developer Course on Coursera that focuses on Java development as well as GIT.

Collapse
 
emiroberti profile image
Emi Roberti

 Hi, I have experience with both Java and C++. Since they are both object-oriented (OO) languages, you can leverage similar design patterns when building applications. However, I transitioned away from Java about 10 years ago to focus on technologies like .NET, Node.js, and TypeScript for web-based development. Nowadays, especially with AWS serverless architectures, I frequently use TypeScript.

That said, C++ remains a fantastic language, particularly for its performance potential when used effectively. I often use C++ for tasks such as computer vision coding, video analytics, and building high-performance microservices within AWS VPCs using gRPC protocols.

Ultimately, the right choice depends on what you aim to build and your career aspirations. Java-based web applications are great for working with backend systems and CRUD-based APIs, offering a strong entry point into the industry.

However if i can make a recommendation full Stack Node/typescript with AWS certification will place you very nicely in the market place for jobs as well

Collapse
 
robert_sandiford profile image
Robert Sandiford

If you want to keep doing web development, I would suggest TypeScript, if you don't use it already. It's a good tool for web backend and especially full stack development due to the ability to code in a single language and share code. TypeScript is pretty complex to master, but it's a valuable enhancement if you need to use JS.

If you're looking to write pure backend logic where you don't need to worry about frontend, I think Java, C#, Rust and Go all work there. I've found C# pretty easy to work with personally, but I'm not experienced with Java. Kotlin is also a possibility as a kind of upgraded Java that compiles to the same bytecode and can use Java libraries (if you get heavily into the Java ecosystem, I expect you'd learn both). But TS and Python are both viable here too. Learning any of the languages mentioned above would give you a knowledge of a conventional statically typed language, with Java and C# being the most conventionally of all.

For systems programming I guess Rust is preferred over C++, but that's a long way away from web dev and I'm not sure that really what you want to do.

In summary, Java or C# would give you a good base in a statically typed language, and would be nice to know to round out your programming knowledge. TypeScript is great to enhance your JS but is hard to master. Either way you may end up using something else at work because there are a lot of options.

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
 
melissa_levy_e9a64f9b3ea2 profile image
Melissa Levy

I fell for a scam broker, and lost a lot of money up to $150,000. I searched for a way to retrieve my lost money back and I got a recommendation of Expert Bernie Doran. Their expertise and professionalism in navigating the complex process were truly commendable. I have been able to recover all my lost funds and made $10,000 - $20,000 profits not just by buying the dip but implementing trades with signals supplied by Expert Mr Bernie Doran, I am glad I was able to recover my lost funds successfully . He can be reached on TELEGRAM - IEBINARYFX

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
 
shekharrr profile image
Shekhar Rajput

Go for C++ only if you plan to do some advanced game dev or something or if you plan to start doing D.SA. Else choose JAVA. Good market

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for the advice! I’ll keep that in mind.😊

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
 
peshale_07 profile image
Peshal Bhardwaj

Java please, it is still a language in trend.

Collapse
 
lindiwe09 profile image
Lindiwe

Thanks for the suggestion @peshale_07 ! It’s definitely a strong option to consider. 😊

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! 😊