Ask HN: What's the best source code you've read?
161–170 of 271 posts
Re: Ask HN: What's the best source code you've read?
#162Earlier quoted context omitted.
The 7th circle of hell is my own from 3 months ago. I can't even blame someone else for the tragedy.
I think my code is regressing: C++ from 14 years ago: https://github.com/vlofgren/tunguska/blob/master/tunguska_3c... A career of Java development later, and the code I wrote yesterday looks like this: https://git.marginalia.nu/marginalia/marginalia.nu/src/commi... My old code was so tidy. Can't believe I wrote code like that. Although back then I think I mostly used vim. Not having any sort of IDE tooling does sort…
> Not having any sort of IDE tooling does sort of tend to force you to be a lot clearer about what you do.
True, but then I wouldn't be able to play whack-a-mole with pointer symbols during weird code-pairing exercises.
Re: Ask HN: What's the best source code you've read?
#163Similar with Notch's Left4KDead, which implemented a fun zombie game for a Java small-code competition. A mirror of the original source is here (https://github.com/codingcampbell/Left-4k-Dead). I rewrote it in JavaScript as a Chrome App, in the process refactoring for readability (and sacrificing some of the code's beauty). https://github.com/sowbug/ChromeLeft4kDead
Re: Ask HN: What's the best source code you've read?
#164I 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.
Python is easy to write but writing it "right", in a way that doesn't compromise performance, is a thing.
Re: Ask HN: What's the best source code you've read?
#165This might be pretty controversial, but the Chromium source code has been a pleasure to work with for a few years. I was working on a proprietary fork of Electron and it was a delight to work with that code base vs some of the in house code I integrated into it. The web code search was also awesome to use. https://cs.chromium.org/
Re: Ask HN: What's the best source code you've read?
#166I thought I wrote good Perl code until I read the Perl core modules. Like night and day. Busybox and uClibc are great examples of efficient C code. I submitted a feature, and they basically rewrote it to be less crap, and that taught me a ton. Hard to know what good Python code is. Everyone seems to use some framework that fundamentally changes how you write apps. "best source code" is probably just what's best for t…
For some reason the 2nd and subsequent editions of the O'Reilly Perl book completely altered the layout and presentation that Larry Wall had set up. The first edition of Programming Perl is the most *lucid* programming book I've ever read.
Re: Ask HN: What's the best source code you've read?
#167This might be pretty controversial, but the Chromium source code has been a pleasure to work with for a few years. I was working on a proprietary fork of Electron and it was a delight to work with that code base vs some of the in house code I integrated into it. The web code search was also awesome to use. https://cs.chromium.org/
Why is that controversial? Chromium is often cited as a well-written large codebase.
I've also seen a talk at CppCon (2019 I think) that spoke somewhat negatively about the code base. Can't find the reference, sorry.
Re: Ask HN: What's the best source code you've read?
#168I 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.
Re: Ask HN: What's the best source code you've read?
#169Nobody has mentioned Knuth’s corpus of work in Pascal-Web for the TeX ecosystem. This is code written for an era where there wasn’t an ecosystem of libraries for common tasks and even things like being able to access a file in random access order couldn’t be counted on. Even 7-bit ASCII couldn’t be counted on as a given (EBCDIC-based IBM mainframes were a significant element of the computing landscape still). Against…
I intend to make a post about my experience.
Re: Ask HN: What's the best source code you've read?
#170I was responsible for the Turbo C (later Borland C/C++) run-time library in the late 80s and early 90s. Tanj Bennett created our original 8087 floating point emulator. It was real mode, 16-bit code, that kept an 80-bit float in five 16-bit CPU registers as a working value during its internal math calculations. If you ever coded for the PC you will appreciate just how precious register space was on the 8086/8088. It's…