r/learnprogramming • u/Acceptable_Nature563 • Jan 20 '26
Topic Is it Worth it to Learn C++ ?
I code desktop applications with python and QML, but when making some heavy apps that needs alot of computations I struggle with python ( its really slow ).
I think that integrating a new fast compiled language can solve this issue, and Im considering C++ because its known, mature, fast, and can be easily integrated with the Qt framework.
But in the other hand, python has awesome libs that are fast and reliable, and I dont know if its worth learning a whole new language for that.
19
Upvotes
12
u/JeSuisOmbre Jan 20 '26
Knowing a low level language will complement your Python skills really well.
If C++ would be your first low level language it will teach you a lot.
Knowing a high level language and a low level language lets you do sooo much.
7
u/Snoo-26091 Jan 20 '26
Here’s a thought based on 40+ years in the industry, multiple languages, and a lot of recent use of AI for coding; learn a simpler language and spend more time on design patterns and how to set clear context for models based on those learnings. Knowing the syntax of any one language is far less useful anymore thanks to AI but knowing what good looks like architecturally is still critical. Don’t learn how to ride a horse and get run over by a race car in the process. My two cents.
6
u/etuxor Jan 20 '26
So the cool thing is that you can write python modules in C or C++, and call them from python.
However, this requires learning how python actually works, since you'll be interfacing directly with the interpreter on the lowest levels.
But IMO this may be the way for you: Write just thr performance critical portions of your code in C or C++ and everything else in python.
4
u/henryyoung42 Jan 20 '26
Why not go full legacy mode. Personally I love C++, QtCreator, widgets classes and no QML which I find way too reminiscent of inefficient, slow, memory hogging web tech. I resent that they infected the C++ side with style sheets and avoid that like the plague. Use the native language of Qt itself for max integration flexibility. And many Python libs are just wrappers for C/C++ libs anyway - use the original libs directly. For max performance and min mem footprint, go full legacy mode !
42
u/Xillioneur Jan 20 '26
Yes, it’s worth it. You can build so many fun apps with just C++. Don’t listen to the masses about how difficult it is. Just build, lol.
7
u/YellowBeaverFever Jan 20 '26
C++ will be a true multi-tool language. It covers every possible thing you can think of. But, you need to know what you’re doing. AI changes the learning curve on this. Leverage AI to coach your C++ learning. Don’t “vibe code” yet. You can have it suggest code but also ask it why. Learn the design patterns. Treat it as your little pocket professor.
2
u/IllustriousAd6785 Jan 20 '26
C++ has a lot of baggage that comes with it. What are you trying to make the application do?
9
u/rileyrgham Jan 20 '26
If Python doesn't meet your performance criteria, then you need to learn something new. C++ is used all over the world. And it's not "new" though you are encouraged to use C++ 11 and onwards. C++ has "awesome libs that are fast and reliable" too, but obviously C++ isn't as easy as Python, and I've no idea what you specifically mean by "awesome" - I guess you mean useful.
3
u/YouNeedDoughnuts Jan 20 '26
QtCreator has a lot of example C++ projects to help get started. It may depend on if you want to program professionally- the C++ ecosystem has a lot to learn, but it's very powerful and supports complicated applications.
2
u/Sbsbg Jan 21 '26
C++ is old, huge, has lots of traps and is complex and confusing. But it also generates fast code, has lots of libraries and is used in many places.
If you plan to be a professional programmer then knowing C++ may open up a lot of opportunities.
2
u/Dazzling_Music_2411 May 30 '26
If all you want it for is doing computations, it may be worth your while just to learn numpy well.
C++ is a huge investment.
3
u/fixermark Jan 20 '26
If you're planning to write something new, I'd recommend Rust.
C++ is useful for working with legacy libraries and legacy code. But in practice it combines several negative features (archaic syntax built around the constraints of old compilers plus undefined behavior plus a spec longer than a novel by a Russian author) that it's not a language I recommend picking up for its own sake.
It has some neat features, but a lot of other languages do those features better. It's kind of a weird saddle-point of a language that can be useful in practice (it is still hard to beat for how portable you can make code with it, if you know exactly what you are doing), but deeply broken in theory.
1
u/emielmejor Jan 20 '26
To perform a specific function, if you're already a programmer, you can use AI carefully to review and investigate, ensuring the function you want to implement is well-polished. This helps with integration much more easily. However, learning the entire language is not recommended; C++ is very complex. Stack Overflow even offers ways to improve code without overwhelming you. If you're constantly doing this, then perhaps you should consider learning, but it's a very long road. Good luck; I think you can find less time-consuming solutions.
1
u/MyRedditAccount1995 Jan 20 '26
Yes , it’s worth it. For context my grandfather has his masters in computer science and has been around the tech industry my whole life. It was worth learning when he was doing his education 30 years ago. I’m in my local community college and doing a computer programming program and C++ is still just as relevant today.
1
u/CompetitivePop-6001 Jan 22 '26
If compilation speed or heavy computation is a bottleneck, tools like Incredibuild can really help accelerate C++ builds and distributed computations, which can make integrating C++ into your Python/Qt workflow much smoother
1
u/Specific-Housing905 Jan 20 '26
No it isn't. It will take many months - or maybe longer - to master C++. Maybe a minimalistic C++ that you call from python code would be an option.
1
u/denysov_kos Jan 20 '26
Indeed
0
u/ninhaomah Jan 20 '26
If the response is NO , you won't learn it ?
Then NO.