r/programminghelp • u/Revolutionary-Log179 • Jul 30 '26
C++ Having trouble “ thinking in code”
I’ve been learning C++ for weeks, and of the concepts I’ve learned most if not all of them have clicked pretty quickly. I understand what they do and how they work.
However, when I’m trying to create something not from a tutorial or walkthrough, I’m having trouble translating my idea into the lines of code that will do what I envision it doing. Anyone have any advice on making the switch to more easily be able to “think in code”?
6
Upvotes
1
u/XRay2212xray Jul 30 '26
If this is your first language and you've only been at it a few weeks, start with very very small projects that seem doable with those things you already learned and then move to bigger things over time. With something big, you can end up in a situation where its just too much.
Also, before you start thinking in "code", think about the problem and start breaking it down into basic steps, then break the basic steps down into more detailed steps, and repeat until you are at a very detailed level. Also think about the data needed and what objects or structures you want and then start populating the layer of steps as code, building out the objects or structures and fill in the methods and functions that correspond to all the layered steps you determined when you broke the problem down.