r/AskComputerScience 22h ago

C++ or Java?

Which programming language has the most return on investment? Impact on real world systems, and is more rewarding? I have minimal programming experience and working on AS in CS.

4 Upvotes

33 comments sorted by

11

u/Relevant-Cut-884 22h ago

C++ is an excellent learning language , it has concepts you will not find in any programming language , like pointers , garbage collection and also it is the main competitive programming language for its speed

Java is also good though

The most important thing is to start learning

1

u/Rashing_pro 6h ago

wdym "you will not find pointers and GC in any PL"? Huh? A lot of languages, including java has a GC. And pointers are present in C and Rust for example

-9

u/Mission-Maize8454 22h ago

I just want to make the most money I can possibly make like 20 years from now.

16

u/saruko27 21h ago

Something tells me making the most possible money 20 years from now is not going to come down to which language you decide to learn today.

-6

u/Mission-Maize8454 16h ago

AI?

2

u/willbdb425 7h ago

No, because if you want to earn lots of money you'll need to learn many languages over your career so it doesn't matter what you'll pick first it won't be your last

4

u/Relevant-Cut-884 22h ago

It doesn't work that way I mean if you want to be rich by programming Then you ve to be clever , if you wanna be clever , so you will have to learn and study in the best way you can

The first phase for that goal is to learn fundamentals which is

A learning language

Practice on it

oop

Doing projects on it

DSA(data structures and algorithms)

Solving problems on it

So , i recommend doing c++ for this phase

1

u/Mission-Maize8454 21h ago

I'll take beginning C++ then , great advice btw.

1

u/Relevant-Cut-884 21h ago

You 're welcome , good luck <3

4

u/baddspellar Ph.D CS, CS Pro (20+) 21h ago

Good programmers are prepared to learn new programming languages throughout their careers

3

u/Weevulb 21h ago

Learn COBOL lol

2

u/I_so_I-274 21h ago

It's good to think about money specially long term and what to focus on depending on your taste however I personally wouldn't lead with that thought. People who think like that often get burnt out and doing something they don't even love doing for money.

There's plenty of ways to make money as well and other fields to look into if that's your only goal. If you get better and more experienced you'll make money regardless, networking and being an upstanding citizen probably will help you more as well.

Both languages make money, Java is more universal however experienced c++ devs deff have higher salaries to bargain with from what I've seen.

2

u/Mission-Maize8454 21h ago

Yeah getting burnt out is real when doing way too much.

2

u/Dornith 20h ago

No one knows what will make the most money 20 years from now. 20 years ago no one predicted graphics card engineers would be kings of the world.

Javascript was only invented 30 years ago and it runs the entire internet.

Also, as someone else pointed out, the language you choose to learn in high school/college is not going to chisel the next 20 years of your career into stone. You will almost certainly learn at least one more language just by proximity alone.

1

u/Putnam3145 19h ago

i got a job in C++ after having only used it fleetingly precisely once in 12 years of experience

1

u/green_meklar 17h ago

It doesn't look like there are going to be a lot of jobs of any kind 20 years from now. What kinds, we have no idea.

1

u/PlasmaFarmer 15h ago

If you are in it only for the money and you don't have any affinity/interest in IT, then don't. You will suffer doing something you hate and you will lose motivation and also won't be skilled enough to compete.

3

u/Key_Net820 19h ago

IMO C++ not because it is more used, but because it is way easier to go from C++ to Java than the other way around.

Most full stack development does not use C++ and you'll mostly be using C++ for lower level things like embedded software, but the principles of object oriented programming and design patterns are the same for both, and having C++ is way more practice than Java.

3

u/eager-potato-555 12h ago

C, all the way best language to shape you as a software engineer.

In terms of ROI? Sorry to say this, but it depends on your local job market. If I had to make an educated guess, I would pick:

* python

* go

* js/ts with any frontend framework of your choice

2

u/Tai9ch 21h ago

If you're interested in being a professional programmer, which language you learn first doesn't matter much. Especially trying to look years and years in the future, there's basically no chance that whatever language you happen to pick first is the one you'll be working in.

You want to learn the broad skill of computer programming. Either C++ or Java is a fine place to start (as long as it's not too old a Java version).

That being said, if you start with C++ or Java, you don't want to learn the other one as a second language. They're too similar. Learn C or JavaScript next instead.

2

u/Traveling-Techie 21h ago

If you want to make money take management classes.

1

u/Mission-Maize8454 21h ago

Business management?

1

u/Traveling-Techie 14h ago

Specifically software project management.

1

u/eager-potato-555 12h ago

there is wisdom in this comment! lmao

1

u/Traveling-Techie 6h ago

I was expecting criticism for saying this, and I had my defense ready: I’ve worked at a lot of software companies, and the programmers always made less than their managers. But I got no criticism. I guess it’s non-controversial.

2

u/YourPwnResearch 15h ago

I have an extremely strong opinion on questions of this nature.

You shouldn't worry about this question right now. Pick any language, get hooked on programming, and build up your skills. There is no right answer, because this is deeply personal.

Getting experience is the skill that has the most return on investment.

Many, if not most, Gen X programmers started off with 8-bit interpreted BASIC. We don't use that professionally today.

A more interesting question is which programming language you should learn second. And that has a much simpler answer: you should pick one that's as different as possible from your first, so you unlearn your bad habits.

So if (say) you learned C++ first and then decided to try second, that would arguably be a mistake, because they're too similar: both imperative, both C-like syntax, similar object model, etc. Go with something very different like Scheme or Haskell instead.

If you're truly in this for the long haul, if personal reward is what you care the most about, then that's what you need to do.

1

u/Mission-Maize8454 15h ago

I'm in it for the long haul.

1

u/Leverkaas2516 19h ago

I don't think you can nail down an answer as to which of the two will give you more earning potential. They are different, and used for different projects. Learn both if you can. If you have to choose, learn whichever has the highest potential to land you a job. My guess is that's Java. It is easier to ramp up and become productive with Java.

I've done embedded work in C++ and backend work in Java. I've used either or both at four different jobs in two decades. I'm still more comfortable with Java but these are just tools. You should expect to learn more than one language.

1

u/Level-Challenge2759 16h ago

If youre early in an AS in cs id pick whichever your program teaches better both have plenty of real world impact c gets you closer to systems game engines embedded etc java is huge in enterprise and backend dont chase roi too hard yet build solid fundamentals first,,,,

1

u/gmatebulshitbox 9h ago

Java is for money. Because banks and enterprise use java for their software. Banks and enterprise is good money but boring job.

1

u/NegativeCollege8167 9h ago

java has a higher return on investment for someone with minimal programming experience. It's widely used in enterprise environments, particularly for backend systems, and it's known for its portability across different platforms. Plus, the object oriented nature of Java makes it easier to learn and apply to real world systems. You'll find that Java's ecosystem is extensive, with a lot of libraries and tools that can help you build comprehensive applications.

1

u/ButchDeanCA 7h ago

You’re doing an AS in CS but talking like at least a BS in CS. If you’re doing an AS just do Java, it’s a nice and gentle language with features similar to C++, and given your timeline, why can’t you learn both?

Next comes the fact you are in this purely for the money, you are just the kind of mentality that doesn’t make it.

1

u/CowBoyDanIndie 4h ago

If your only goal is making the most money you should look for another field. You will burn out and stop programming. Or at least just plan to work your way into management. Every 30-40+ year old dev I know and work with who is making big money is inherently interested in tech.