DEV Community

Discussion on: Is it worth reading source code?

Collapse
 
iedaddy profile image
iedaddy

It's going to depend on the maturity of the source code libraries and the extent to which you utilize them within your own code.

Personally, I almost never read through the source code when I first start out with a library if it's well established. I'll use it for a project, read through the documentation on how to use it and integrate with my system.

When I do take a dive into the source code, it's generally because there's a bug or some non-standard behavior that is occurring and i need to walk the stack to figure out if it's my code or the library.

But reading through the source code for a well established library just so you understand how to use it is probably overkill assuming they've got some decent documentation or examples.

It does make sense to start reading through the code if it's a less well known library, or something that may be untrusted, or it does things and you want to figure out how it was done, or if you're curious about how they've structured their code. There are lots of good reasons to spend the time peeking under the hood, but it's generally going to be overkill if you just want to be able to use some of the basic functions stored in that library or framework.

Collapse
 
dmfay profile image
Dian Fay

This -- documentation exists so you don't have to read the source.