HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))

Andy Oram, Greg Wilson · 1 HN points · 9 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))" by Andy Oram, Greg Wilson.
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
How do the experts solve difficult problems in software development? In this unique and insightful book, leading computer scientists offer case studies that reveal how they found unusual, carefully designed solutions to high-profile projects. You will be able to look over the shoulder of major coding and design experts to see problems through their eyes. This is not simply another design patterns book, or another software engineering treatise on the right and wrong way to do things. The authors think aloud as they work through their project's architecture, the tradeoffs made in its construction, and when it was important to break rules. Beautiful Code is an opportunity for master coders to tell their story. All author royalties will be donated to Amnesty International. tion.
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
During my undergrad I semi-randomly picked out "Beautiful Code" [0] from our university library. Not sure why it never features in such lists but I thoroughly enjoyed it. :)


+1 I really enjoyed these books. I wish there were more books in this series
I really love this book. Beautiful data and beautiful visualizations are also nice reads, but beautiful code has a special place in my heart.
I thought I had seen it before. Verified you can actually see the whole chapter in a nicer (book vs web) layout in Amazon's "Look inside" feature since it's at the beginning of the book.

Nov 14, 2019 · kybernetikos on Build Your Own React
I have once already:

I liked it, but I'm not going to be paying for this sort of thing often. I think a lot would hinge on having content that was high quality, and being able to persuade me that it would be high quality before I paid for it might be challenging.

Thank you very much, challenge accepted
Apr 11, 2014 · olalonde on HMO: Help Me Out
> How to write English (non-native language)

I suggest writing a blog in English. Practice is probably the best way to learn. There is also if you have specific questions.

> Program well in c in userspare (Currently reading 'The Linux Programming Interface')

In my experience, reading other people's code is the best way to get better at a language. I don't have much experience with C but I guess there are a few projects that would be interesting to read here:

Relevant links:,

> Embedded development (I don't even know where to start that one...)

I am currently learning embedded development (maybe we could help each other?).

> I am currently learning embedded development (maybe we could help each other?).

I would love to!

And thanks for the links, I will try/read them.

For those who don't know, this is Rob Pike's chapter of Beautiful Code, a thoroughly enjoyable book: . Every now and then I read a different chapter, and it's always interesting. I particularly liked Rob Pike's one, and the one about Python's dictionary implementation.
Ah, and Jon Bentley's chapter about quicksort, along whose lines there's a (also very interesting) Google Tech Talk:
This code is beautiful, but it's also busted [1] -- albeit only for extraordinarily pathological input. As to whether this ultimately dents its beauty is up to the beholder, presumably; for me personally, I confess to suffer from a utilitarian sense of beauty when it comes to software -- for me, broken code can't achieve absolute beauty.


I believe Kernighan acknowledged that: "[snip] The depth of recursion is no more than the length of the pattern, which in normal use is quite short, so there is no danger of running out of space. [/snip]".

If you're going to judge this code based on both pathological haystacks but also pathological needle regexs, then you have to admit that this code, which has linear space usage in the pattern length is far better than PCRE, which has exponential time in the pattern length[1].

Considering its succinctness, I find that pretty impressive.


You might be interested in

I believe one of the examples they gave in C was the diff algorithm from Subversion.

Feb 05, 2011 · lukesandberg on Delta Debugging
Chapter 28 in Beautiful Code ( talks about delta debugging, how it was invented and developed. its really a great chapter in a great book. i can't recommend it enough.
This chapter actually has a much cooler implementation of delta debugging that what has been discussed here. We're generally thinking of delta debugging in which we take the changes to the source as the search space and use some form of binary search to find the offending change (for which git bisect is great). The chapter in beautiful code begins with this but then moves on to runtime delta debugging in which the techniques are used to compare the memory in use by two instances of the program (one buggy and one not) until a specific piece of the programs state can be isolated as the cause.
I've heard this book was good It asks 30 different developers for pieces of beautiful code. I read an excerpt or two back when it was released and put it on my to read list. Unfortunately haven't gotten to it yet, but still plan too.
Have a look at the book 'Beautiful code'

Thanks but I already know that book. It's great yet I'm specifically interested in real code bc a book and real code is probably something very different... ;)
May 15, 2007 · 1 points, 2 comments · submitted by mf
Looks like it's coming out in June
Good looking out. I totally missed that. I thought I read January 2007. Are you familiar with any of the contributors?
HN Books is an independent project and is not operated by Y Combinator or
~ [email protected]
;laksdfhjdhksalkfj more things ~ 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.