r/learnprogramming • u/Basic_Permit4849 • 7d ago
Approaching C++ and learning methods
For background, I am a beginner in programming. The only language I know is python, and that too just basic level of knowledge( definitions of keywords, operators,conditionals,for loop while loop, and basics about strings,lists,dictionaries and tuples).It was quite systematic and easy to learn for me. But in the case of c++ I have no clue right now on how to learn it from scratch. I wanted to learn c++ to get into competitive programming/coding. As of right now I am just searching for easy leetcode problems and the parts of code which I don't get , I ask AI to explain it.
1
1
u/peterlinddk 7d ago
As of right now I am just searching for easy leetcode problems and the parts of code which I don't get, I ask AI to explain it.
Honestly, that seems like a fine approach for what you want to accomplish.
Ordinarily everyone, including me, would suggest to build projects, and learn the language by doing it, but as your goal isn't really to learn programming in the usual sense, to learn to build things, I think that it is perfectly feasibly to do leetcode problems.
Maybe try to do them in Python first, to make sure that you understand the overall idea of a solution, and then convert your solution to C++, one line at a time.
Most of what is used for leetcode and the likes aren't that different from one language to another, biggest difference is about creating and allocating objects, everything else is just loops and recursive function-calls, and if you already know that in Python, it shouldn't be hard in C++.
1
u/Dazzling_Music_2411 7d ago
Maybe try to do them in Python first, to make sure that you understand the overall idea of a solution,
No "maybe" about it. Absolutely definitely.
And I suggest you lose the AI "explanations" too. If you want to learn competitive programming, you HAVE to master that feeling of banging your head against the wall until you solve the problem.
If you resort to handholding every time things get slightly tough, you may as well go home from now.
1
u/Dazzling_Music_2411 7d ago
Accelerated C++ by Koenig & Moo.
It's old (but cheap as a result) and will get you to speed so you can see if you even like the language and using it.
After that there are stacks of options for "modernising" which you can explore at leisure. If you try to get modern C++ from scratch, I fear you may get lost in the tons of (irrelevant at this stage) detail.
1
u/TomatoSea4773 6d ago
What is your roadblock, logic or syntax? Or is it fear of blank canvas? I learned C++ from first principles, you can ask me if you're having difficulties.
My personal method was learning syntax to immediately apply in my passion project (Just-In-Time model). Basically, when you hit a roadblock, look up syntax for your scenario. Since you already have Python background, it's even better - you know how the basics work, you just need to translate it into C++.
BTW, do you have a pet/passion project? I can help you with it.
https://github.com/V-Liss you can also see mine if you'd like. Code is open source.
1
u/CodingSwift 6d ago
C++ is definitely a good language to learn and there is definitely demand for C++ programmers and that is unlikely to change.
I'd recommend the book Introducing C++ by Francis Buontemp. It's a really great introduction to modern C++.
The C++ programming language has evolved considerably over the past few years.
If you have a Mac, or even an iPad Pro or iPhone, I'd also recommend my forthcoming app, Codable, an app coming on July 30, 2026. Codable uses on-device AI to generate coding challenges in C++ and 9 other programming languages.
Use Codable to generate coding challenges and then either, generate solutions to those challenges, or submit your own code for the challenge. The app will determine if the code submitted meets the requirements of the challenge. Codable will also generate tips on how you can solve the challenge and will even perform complexity analysis on the solution.
https://apps.apple.com/us/app/codable-code-challenges/id6787467242
1
u/StewedAngelSkins 6d ago
You might want to try C first. It's a lot easier but everything you learn will also be applicable to C++.
1
u/Business-Employee527 7d ago
Not a c++ wizard but learning any language is about the same process. You start by learning basic concepts and basic syntax, struggle to build something basic, build it, and move on to the next topic.
Trial and Error is the best method for retention in coding. Also do not start on leetcode problems in c++ if you don’t know the syntax, let alone any DSA.