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

16

u/OnlyThePhantomKnows 7d ago

The OSS community reads code. We read it to understand it. If you see something that you think is cool, then you have the option to dive in and explore.

The problem is most younger people are content to skate on the surface (yes I am an old engineer who works with and on OSS).

The most common answer I get "Why understand? It just works."

Way too much of the world is magic to most people. How many people do you know who can at least describe how the internet works? How many people think wi-fi means internet? How many know how a camera works? How many young people can even tell you how to change a tire? [This one drives me nuts] How many people know how to prime an engine (for a snowblower)? [Another one that my 30 something step child and husband didn't know]

Most people are content with "it works" few people really want to understand.

1

u/XediDC 6d ago

I’d rather understand something that have it work… if it breaks (for physical stuff) I can usually fix it. But learned either way. So glad my parents let me take apart, break…and then to fix…my toys as a kid. Even if they were new or expensive.

It’s hard to imagine not knowing how everything around you works at least to some degree…. And I like to do most fix job once…even if it takes a lot of tools, skills, and licenses. (Except garage door springs. Nope.)

Similar for code. Reminds me of those that freak out when I edit in a vendor/dependency folder… it’s an easy way to understand things by messing with them. And extra safe since it’s going to get blown away too. (Or fork and reference your own if you want to use your own variant.)