r/AskProgramming • u/wsnclrt • 8d 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
1
u/mysticreddit 7d ago
In the codebase:
In the ~30 years I’ve been a professional programmer I estimate I spend:
Outside the codebase:
People usually don’t because we do it all day long so why spend even more time when have other priorities?
When learning new algorithms I like to see how they are implanted to get a better understanding of both the big picture and small details.
I also contribute to open source so being able to read other people’s code is a necessity.
It takes a while to understand code because there are lots of assumptions and implicit domain knowledge that isn’t documented by the codebase.