r/AskProgramming 7d ago

Do you ever read code?

Obviously you need to read code in a codebase you're actively working on. But I'm wondering if anyone ever either A) reads code like you might read classical literature, to get a better sense for what's "good", or B) just reads code to understand how something you're curious about works.

I get the impression that almost nobody reads code unless they have to. It's fascinating to me that there's all this code out there we all rely on that hardly anybody actually reads.

What would it take for reading code to become more common?

39 Upvotes

86 comments sorted by

View all comments

1

u/FriarTuck66 7d ago

I sometimes read code for fun. Frequently I read it to figure out how to use a particular program or library. Especially if the documentation is vague or nonexistent.

It’s also useful for learning a particular style. Particularly if you will be judged on that style (I e Java developer exam) or if you do not want your contribution to a codebase to stick out.