DEV Community

Discussion on: Is it worth reading source code?

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

I read source code a good bit. I often look at a library's source code because I want to make sure it operates under the constraints I assume that it would. Otherwise it could affect how I call the code. (IMO, this is not a good sign when I need to know how it works to make sure I use it properly. Yet I need to do that regularly.)

The last thing I recall really trawling thru code for was in ASP.NET Core. I was looking for what the [Authenticate] attribute does precisely. I found code that I suspected was called, but never actually found a direct link from the attribute into that code. Yay meta programming.

Anyway, you probably don't have to read the source code. The alternative -- if the documentation is not clear -- is to figure out how it works experimentally. Try using it different ways and see what happens.

Collapse
 
joshcheek profile image
Josh Cheek

Last paragraph is legit.