Asking people what they've read "just for the heck of it" is the wrong question, because code is not linear, so it's extremely ungainly to read without purpose.
But as soon as the skilled code reader has a purpose in mind -- a question to answer -- he or she can rapidly find a meaningful narrative. Put into that context, programmers read code constantly, and the more they read the better they get.
So I don't like the "nobody actually reads code" claim. It's a strawman. When I tell people to read code, it's always in the context of "pick something you want to understand or fix, and read with that purpose in mind." Not "the Linux kernel is like Moby Dick, you should really read it all."
Agreed. It's more like dense technical writing than literature.
That doesn't mean that reading it is any less important, or that writing readable code is any less important, or that code is all an ugly mess not worth reading.
It may mean that the reading pattern for code might not lend itself toward a reading group in the same way that literature does. So we might need to either spend more time reading code in solitude or develop new ways to do reading groups that work for this style of writing.
And it just seems plain ridiculous to say that people don't spend time reading code. People do read code, but they don't think about it as "reading" in the same way as someone reads a book, so they don't have it readily at hand when asked.
Yes I agree. But, for myself, even (or especially) with a purpose I mind, I decode, not read per se. I've recently been working through the selfoss source and adding some new features, and this is the tack I've taken through it -- decode the source to find where the feature should be added. So I agree with you, and the OP.
I think that asking "what repos have you cloned just so that you could look at something, not intending on actually building or using that particular code" is probably roughly analogous to asking "what Wikipedia pages have you read recently" I frequently do both of those for the same reasons.
I might pull up the wikipedia page for the Apollo Lunar Module because I suddenly realize that I don't know how the RCS thrusters on it work, or I might clone git's repo because I suddenly realize that I don't know how git-notes is implemented.
In either case, I don't read the whole thing (and certainly not straight through in a linear manner, like I read Moby Dick), but rather I'm going to grep/ctrl-f to the part that I'm interested in, then probably jump around a dozen or more times until I am satisfied. That's still reading though.
You just made me realize that github needs better search. I like the presentation on github but, without git grep, I just pull it local and read from there.
But as soon as the skilled code reader has a purpose in mind -- a question to answer -- he or she can rapidly find a meaningful narrative. Put into that context, programmers read code constantly, and the more they read the better they get.
So I don't like the "nobody actually reads code" claim. It's a strawman. When I tell people to read code, it's always in the context of "pick something you want to understand or fix, and read with that purpose in mind." Not "the Linux kernel is like Moby Dick, you should really read it all."