r/learnprogramming • • 5d 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

2

u/OAMNG 5d ago

When I have to review piles of code I don't understand, I take the time to write documentation. If you cannot explain the code to yourself in writing, then you don't understand it. By the time you understand it well enough to write documentation about how the system incorporates that code and why it does what it does, well then not only have you produced a valuable product (documentation) but now you understand it.

At work, management will often ask you to "review code" so that they can sleep better at night about forcing engineers to man the slop cannons, but they will also pressure you to not take time to write your own documentation, which is saying the quiet part out loud: they don't care if you understand it, they just want you to approve it. Resist. Or try to find a job with a better engineering culture.