Live data from Hacker News

Ask HN: What code do you frequently read?

news.ycombinator.com

11–20 of 64 posts

Re: Ask HN: What code do you frequently read?

#11
I pretty much read the code for every dependency I use. It helps me understand how it works and what the docs are fibbing about.

If I can't read the code because it's proprietary, I always strace it to see what it's doing.

For me, it makes it easier to reason about the behavior of my program.

Currently my favorite code to read includes: key/value databases written in C and other "lower level" languages, and the golang standard library packages.

Re: Ask HN: What code do you frequently read?

#15
The Stripe bindings (primarily Ruby, Node and PHP). The API docs don't show how to do anything so being able to see what is expected and the format from the function header is very helpful when helping out in IRC. Reading through the pull requests is also helpful in learning / speculating on some new features (this is pretty rare though)

Re: Ask HN: What code do you frequently read?

#16
I re-visit my old code. Due to how I'm constantly thinking about how much better it could have been. Not that I doubt my abilities. Its just that I wish I knew back then what I know now. Not only my coding skills, but about the problem I was trying to solve.

Re: Ask HN: What code do you frequently read?

#17
post #4
post #3

Usually you don't just go read source code for the heck of it. You read the source code either to contribute a feature or fix a bug. There's no point in reading the src otherwise because you won't find a good enough reason to try to fully understand it.

I beg to differ. For example, reading the Go source is extremely useful both to learn idiomatic Go, and for reference.

skimming through the source is one thing, but reading with the intent to thoroughly understand it to a level that you can comfortably modify it is something else.

Re: Ask HN: What code do you frequently read?

#18
Django and Django Rest Framework. DRF docs are pretty bad (though as the saying goes, better than none at all), so I end up reading the code to figure out how to do what I need.

I read Django code when things go wrong or to implement e.g. an auth backend, or see how come get_by_native_key() doesn't always need to take a native key as a parameter.

Post reply on HN