HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
Code Reading: The Open Source Perspective

Ross Venables, Diomidis Spinellis, John Fuller · 9 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "Code Reading: The Open Source Perspective" by Ross Venables, Diomidis Spinellis, John Fuller.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
This book is a unique and essential reference that focuses upon the reading and comprehension of existing software code. While code reading is an important task faced by the vast majority of students, it has been virtually ignored as a discipline by existing references. The book fills this need with a practical presentation of all important code concepts, form, structure, and syntax that a student is likely to encounter. The concepts are supported by examples taken from real-world open source software projects. The focus upon reading code (rather than developing and implementing programs from scratch) provides for a vastly increased breadth of coverage.
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
Start by reading Redis code, slowly take notes on paper, 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.

_osorin_
Thanks a lot for the recommendation.
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 code in Effective Java, and a lot of the examples in The Go Programming Language (I keep dipping into this book every now and then as I have to learn some aspect of Go, which I use at work; I think I may actually sit down and read this book cover-to-cover and perhaps play with most of the examples).

If you know C, you may want to give the examples in The C Programming Language by Kernighan et. al a go. The examples are written in a bit of an archaic dialect but still very clear.

Another book of note that is funny and engaging (but of course not something that has professional value) is If Hemingway Wrote Code by Angus Croll: https://nostarch.com/hemingway. I think I have read all of the code in this book.

pamelafox
I like “Effective Python” similarly, though its more about micro codebase decisions than macro (architecture) decisions.
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/...

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!)

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...

Not a specific codebase, but I went through "Code Reading"[0] many years ago, I found it interesting. Most reviews are not very positive though, so maybe it was just at the right point for me.

[0] http://www.amazon.com/Code-Reading-Open-Source-Perspective/d...

Hmm, tough question to google but: I was going to blog about but: didn't get around toit. Look at static code analysis and runtime tools (debuggers) there's SO tags for that, python+code-analysis.

http://stackoverflow.com/questions/3883484/using-python-code...

Python has a very rich toolset, including inspect module,

http://stackoverflow.com/questions/1568544/given-a-python-cl...

http://code.activestate.com/recipes/213898-drawing-inheritan...

Also (this thread)[http://stackoverflow.com/questions/334009/how-to-read-source...] mentions ctags, doxygen, tools like that. Reading test suites (and running code coverage) is where a lot of people start with new to them codebases. And python specific emacs and vim plugins, and python-specific IDE's, komodo and pycharm, at the tools they provide for folding code, showing module dependencies/call graphs, stuff like that

---------

My python's a little rusty, but could generate stacktraces, or use an IDE's stepper/debugger to show where you are at some point in execution of django code

-----------

Finally [a book](http://www.amazon.com/Code-Reading-Open-Source-Perspective/d...)

You need this book, it's excellent: http://www.amazon.com/dp/0201799405 .
r11t
Thanks for sharing the link. The content of the book sounds useful to learn the art of reading code.
GeneralMaximus
+1 for this book. It starts with diving into simple UNIX tools (echo, wc) and then moves to more complex programs such as Apache. It does not tell you the way to read code, but it has several nifty techniques that any developer diving into a huge codebase might like to know.
HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.