Live data from Hacker News

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

news.ycombinator.com

141–150 of 271 posts

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

#141
post #7

Well, eye opening was the C++ source code I was able to work with at a previous company, they were an automotive HMI developer company. They had really strict and well planned code structure that just hit a chord with me. Can't provide source though on that one, as it's a propietary engine. Recently I've enjoyed reading the source code to Sokol, lot's of really good decisions there and I love the minimal C -style str…

Nix source code is also a pleasure to read through. I was surprised that c++ could be so beautiful and well written.

C++ gives you an enormous amount of rope to hang yourself with, but it’s also an highly expressive language.

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

#143
post #79
post #26

Earlier quoted context omitted.

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.

I have not read it in a while but it would be interesting to debate what essays are no longer relevant. I'll be grabbing it off the shelf next to my original copy of the Byte issue on C mentioned yesterday and having a look for expired relevancy.

There are some sections about physical copies of documentation and managing the logistics of that when I read it.

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

#144
I wish there was a website like a code wall where you could see great code snippets and comments on why they are so great. Would be like a code museum. If anyone remembers the old coffee script source code with the explanation on the left, it's something like that I had in mind.

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

#145

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.

I also came here to mention this video. Watching the solution emerge line-by-line is a profound experience, and highly revelatory towards the kind of iterative problem-solving workflow possible in the Iversonian languages.

In the same vein, John Scholes' collection of APL code in the Dfns workspace[0] is positively wonderful to read through. I think it's probably one of the finest repositories of annotated code ever assembled.

[0]: http://dfns.dyalog.com/

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

#146

I like the TypeScript compiler source (in TypeScript.) It's clean, easy on the eyes with well placed white space and just the right amount of comments. https://github.com/microsoft/TypeScript/blob/main/src/compil...

And the type checker is a single 45k line file! https://github.com/microsoft/TypeScript/blob/main/src/compil...

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

#148
post #123
post #79

Earlier quoted context omitted.

I have not read it in a while but it would be interesting to debate what essays are no longer relevant. I'll be grabbing it off the shelf next to my original copy of the Byte issue on C mentioned yesterday and having a look for expired relevancy.

I haven't read it in a while either, but from memory the team organization of one "architect" and a bunch of implementers seems obsolete, for example.

Imho it's more relevant than ever, with the influx of cheap offshore remote developers

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

#150
post #141
post #7

Earlier quoted context omitted.

Nix source code is also a pleasure to read through. I was surprised that c++ could be so beautiful and well written.

C++ gives you an enormous amount of rope to hang yourself with, but it’s also an highly expressive language.

Nix doesn't use most of C++ features though. It's just the way project was organized and code was formatted that it looked beautiful and easy to skim through.
Post reply on HN