Read Great Programs

PeterNorvig wrote a book, ParadigmsOfArtificialIntelligenceProgramming, which is based on the notion that programming is literature, and no serious writer would try to write without first having read many, many SoftwareMasterpieces. Thus, in this book, he takes us on a tour of some deeply influential programs. This is used to communicate ideas about algorithms, style, efficiency, all unobtrusively hidden behind following a fascinating story written in code.

The thesis is therefore: to become a great programmer, you need to ReadGreatPrograms.

(This is delightful with Norvig's book, but "in the wild" you might need some TipsForReadingCode.)


I discovered this for myself, many years ago, by reading the elisp sources of emacs... anybody else have similar experiences?

Linux kernel sources taught me a lot about C. Ignore the drivers, head for the core stuff. Glibc used to be good before it got so polluted by the threading / reentrant mess.


This is sage advice. The payoff of reading great code -- even mere good code -- is huge early on. But at some point the payoff surely dwindles.

Why do you say that? Great creative musicians don't create in a vacuum. No matter how great they get, they still constantly absorb inspiration from what other musicians are doing. Programming might be different, but it's not as if one day you will read your nth program and then have 'finally learned to program'.

Let me produce a different analogy than writing. If I studiously watch great athletes, I will learn a great deal about a sport. As I engage in the sport myself, I will improve through practice. At some point, I gain less from watching others than by taking that same time to practice or play.

But, as you play more, and improve your own skills, you also improve your ability to understand the finer points of what others have done - great athletes not only practice their sport, but also observe (or their great coaches observe) other great athletes to see what they can learn from them with their current understanding.

As in all things, each of us must find a balance uniquely our own, Grasshopper.
Whilst this is good advice it's not very helpful without a list of GreatProgramsToRead. What programs exist (in any language) that are considered great and where the source code is available for people to learn from? -- AdewaleOshineye

Start with ParadigmsOfArtificialIntelligenceProgramming, the book that inspired this page. It's great.
See Also: TeachYourselfProgrammingInTenYears

EditText of this page (last edited July 27, 2012) or FindPage with title or text search