3 ms·
I don't think there is such a thing. Learning about common algorithms is a good idea but programs aren't novels. People pay a lot of lip service to reading co
by emodendroket 9y ago
I don't think there is such a thing. Learning about common algorithms is a good idea but programs aren't novels. People pay a lot of lip service to reading code but practically nobody does it.
http://www.gigamonkeys.com/code-reading/ http://www.gigamonkeys.com/code-reading/
- dmartinez 9y agoWow, this was a great read. I wholeheartedly agree that very few people read source at a deep level, but your link explains why. We should read source code sometimes (maybe) to deepen an understanding of how someone might think about the problem differently. In the link, Donald Knuth says he enjoyed the challenge of exploring a piece of software that had no documentation in order to figure it out. In light of this, my answer to "what code should people read" is that you should read (really, decode) the source code of libraries competing to solve the same problem. This would lead to the greatest yield in terms of uncovering core shared concepts and core unique concepts. You could compare Vue and React to understand how two different parties thought about componentizing the front-end. Or you could compare Django and Flask to see how a batteries-included MVC framework compares to a lighter alternative.
- travmatt 9y agoI disagree in part, I read lots of code. Typically if I don't know how to solve a problem / use a library, I'll go onto github and search out projects either by their dependencies or structures I know must be present in the code I want. Then I'll pick out 20-30 projects and compare and contrast. Funnily enough, I read most all of the source code to Etsy's 'Artsy' iPhone app because I wanted to get a sense of how a professional shop structured their iPhone code. As for the understanding the code, the author is very correct in that it's tough to implicitly understand what's happening in the code. But to that point I use Reveal to peek inside iPhone apps, or node-nightly + chrome devtools to walk through js code. Since my goal isn't to understand the whole of a program, rather parts I'm interested in, it's worked out quite well. I've always wanted to read code for very secure applications (like Signal or SecureDrop), but I fear I don't understand crypto/infosec enough to understand the context the code was written in.
- emodendroket 9y agoI don't know, perhaps my perspective is warped by starting in Windows development, but I pretty much never do anything like that to evaluate a library.
- collyw 9y ago(Almost) any project that is in maintenance mode requires a lot more reading of code than writing.
- emodendroket 9y agoReading existing code with a view to modifying it isn't really what people mean when they say you should "read code."
- collyw 9y agoit was a response to "nobody actually does it".