Live data from Hacker News

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

news.ycombinator.com

91–100 of 271 posts

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

#91

I remember liking the java sdk java source. Great small focused functions and nice use of newlines. You could tell the developers were forged in an era without syntax highlighting and large horizontal screens. Extremely scannable.

The Java standard library will forever be my baseline for “good.” Perhaps the C# beats it, but then the overall ecosystem of third-party libraries is such that it isn’t worth the slight improvements in design. Node, by comparison, is a ghetto.

Boolean.getBoolean("true");

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

#92
post #81

Earlier quoted context omitted.

The book "A Deepness in the Sky" features people living on an ship whose operating system is thousands of years old. One of the main characters is considered a software archaeologist of sorts - he's an engineer, but in a sense also a historical researcher. I can't emphasize enough that this notion is only a side point in the story and not a main aspect of the plot, sadly, so I wouldn't go reading it in hopes of heari…

Interesting to note that you’re basically describing the concept of common law.

That actually is interesting to note. I hadn't thought of that.

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

#93
post #78

Earlier quoted context omitted.

The book "A Deepness in the Sky" features people living on an ship whose operating system is thousands of years old. One of the main characters is considered a software archaeologist of sorts - he's an engineer, but in a sense also a historical researcher. I can't emphasize enough that this notion is only a side point in the story and not a main aspect of the plot, sadly, so I wouldn't go reading it in hopes of heari…

> I can't emphasize enough that this notion is only a side point in the story and not a main aspect of the plot Is it sprinkled throughout the story, or a mostly uninterrupted block of text? As in: is there an easily findable chunk of the book one could read for that idea alone? If so and you could provide a few keywords or a direct quote, I’d be interested in grabbing the book to read that.

I just went and glanced over the text by searching a pdf for a few key terms - no, it's really just sprinkled. The idea doesn't get much attention and is mostly mentioned in passing.

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

#94

Bitcoin

That’s absolutely not true. Bitcoin the app is often mixing several layers of abstractions and several usage patterns together. Is it for actually keeping track of money? Is it for APIs? is it for end users, or for servers? Is it CLI or a GUI app? And it’s in C++, which is almost never readable. And of course they have their weird names for everything (all the ScriptSigs etc), and the OP script which is at the same t…

Yes, I would second this. It's hard to rewrite, but needs it in many places that I've read (in particular, the code to detect BIP9 etc soft fork activation is horrible).

To be fair, the slow polishing of a thousand hands continues. libsecp256k1 is tested to a level few if any FOSS libraries achieve, for example.

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

#95
A few that come to mind..

Hand-written compiler for WebAssembly Text format to binary - https://raw.githubusercontent.com/stagas/wat-compiler/main/s...

Gameboy emulator implemented in C, that also runs in the browser - https://github.com/binji/binjgb

QuickJS Javascript Engine - https://github.com/bellard/quickjs

The TypeScript language and compiler - https://github.com/microsoft/TypeScript

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

#96
post #71

I haven’t read all of it, but the Principia source code has a comprehensive units system and makes effective use of Unicode: https://github.com/mockingbirdnest/Principia/ https://github.com/mockingbirdnest/Principia/blob/master/ast... is a decent example of both: // We compute the mean rate (slope) of the mean anomaly M(t), the mean // argument of latitude u(t), and the longitude of the ascending node Ω(t). … Product…

C#?

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

#99
post #71

I haven’t read all of it, but the Principia source code has a comprehensive units system and makes effective use of Unicode: https://github.com/mockingbirdnest/Principia/ https://github.com/mockingbirdnest/Principia/blob/master/ast... is a decent example of both: // We compute the mean rate (slope) of the mean anomaly M(t), the mean // argument of latitude u(t), and the longitude of the ascending node Ω(t). … Product…

C#?

Much of it is in C# so that it can be run inside KSP.

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

#100
I will always have a soft spot in my heart for Django, the python web framework, even though I don’t use it anymore. https://www.djangoproject.com/

When I was still learning to code, I spent hours and hours and hours poking around the Django source code. In particular I was fascinated by the metaprogramming used in the Model and Query objects, and I ended up learning a ton about how Python works under the hood.

Post reply on HN