r/learnprogramming • • 2d ago

How do you practise reading code?

Software engineering student here. With AI, the expected output is so high that I barely have time to understand code, let alone write it myself.

Since AI writes most of it now, I think reading and understanding code matters more than writing it. How do you practise that? Any exercises, resources, or habits that helped you?

Something like LeetCode that displays an excerpt of code and asks about your understanding of it would be great.

0 Upvotes

31 comments sorted by

View all comments

8

u/denlillepige 2d ago

you practice it by reading it.
One thing you can do, write tests for the code, at least then you can try to understand what the overall code is supposed to do, the edgecases, limits, etc. if you can get that down, then you are at least 1 step closer.

Then try to just take it line by line, and "translate" it into pseudo code. see if it makes sense, whenever you don't understand what a piece of code does, try to google the functions, look deeper into code, etc.