Live data from Hacker News

Ask HN: What's the best source code you've read?

news.ycombinator.com

21–30 of 271 posts

Re: Ask HN: What's the best source code you've read?

#22
Contrarian answer: Conway's Game of Life in Dyalog APL https://www.youtube.com/watch?v=a9xAKttWgP4

It feels like the logical end state of "clever" code, for better or for worse. Or, alternatively, what happens when a standard library is gigantic but each keyword is 1-2 characters.

Re: Ask HN: What's the best source code you've read?

#26
post #9

One of the most surprisingly clear code bases is LLVM. It’s an old complex beast, yet it’s organized beautifully. I mean, it has a lot of essential complexity but little accidental complexity. That’s usually what I strive for when coding. Complexity is sometimes unavoidable, that’s fine, that’s why it’s essential. However, avoidable complexity should be… well… avoided.

> a lot of essential complexity but little accidental complexity Nice one. I'll copy that.

That's from "The mythical man-month". Old, and some parts are obsolete, but still worth a read as it does have a bunch of good insights.

Re: Ask HN: What's the best source code you've read?

#27
I quite like the FreeBSD src tree, as it comprises both the system kernel as well as the userland applications. The folders are organized similarly to the OS file system hierarchy, which I find helpful for navigating the source tree. I found it accessible to slowly learn how various parts of the OS work under the hood and compound my knowledge faster due to less context shifting, since it’s self-contained in one source tree.

https://github.com/freebsd/freebsd-src

Re: Ask HN: What's the best source code you've read?

#28
post #9

One of the most surprisingly clear code bases is LLVM. It’s an old complex beast, yet it’s organized beautifully. I mean, it has a lot of essential complexity but little accidental complexity. That’s usually what I strive for when coding. Complexity is sometimes unavoidable, that’s fine, that’s why it’s essential. However, avoidable complexity should be… well… avoided.

> a lot of essential complexity but little accidental complexity Nice one. I'll copy that.

You might be interested in reading the paper, No Silver Bullet, in which Fred Brooks coined these terms:

http://worrydream.com/refs/Brooks-NoSilverBullet.pdf

Post reply on HN