Quake source code: www.idsoftware.com/business/techdownloads/ From a graphics and game engine perspective, it was very informative to go through pieces of of the source - I was mainly interested in the client/server and collision detection areas of the code.
Ask HN: What source code is worth studying?
61–70 of 117 posts
Re: Ask HN: What source code is worth studying?
#62The Linux kernel: http://miller.cs.wm.edu/
Equally or more valuable than trying and sit down to read the kernel source is to follow the patches and discussions thereof on the linux-kernel mailing list: http://lkml.org/ I've found that doing so a) improves my knowledge of what's going on under the hood tremendously, and b) has taught me a fair bit about how to do code reviews and make difficult design decisions. Studying the kernel itself line-by-line would ta…
Re: Ask HN: What source code is worth studying?
#63Re: Ask HN: What source code is worth studying?
#64I'm going to get downvoted for picking a non-open source option but... The NT kernel is the most beautiful piece of code I've seen. Dave Cutler and team wrote some very, very elegant code that anyone (even if you're not a kernel hacker) can understand. If I need 'code inspiration', I spend some time looking through their code. Now, the NT kernel itself doesn't have source out there but for folks who are students, you…
Re: Ask HN: What source code is worth studying?
#65Re: Ask HN: What source code is worth studying?
#66And it's not just their code, everything they do is exemplary. It's one extremely well run software project.
See for example their documentation:
Re: Ask HN: What source code is worth studying?
#67Your compiler's source code. That should shake your confidence in the world.
for an easier time, your favorite language interpreter's source code ... interpreters are easier to comprehend than compilers, since you can 'follow along' with the flow of execution in the main interpreter loop just like you're executing a program ... e.g., creating stack frames, allocating heap memory, assigning variables, etc.
By contrast Perl makes very heavy use of macros for portability, to an extent that may induce brain lock in many people, and makes your debugger very hard to follow. This is not to say that its use of macros is a bad thing in the end, but it is a definite shock.
Re: Ask HN: What source code is worth studying?
#68Anyone can point to a good javascript code?
Re: Ask HN: What source code is worth studying?
#69I'm going to get downvoted for picking a non-open source option but... The NT kernel is the most beautiful piece of code I've seen. Dave Cutler and team wrote some very, very elegant code that anyone (even if you're not a kernel hacker) can understand. If I need 'code inspiration', I spend some time looking through their code. Now, the NT kernel itself doesn't have source out there but for folks who are students, you…
Modulo Plan9 kernel. It's also lot smaller a read (ca. 50 KLoC and that's it).
NT kernel itself doesn't have source out but for folks who are students
And folks who are hackers should be able to look in certain places to find the leaked version ;>
Re: Ask HN: What source code is worth studying?
#70Quake source code: www.idsoftware.com/business/techdownloads/ From a graphics and game engine perspective, it was very informative to go through pieces of of the source - I was mainly interested in the client/server and collision detection areas of the code.