Ask HN: What source code is worth studying?
81–90 of 117 posts
Re: Ask HN: What source code is worth studying?
#82Re: Ask HN: What source code is worth studying?
#83Earlier quoted context omitted.
This really depends on the language. Ruby's code is (or at least was) quite nice. It is pretty much OO written in plain C. 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.
Yeah, after hacking with perl for a while, i got interested in how it worked under the hood, and had some trouble following. Check out the regex compilation module: http://cpansearch.perl.org/src/GBARR/perl5.005_03/regcomp.c And execution: http://cpansearch.perl.org/src/GBARR/perl5.005_03/regexec.c
Re: Ask HN: What source code is worth studying?
#84Any recommendations for good C# code? Much of the web is open source oriented so I don't hear too much about great C# code.
(disclaimer: I'm one of developers)
Re: Ask HN: What source code is worth studying?
#85Any recommendations for php? I wrote a php/mysql web application for SaaS customers. I am looking at ways to improve performance/cache/error handling or simply write a better code.
There's a lot of excellent PHP code in the Horde Project's repository: http://cvs.horde.org/
Re: Ask HN: What source code is worth studying?
#86Re: Ask HN: What source code is worth studying?
#87Earlier quoted context omitted.
I agree with this, and along the same thought, OpenBSD (or any BSDs really, but OpenBSD tends to favor simpler implementations) source is very clear and concise.
Minix, not being as 'real world' as the BSD's or Linux, is even more readable, if you're just interested in a quick glance at how an OS works.
Re: Ask HN: What source code is worth studying?
#88Earlier quoted context omitted.
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.
Squeak Smalltalk. For Java, if you can get hold of it, the old Acme Webserver. That was very clean code.
Re: Ask HN: What source code is worth studying?
#89Re: Ask HN: What source code is worth studying?
#90Quake 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.