r/cpp_questions • • 10d ago

OPEN Is C++ worth it?

I've been wondering whether learning C++ would be worth it. I'm really interested in hardware design. I've even built my own CPU in Logisim, and now I'm looking to get into parallel programming and GPU computing.

I also enjoy programming highly efficient simulations and machine learning projects purely out of curiosity. Would C++ be a good investment for these interests, or would I be better off focusing on other languages?

63 Upvotes

31 comments sorted by

23

u/billybobsdickhole 10d ago

Yes. Understanding C++ is a really good gateway to just generally understanding computers. Less abstractions to hide the details.

But don't let it be the only thing you do, learn as much as possible, other langs, and have fun with it.

12

u/billybobsdickhole 10d ago

C++ is where much of the edge computer vision/ml/model deployment happens too. Great choice if you like that stuff

2

u/bpikmin 9d ago

Networking too! AI seriously stresses networking cards. Nitro v6 for instance supports 400gbps PER CARD. And each Nvidia card in a GB300 has 2 Nitro cards

5

u/ConnectAffect2346 10d ago

Couldn't agree more with you, another thing that also gives c++ is the ability to make something from nothing, total freedom, while on python or other languages there are multiple restrictions and also you can manipulate memory through c++ seeing as it is in the family of low level programming languages but at the same time there are various libraries that have a lot of modern program solutions so you can make modern applications and programs, even your custom libraries, but it all depends on what you want to build and how, but definitely recommended language to learn😀

5

u/PhysicalJoe3011 10d ago

All the advantages you mentioned, work as a disadvantage against you, if you do not have the experience.

Anyway, still my favourite Language.

→ More replies (1)

39

u/AKostur 10d ago

Yes. And don't fixate on only one language.

5

u/coffee_swallower 10d ago

parallel and gpu programming is a very good fit for C++. theres a book called c++ concurrency in action which you might find interesting. just know that C++ is a massive language so dont try to learn every but of C++ at first. just learn what you need and you'll naturally learn more as you build more projects and do more research.

4

u/SnooSquirrels9028 10d ago

I think that C++ is worth learning for every programmer despite their are specific goals

4

u/Bstochastic 10d ago edited 10d ago

I'm not sure if C++ will ever see widespread adoption.

edit: I'm being sarcastic...

→ More replies (1)

4

u/WikiBox 10d ago

It depends on what you want to do.

C++ is great for high performance where development time is less important than total aggregated execution time. Writing software that has to be fast and is likely to be used often. Possibly by a lot of people. When efficiency running the software is more important than efficiency writing the software. Great when the total execution time is likely to be significantly greater than the time needed to develop the software.

C++ is not great for small tasks that are done seldom. Then the development time is likely to be too long compared to the amount of time the code is run. Then something like python or shell scripting might be better. Great when the total execution time is likely to be significantly less than the time needed to develop the software.

If you code for fun, efficiency coding is less important. Then it might be fun to write an extremely high performance simulation in C++, from scratch. Or it might be more fun to write 5 slightly less high performance simulations in python, using high performance C libraries. Or something in between.

7

u/proverbialbunny 10d ago

I'm really interested in hardware design

If you're interested in lower level programming neighboring this like firmware programming, driver programming, kernel programming, and similar, then C is the primary language, then after that Rust. C++ in 3rd here.

I'm looking to get into parallel programming and GPU computing.

Python is going to be your goto here. C++ is good for CUDA programming, which is writing the libraries many GPU programs use, but that's a level more abstract than what you might be looking for, so Python would be a better choice.

highly efficient simulations and machine learning projects

Python is the most popular language for this. You can do this in C++, so it is a valid option, but not so much for prototyping. Unless you have a specific reason to go with C++, you probably want to start with Python here.

My advice is if you want to not just learn C++ but master it, learn Rust first. Rust has the same programming concepts and a very similar syntax, but the compiler will throw an error at you if you write it in a way that a bug at runtime will form. C++ will compile and run, then explode on you while it's running. Rust will teach you how to write proper C++. C++ has more to the language than Rust so once you've got that foundation go from Rust to C++ and you'll be an expert at C++.

1

u/neerajprime 5d ago

C++ is good for many things, but only if you are prepared to spend years learning it. I started using C++ since C++98 and still dont have a complete hang of it. I have even dared to read the ISO standard and use it at times when compilers got it wrong.

I am not sure what is your scope when you said "Hardware Design", but if its about interfacing with hardware from software then C would do equally well.

You'll have to define "highly efficient simulations" and "machine learning" a bit further and I'd look at the intent a bit differently.

If I find a particular framework or library interesting and if that is written in C++ then I'd go there and not the other way around unless I am interested in the language more than the application.

1

u/RoleMain7059 3d ago

By hardware design, I mean anything related to computer architecture, including the design, architecture, and underlying logic of CPUs, GPUs, and other hardware components.

By highly efficient simulations, I mean optimizing software to fully utilize the available hardware resources (ideally 100%) and execute simulations as efficiently and as quickly as possible.

By machine learning, I mean the broader field of machine learning, including neural networks, reservoir computing, and other related approaches and techniques.

5

u/CowBoyDanIndie 10d ago

C++ Python and shell scripting

3

u/gosh 10d ago

C++ is the only language you need to learn today because of AI, if you know C++ you know them all. The startup time is so much lower

1

u/JRCSalter 10d ago

I can't say. I haven't really done anything with it.

However, I can tell you that learning C++ has taught me more about how computers work than almost anything else. The only other language I know of that could teach you more is Assembly, but nobody ever uses that.

C++ has been around for decades, so there's likely still a lot of software out there built with it that needs maintenance, and as the older programmers retire and newer ones learn Rust or another langue du jour, there'll be fewer people to maintain such legacy code.

1

u/TrainingJellyfish643 10d ago

Do it if you want to do it, life is short and worst case you dont like it and then you can just move on to something else

1

u/NaNpsycho 10d ago

If you're gonna do GPU programming, aka use cuda or rocm. You'd have to use c++ to write those hip applications anyways. So yeah, you do need c++ knowledge.

1

u/Unhappy-Salary8171 6d ago

C++ es uno de los mejores lenguajes para estos casos, te obliga a entender que esta pasando por debajo, aquello que muchas veces ignoramos, es todo un reto sacar algo pero uno del cual te sentiras profundamente orgulloso cuando este listo.
Si quieres profundizar aun mas, C es otra forma, tiene menos abstracciones que C++ y por ende son mas cosas manuales las que hay que hacer y tambien esta Rust que es un C/C++ pero con seguros estrictos de memoria

1

u/ClockMoney4525 4d ago

super useful if you want to be involved in hardware, robotics or defence, otherwise no. parallel programming and gpu i dont know too much about but pretty sure there are more specialised stacks for that these days

1

u/mkhanwrites_ 4d ago

Learning C++ could be helpful for your interests. Anything low level that deals with manual memory management would help teach you the concepts for the type of low-level software development/hardware design you're interested in

1

u/_w62_ 10d ago

Learn C++. The more legs you have blown up, the more you love Rust. That is my personal experience.

Depending on your workflow, struggling embedded toolchains/libraries on different platforms could be painful. Try emulation/vm beforehand if possible. Spend a good amount of time on QEMU and it's cli.

1

u/MersenneTwister19937 6d ago

Believe it or not, as a long-time C++ developer, I want C++ to die as soon as possible. The recent C++ 26 standards fiasco was another nail in the coffin. It’s a bloated, horrible and ugly language that had no competitor but now there is. I am learning rust as fast as I can.

1

u/No-Wealth5392 6d ago

Okay mersenne twister 19937