
Code Reading
by Diomidis Spinellis · first published 2003
21mentions
11recommended by
18HN commenters
2009–2026first – last mentioned
61% recommend33% neutral6% critical
Why HN recommends it
Annotated walkthroughs of real industrial systems code, mostly BSD, that teach the skill of reading unfamiliar code. Recommended for working engineers and anyone learning how large Unix-style codebases fit together.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…try to make your version changing small bits at a time. https://github.com/redis/redis/tree/unstable/src Entry point here at line 6816: https://github.com/redis/redis/blob/unstable/src/server.c Also "Code Reading" will be useful. - https://www.amazon.com/Code-Reading-Open-Source-Perspective/... "Code Reading" tends to be criticized, but I think mostly unfairly.
on “Ask HN: Best book to learn C in 2022?” ↗The impression I got from "Code Reading" by Diomidis Spinellis is that NetBSD is fantastic for learning the internals of a real UNIX. The emphasis has always been on correctness and clarity first.
on “Donate to The NetBSD Foundation” ↗You may want to look at the book 'Code Reading' ; it's been a while, and I gave away my copy, but it was useful http://www.amazon.com/Code-Reading-Open-Source-Perspective/d...
on “Ask HN: What source code is worth studying? ” ↗I can't recommend this book enough: Code Reading: The Open Source Perspective by Diomidis Spinellis. See also https://news.ycombinator.com/item?id=21006995 for several others.
on “I love coding in C” ↗In the vein of working effectively with legacy code, "Reading Code" by Spinelli taught me a lot when I was a younger engineer https://www.amazon.com/Code-Reading-Open-Source-Perspective/... (Amazon says I bought it 14 years ago!)
on “On the shoulders of the giants” ↗I just skimmed the article, but a more comprehensive text on acquiring the skill to read code is the book Code Reading, from Diomedis Spinelli [1]. [1]: https://www.amazon.com/Code-Reading-Open-Source-Perspective/...
on “Reading code is a skill (2020)” ↗It's a bit older, but Code Reading: The Open Source Perspective, by Diomidis Spinellis, is my go-to. <https://www.spinellis.gr/codereading/>
on “Ask HN: How do you learn to read open source code bases?” ↗…timeless or that will change your life as Engineer. But always though they do not deserve the low ratings, and that as an author, he is very unfairly judged. So I am adding these three to this thread. "Code Reading: Open Source Perspective" - https://www.goodreads.com/book/show/529511.Code_Reading "Code Quality: The Open Source Perspective" - https://www.goodreads.com/book/show/169414.Code_Quality "Effective…
on “Ask HN: Top 10 Timeless Software Books That ChangedLife as Software Engineer?” ↗A good book on this topic is "Code Reading", by Diomidis Spinellis (2003)
on “Ask HN: How Do You Navigate Code?” ↗Great example. About a clever technique. And implementing it in the author's own code. Check out Dr. Spinellis' Code Reading: "Code reading requires its own set of skills, and the ability to determine which technique to use when is crucial. In this indispensable book, Diomidis Spinellis uses more than 600 real-world examples…
on “Studying open-source code brings immediate benefits to your own code.” ↗Diomidis Spinellis has written two books (Code Reading and Code Quality) on this subject that take you through annotated examples of industrial strength systems code (mostly from BSD IIRC): http://www.spinellis.gr/codereading/
on “Ask HN: What source code is worth studying?” ↗…Greece right now can lead to bad reputation I think (of course the state of the economy is not his fault) :) Diomidis Spinellis is an alpha geek and a great scientist. He has written great books such as Code Reading, Code Quality and he is also a FreeBSD committer.
on “What I Learned From Fixing my Laptop's Motherboard” ↗What a great surprise (but not shocking) to see it's a work of the author of "Code Reading: The Open Source Perspective" [1]. [1]: https://www.spinellis.gr/codereading/
on “Documented Unix facilities (across 93 major Unix releases)” ↗…easiest to get off the ground with for a beginner as well, so it's also a good starting point. NetBSD is the one whose source you should study. The emphasis is on correctness and portability. The book Code Reading by Diomidis Spinellis used mainly examples from NetBSD even though he is a FreeBSD developer, because (he implies) the code is easier to read. OpenBSD forked first and developed a reason to exist second;…
on “OpenBSD 5.1 released” ↗I started reading this book, but lost interest pretty quickly. Maybe you'll like it if you give it a shot: https://www.amazon.com/Code-Reading-Open-Source-Perspective/... Effective Java by Joshua Bloch has code snippets that are very well-written, as are the examples in The Go Programming Language by Donovan et. al. I read practically all the…
on “Ask HN: Courses explaining well-written codebases?” ↗