Please provide a link, if possible.
Ask HN: What's the best source code you've read?
1–10 of 271 posts
Re: Ask HN: What's the best source code you've read?
#2(see also the "Virtual Machines" book by Smith and Nair, ISBN-13 978-1558609105, if you are interested in this topic).
I can also recommend John Lions' "Commentary on the Sixth Edition Unix Operating System" - https://warsus.github.io/lions-/, Douglas Comer's Xinu (https://xinu.cs.purdue.edu) as well as Niklaus Wirth's "Compiler Construction" (https://people.inf.ethz.ch/wirth/CompilerConstruction/Compil...) and Project Oberon (http://www.projectoberon.com).
Re: Ask HN: What's the best source code you've read?
#3Re: Ask HN: What's the best source code you've read?
#4Can'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 structure:
Re: Ask HN: What's the best source code you've read?
#5Re: Ask HN: What's the best source code you've read?
#6Re: Ask HN: What's the best source code you've read?
#7Well, 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…
Re: Ask HN: What's the best source code you've read?
#8Re: Ask HN: What's the best source code you've read?
#9I 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.
Re: Ask HN: What's the best source code you've read?
#10I also remember how Qt UI code and docs were a revelation after the nightmare of win32 and related frameworks.
Bellard's original Tinycc was very entertaining and took a while to digest.
Most old and well-maintained projects are worth learning from.
Apart from some local tips and tricks what is more important is understanding that there's nothing special about other people's code.