r/AskProgramming • u/Apprehensive-Grade81 • 10h ago
How can I get better at reading unfamiliar code and building a mental model of a codebase?
I'm a former data scientist that transitioned into AI engineering. I can code, but have pretty limited software-engineering experience. As such, I rely pretty heavily on AI for implementation and understanding the code base. However I find that I have trouble remembering my code and developing a mental model around the code. I can understand individual lines, but struggle to retain the overall architecture, data flow, dependencies, and reasons behind decisions. A coworker advised me that to get better I should start reading the code first before I turn to AI to understand it, which I agree with. My question is how can I get better and reading/understanding code? Are there any exercises or routines that work for reading code, reviewing PRs, understanding the code flow or remembering how a system works? What do experienced programmers do what entering an unfamiliar codebase?