Should I learn Java or C++?
Posted by tringlepringle222@reddit | learnprogramming | View on Reddit | 49 comments
Need to choose one for a college class. Which one do you think will be useful later on in life?
ImaJimmy@reddit
Question is too vague. If you feel like you don't know where to start, you can try a few things:
- Go on job sites and see what programming jobs are asking for and just pick up the most common language you see there.
- Go to networking events and see what people are working.
- Find a project you want to work on and see language is ideal for it.
It really depends on your temperament. I've met people who are married to a language while others don't care and will pick up whatever get's the job done. Regardless of what your pick, just make sure you know how to problem solve.
https://missing.csail.mit.edu/
I found the stuff here more helpful since learning a language sort of just happens when you're in this field.
lafeeverte34@reddit
Java for employability, just because there’s more roles out there that require Java or something like JavaScript.
C++ if you’re looking to get into low level programming
BanEvader98@reddit
Java is for girls. C++ for men.
deaddyfreddy@reddit
if you want to learn to solve business problems: none of the above
kindaa_sortaa@reddit
what should one learn to solve business problems?
deaddyfreddy@reddit
a language that allows you to describe the business problem as close as possible to its terms, avoiding introducing unnesessary entities
todorpopov@reddit
Ahh yes, Python it is. Solves the business problem, yet introduces a performance one or a nice juicy AWS bill.
deaddyfreddy@reddit
not really, it just pretends to
todorpopov@reddit
I have zero clue what you’re talking about in neither of the two comments
RexTheWriter@reddit
If the course teaches modern c++ then c++
kw10001@reddit
What a great question!!!!!!!!
EmperorLlamaLegs@reddit
Both are good choices, honestly. What field do you want to go into after college?
tringlepringle222@reddit (OP)
I can see myself as cybersecurity analyst or full stack developer. Which do you think is important of the two if I want to pursue one of those?
hrm@reddit
Cybersecurity: C++, by a mile Fullstack: Java, by two miles
cracken005@reddit
Why?
hrm@reddit
Coding in cybersecurity is generally more low level, even though it is a very diverse field.
No sane developer would use C++ for a fullstack application today due to is many issues with just the stuff cybersecurity people need to know about :)
Java is way more common in web backenda, and will also make it easy to learn other major backend/frontend languages auch as C# and JavaScript.
HonestyReverberates@reddit
Just depends on the company really. Tencent uses c++ on all of their backend, e.g. wechat, etc. Amazon uses java for all backend.
hrm@reddit
Yeah, some companies use C++. But there are probably 200 Java companies or more for each C++-company in that segment.
cesclaveria@reddit
And no developer remains sane when you inherit one nowadays, started maintaining a legacy C++ web application last year and it has been one surprise after another, nothing is ever straightforward with it.
Sparta_19@reddit
Damn can I do cyber security if I know Java and probably never touched C++?
hrm@reddit
Cybersecurity is a very diverse field and a lot of professionals don’t even know how to code at all and focus on other areas. But when it comes to coding, one big part is finding bugs and vunerabilities and there low level knowledge is very good to have and C++ will give you that to an extent that Java can’t.
Sparta_19@reddit
what job they do if they can't code?
cesclaveria@reddit
I worked a bit on cybersecurity, even have a most likely super outdated degree on it.
Most know how to code to at least some extent, but a lot of the day to day job is making sure configurations on different systems are correct and updated, monitoring network traffic, scanning for vulnerabilities, maybe some cryptography work, sometimes examining dumps or binaries to try and figure out what do they do, etc. It is a pretty diverse field where you need to know how things work but not necessarily always need to know how to make them. There can be some coding involved, maybe mostly scripting stuff to run much more complicated tools.
ShadowRL7666@reddit
This is the wrong sub and cybersecurity isint even entry level.
hrm@reddit
Listen to Darknet Diaries and the episode ”Rachel” for some insights.
To break into networks you need to know networks and use network hacking tools, not code. To break into buildings or make people divulge secrets you need to know psycology and talking shit, not code. Etc. Etc.
ShadowRL7666@reddit
Ehh. I understand this and that’s great though it depends like you said Cybersecurity is very broad therefore it depends but most experts depending Yk like a soc analyst or such should learn a scripting language. Though I do agree CPP is great.
Superchivy@reddit
Wondering the same thing. Can you explain this?
hrm@reddit
See my answer here: https://www.reddit.com/r/learnprogramming/s/Hw9uFDCdvD
Natural_Ad_5879@reddit
Java is good for both
EmperorLlamaLegs@reddit
Java for full stack. Not sure for cybersecurity.
Plenty-Turnover1318@reddit
C++
webdev20@reddit
I think you should learn C++ first. Both languages are used in various domains.
todorpopov@reddit
Since it is for a class I’d recommend to go with C++. Not only is it a great language overall, but it will teach you why languages like Java even exist, and why memory management and memory safety are so important in programming.
Also, it will be a very natural first language for better understanding Data Structures and Algorithms, a class I assume you’ll have very soon, if you haven’t already.
Lastly, after learning a decent amount of C++, learning any other language will be much easier, since you already know what problems this new language tries to solve. In the case of Java, it is exactly memory management and memory safety issues that C++ programmers were having before it.
HyperWinX@reddit
C++
MeepleMerson@reddit
Yes. Learn those two, at least. Both will be potentially useful in the future, and, if you're going to work in tech you'll need to understand how to work with many programming languages, and how to learn them to use them quickly.
misplaced_my_pants@reddit
If you have to choose one for a college class, learning C++ on your own is harder and learning Java is easy (especially if you already know C++).
Which will be useful later in life is the wrong question. You won't learn one language in a career. You'll learn whatever you need to do the job.
bikeram@reddit
What’s your schedule like? If you’re taking 18 hours, do Java, if you’re taking a light load and you’ll have free time, cpp for sure.
Java is going to be easier to learn, so you can pick up the assignments faster.
Cpp is going to teach you a lot more and you’ll easily pickup Java later. But, if you’re cramming for a circuits final, the last thing you’ll want to do is debug a cpp program.
Sometimes it’s worth making the trade-offs.
green_meklar@reddit
Knowing C++ is more useful. But if this is your first step into programming, C++ is a very tough language to take on without any background. Java is not the greatest beginner language but it's less frustrating to get into than C++.
MeBadNeedMoneyNow@reddit
Java
CosmicMilkNutt@reddit
C++.
Really learn TypeScript, Python or C# tho.
gibsic@reddit
EX
C0nf0rt4blyNumb@reddit
I would choose C++ just because Java is everywhere in terms of jobs so there won’t be a lack of opportunities for you to learn it later. And it is good to know some C++. All the cool stuff is built with C.
cesclaveria@reddit
Is only one class that is trying to teach a particular concept and the language will just be the tool used to teach it to you, or is it the start of a path on getting to know the language at a deeper level?
If it's only one class, go with C++ for it, having the chance to get a structured and guided learning experience with C++ will let you learn to use it while having some help to navigate its more painful areas and getting some experience at a low level will be helpful in many ways in pretty much all areas.
If it's to start a learning path that will take you to other classes/courses using the same language and getting a deeper understanding of it, go with Java, it will open more and more varied doors nowadays, the demand on the enterprise jobs for Java developers is always high, it's extremely versatile with important use cases from mobile, to desktop to web.
Of course both are good options and over your career and learning you will likely need to get to know both of them to some degree.
Effective_Day_1271@reddit
whatever you like better. after youte familiar with one language, you can comprehend others pretty well. learning others is a breeze to compare. its not that you gonna just stick with one anyway
armahillo@reddit
sure, why not?
raxel42@reddit
These things are non comparable. They are completely different. Java runs on the virtual machine (jvm) C++ runs on the bare metal. C++ can be used for anything. Jvm has some overhead and memory consumption. But there ere things could be done faster in Java. But there are things couldn’t be done in Java: embedded, critical, etc.
UsefulBerry1@reddit
IMO, if you know you'll be doing development using Cpp, only then pick it. Mostly people end up in web, and it better to learl Java for that
69devidedby0@reddit
Learn one the other will be easier
bqpg@reddit
Parroting what I've seen many others say: It depends / it doesn't matter / you should learn both / you should choose Java because it's easier to get started / you should choose C++ because you'll gain a deeper understanding of what is happening at a low level.