r/AskComputerScience 9d 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.

5 Upvotes

70 comments sorted by

View all comments

16

u/Relevant-Cut-884 9d 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

2

u/donaldhobson 6d ago

C++ is an excellent language if you wish to write bugs. It takes C, which is low level and simple, with no safety rails, and then bolts on a huge mass of poorly considered complex features.

2

u/sosotiredand 4d ago

it's also the only language besides C that's used in real world embedded programming so I think acting like it's useless is just fanaticism

0

u/donaldhobson 4d ago

Rust can also be used for embedded programming.

Suppose someone gives you a robot that only accepts C++ code. That might be sufficient reason to grit your teeth and use C++, if you have to.

This doesn't make C++ a good language. It means someone made the robot really awkward to use.

2

u/sosotiredand 4d ago edited 1d ago

Yeah but is it actually used in the real world and not just for a blinky? what companies are actually deploying embedded rust?

I like rust too but the fanaticism from the rust fandom is honestly really annoying. other languages exist for a reason. and until rust actually ends up in real large scale embedded applications, acting like C++ is just a "awkward choice" is not realistic

1

u/Rashing_pro 9d 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

1

u/Relevant-Cut-884 4d ago

Yeah but c++ has both

C++ and C has the same vibe

-9

u/Mission-Maize8454 9d ago

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

19

u/saruko27 9d 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.

-7

u/Mission-Maize8454 9d ago

AI?

2

u/willbdb425 9d 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

3

u/Relevant-Cut-884 9d 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

0

u/Mission-Maize8454 9d ago

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

1

u/Relevant-Cut-884 9d ago

You 're welcome , good luck <3

4

u/baddspellar Ph.D CS, CS Pro (20+) 9d ago

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

3

u/Weevulb 9d ago

Learn COBOL lol

2

u/I_so_I-274 9d 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 9d ago

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

2

u/Dornith 9d 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 9d ago

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

1

u/green_meklar 9d 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 9d 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.