News for hackers. Stuff that matters.

Ask HN: Most enjoyable source code to read?

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.

( 10 comments | 8 points | on HN )
Re:Ask HN: Most enjoyable source code to read? by beliu on Monday February 11, 2019 @01:29PM (#19136859)
The Caddy webserver is a very nice (and practically useful) codebase: https://sourcegraph.com/github.com/mholt/caddy@master/-/blob...
Re:Ask HN: Most enjoyable source code to read? by pootsbook on Monday February 11, 2019 @04:34AM (#19133128)
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

Re:Ask HN: Most enjoyable source code to read? by snazz on Monday February 11, 2019 @02:40PM (#19137549)
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

Re:Ask HN: Most enjoyable source code to read? by cperciva on Monday February 11, 2019 @06:08PM (#19139414)
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.
Re:Ask HN: Most enjoyable source code to read? by snazz on Monday February 11, 2019 @07:08PM (#19139791)
I just realized I typo-ed your name and am past the editing period. Whoops!
Re:Ask HN: Most enjoyable source code to read? by misiti3780 on Saturday February 09, 2019 @04:04PM (#19124625)
I like to look and Django + Sentry source code for (if you like python)
Re:Ask HN: Most enjoyable source code to read? by MasterIdiot on Saturday February 09, 2019 @08:00PM (#19125758)
also flask, pretty simple and very lean.
Re:Ask HN: Most enjoyable source code to read? by hackepeter on Sunday February 10, 2019 @05:41PM (#19130571)
Golang‘s standard library code.
Re:Ask HN: Most enjoyable source code to read? by badrabbit on Saturday February 09, 2019 @04:12PM (#19124673)
Suricata's C code probably.
Re:Ask HN: Most enjoyable source code to read? by navyad on Monday February 11, 2019 @03:30AM (#19132857)
python library called requests.