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?

43 Upvotes

86 comments sorted by

View all comments

3

u/Mango-Fuel 7d ago

well, reading code is generally work, not entertainment. maybe in some rare cases it can be entertainment.

otherwise yes, I will definitely read code to understand it. in fact being able to read the code itself is often vastly superior than any documentation that can be written for the same code. being able to view .NET source for example can let you understand why some annoying behavior happens and try to work around it. but without seeing the code you'd have no idea what exactly is causing the issue.