Hacker News new | comments | ask | show | jobs | submit login
Ask HN: Most enjoyable source code to read?
8 points by uptownfunk 6 days ago | hide | past | web | favorite | 10 comments
I don’t mean the ones with jokes or puns in the comments, I mean from a code readability and overall code elegance standpoint.. which repos / source code did you find most pleasant to read?

For example I recall someone mentioning some code written by Terry Tao and that it was very easy to understand and enjoyable to read.

The Caddy webserver is a very nice (and practically useful) codebase: https://sourcegraph.com/github.com/mholt/caddy@master/-/blob...

Michel Marten’s code is some of the beautiful code I have ever had the pleasure of reading. His “less code” philosophy is almost an art form—even down to the naming of his libraries. They are all small, focused libraries dedicated to solving one particular problem. The best bit is that they are all tiny, sporting less than 500 SLOC. Browse his GitHub profile to get a taste. [1]

He is probably best known for his Ruby libraries Ohm and Cuba, but I enjoy using Syro and Mote.

[1] https://github.com/soveran

cpervica’s Tarsnap source code[0] is considered[1] to be worth reading as a good example of how to structure, document, and organize portable C.

[0]: https://github.com/Tarsnap/tarsnap

[1]: https://news.ycombinator.com/item?id=7602457

Thanks! I'd recommend the spiped source code (https://github.com/Tarsnap/spiped) rather than the Tarsnap code though -- tarsnap is built around libarchive, which (while it's still great code) is not organized the same way as the code I personally write.

I just realized I typo-ed your name and am past the editing period. Whoops!

I like to look and Django + Sentry source code for (if you like python)

also flask, pretty simple and very lean.

Golang‘s standard library code.

Suricata's C code probably.

python library called requests.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact