r/cpp_questions • • 6d ago

OPEN How to learn c++ effectively and be profficient in it?

Maybe you've heard this question before, but I want to know. I've been studying c++ for a month now, and I feel like I know some of the basics, but I know that I need a different approach. I feel like I just memorize it instead of getting it. I want to learn it truly,the right way. I write a lot of code cause I know thats the best but I fall short on the thinking like a programmer part. I want to lean c++ independently,then switch to ue5 and work on a game. I would love it if you would share your methods and links to some good c++ literature. I know I'm not dumb and I know it's not easy. I am not looking for a quick solution, just the right one.

40 Upvotes

33 comments sorted by

4

u/sankyo 6d ago

C++ primer 5th ed. And build things

2

u/HydraisHydra 5d ago

What do you suggest building? Cause when I'm proficient enough to make a game, I qant to make it in ue5 which has different cpp, but I want to learn the basic cpp too.

3

u/sankyo 5d ago

https://www.geeksforgeeks.org/cpp/top-50-cpp-project-ideas-for-beginners-advanced/

https://pwskills.com/blog/cpp/top-31-c-project-ideas-for-beginners-advanced

Find an open source game using the engine you like and try to understand and modify it.

You have to crawl before you walk. Walking the path from rank beginner to game author requires discipline, effort, and time. Most give up at sudoku solver

2

u/HydraisHydra 5d ago • Bravo

Thank you! I'm not giving up, I just realised Im climbing the wrong way.

1

u/Discordbothost 5d ago

I'd build a tiny inventory in the terminal. Keep the item names in a vector and add commands to pick up, drop and list them. Decide what happens if you try to drop the same item twice, then make the code do what you decided. That's game logic you can practice in plain C++.

1

u/HydraisHydra 5d ago

Thats such a good idea

1

u/Darell_Ldark 2d ago

When I was learning cpp, I used to write my own text rpg. It wasn’t big or complicated, but it helped me to understand some language concepts and learn more about software development overall

1

u/HydraisHydra 2d ago

I have to try this out.

1

u/TobiasMcTelson 6d ago

Even of it’s c++ 11?

5

u/sankyo 6d ago

going for C++23 is not going to help you at the beginning. C++11 is still modern enough

chug through the book and do the exercises, and in parallel do projects.

https://www.geeksforgeeks.org/cpp/top-50-cpp-project-ideas-for-beginners-advanced/

2

u/mc_pm 6d ago

How much time are you spending actually hands-on-keyboard, trying to figure out how to make something work?

1

u/HydraisHydra 5d ago

I mean I spend around 5-10h weekly on programming,but if I egt stuck for more than half an hour I find the solution online. Maybe it's because I feel pressure cause I only code 1-1 and half hours a day (I would love to have more time, I already cut my screen time significantly and put a timer on my social media).

1

u/mc_pm 5d ago

Personally I wouldn't count time you spend learning as "screen time" exactly. Staring at a screen passively consuming content endlessly? Waste of time. Staring at a screen while trying to solve a tricky problem? That's how you learn.

It's going to take you the same number of hours to learn -- do you want to earn them one at a time?

1

u/HydraisHydra 5d ago

No sorry, mayeb I typed in a weird way. By screen time I mean anything other than coding. Earn what one at a time?

1

u/mc_pm 5d ago

I misunderstood perhaps. You said you only had 1 to 1.5 hours then referenced screen time, I thought you were saying that you were only spending an hour at a time to keep your screen time down.

I meant "it is going to take many, many hours to learn - you can decide how many hours a time you want to devote to it. If you limit yourself to 1 hour a day then it's going to take you quite a long time"

1

u/HydraisHydra 5d ago

Aa don't worry,all good. I wish I could spend more time,but yknow, other repsonsibilites. I just want to make a game,no matter how much time passes.

2

u/steven2a2 4d ago

Just keep trying Dont wait If you wait for the right recipe you will never eat. Keep cooking until you get it right.

2

u/HydraisHydra 4d ago

I agree with this,partially

17

u/GoogleIsYourFrenemy 6d ago

Software engineering is about organizing and planning software at scale. Best way to learn this is to work on larger quantities of code.

7

u/NomaTyx 6d ago

if you fall short on thinking like a programmer, you have to think like a programmer. reading literature can only get you so far, but the iterative process of doing a project, fucking up, and seeing how you could have prevented it is going to get you further

3

u/MarlboroBandit 6d ago

I am no pro since I am still learning C++. But I test/check my understanding by looking at problems online and solve it on my own. I even tried asking AI by telling it what I learned then ask it to test me/let me make a program. From there, try to write code based only on your intuition. Then, you will be able to truly learn the gaps of your knowledge.

3

u/Zen-Ism99 5d ago

Books, practice, and patience…

2

u/MarijuanaWeed419 6d ago

Play Factorio(half joking)

2

u/ImmediateQuality3513 6d ago

How to learn and master c++ from scratch as i want to enter in low level programming

2

u/AnonymouSfrrrr 6d ago

Try to build something that you think you can't build with current knowledge and learn from it. A good project teaches much more than a video tutorial.

2

u/Wobblucy 5d ago edited 5d ago

I started with 'begginer to beyond' on Udemy, then learn cpp, then read 3-4 cpp books and implented pet projects and never felt like I was getting anywhere 'real' after implementing the boilerplate on repeat, while also 'guessing' around what the code should look like.

I stumbled on learning mode with Claude like 2 years ago and would recommend it to anyone trying to make the leap from 'i understand the shape of the language' to 'i want to build without handing off all the thinking'.

A good article here on it.

https://learning.northeastern.edu/ai-student-guides-using-claude-learning-mode-to-study/

And a more specific code one with a screenshot of the to-dos it litters the modules with

https://www.zdnet.com/article/claude-can-teach-you-how-to-code-now-and-more-how-to-try-it/

More recently I've been reverse engineering or finding other reversed engineered code as well to understand what enterprise level software looks like.

2

u/WikiBox 5d ago

Use it. Read and write code.

1

u/Dazzling_Music_2411 6d ago edited 6d ago

Learn STL very well. Leen Ammeraal's old book is good, but there's a ton of other resources out there. Perhaps read some of Steopanov's more mathy books.

I do believe that STL mastery is the key to C++ proficiency.

PS. Also start learning your way about the Boost library.

1

u/Professional_Low9410 4d ago

I remember being in your place when first learning Cpp, The solution? It depends on your background, like if you came from a low level background like C and know some DSA then you're actually in a good shape just start doing a projet and you'll learn in the way. If this is your first time learning a low level lang then I'd consider doing C and DSA first. And finally if you're actually trying to learn OOP (I assume this because you mentioned that you want to work on a game) then You should before doing Cpp actually understand the fundamentals of OOP and I'd recommend to learn it in general and do some modeling in UML before doing Cpp. For the sources Books are always the best you can rely on.

1

u/mkhanwrites_ 2d ago

Refer to https://eecs280staff.github.io/notes/ - Class notes for the class EECS 280 - Intro to Data Structures - at the University of Michigan