I realized recently that it's been a long time since I looked at anyone else's code outside of the context of debugging or working on it for hire. In your opinion, what are some examples of particularly well-designed or implemented software projects worth looking at to broaden one's own horizons as a programmer?
[+] [-] sriramk|16 years ago|reply
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 should be able to get your hands on the Windows Researh Kernel (http://www.microsoft.com/resources/sharedsource/windowsacade...). This has all the good stuff (and is much easier to build too)
[+] [-] huhtenberg|16 years ago|reply
The overall impression was that it was hacked together in the worst sense of the word. Like there were several teams developing it that did not communicate with each other. Pieces of the kernel are forced together rather than fit snugly by design. I cannot stress enough how mind-boggingly repulsive it was to work with it. And that's not even touching NDIS, the networking module, which can be used for scaring some serious shit out of young programmers.
If you put BSD or Linux code side by side with NT, look me in the eye and tell me that NT kernel is "the most beautiful piece of code you've seen", you will need to see a head doctor.
[+] [-] slackenerny|16 years ago|reply
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 ;>
[+] [-] dtf|16 years ago|reply
[+] [-] anatoly|16 years ago|reply
[+] [-] mahmud|16 years ago|reply
[+] [-] pgbovine|16 years ago|reply
[+] [-] dtf|16 years ago|reply
[+] [-] tmsh|16 years ago|reply
http://bit.ly/131cxL (.doc file)
those help. if you can figure out the source code without the documentation at the agg site + those files, more power to you. but basically you are nuts.
[+] [-] wallflower|16 years ago|reply
http://www.spinellis.gr/codereading/
[+] [-] mbubb|16 years ago|reply
[+] [-] sgoraya|16 years ago|reply
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.
[+] [-] aw3c2|16 years ago|reply
[+] [-] thismat|16 years ago|reply
[+] [-] yesimahuman|16 years ago|reply
[+] [-] lpolovets|16 years ago|reply
[+] [-] bd|16 years ago|reply
http://qt.nokia.com/
And it's not just their code, everything they do is exemplary. It's one extremely well run software project.
See for example their documentation:
http://doc.trolltech.com/
http://doc.trolltech.com/qq/qq13-apis.html
[+] [-] ori_b|16 years ago|reply
The Lua VM's source (http://www.lua.org/source/5.1/)
[+] [-] mmc|16 years ago|reply
And the LLVM compiler is far more understandable than gcc sources: http://llvm.org/viewvc/llvm-project/llvm/
[+] [-] yan|16 years ago|reply
[+] [-] avinashv|16 years ago|reply
[+] [-] mahmud|16 years ago|reply
This is also good, Standard Function Library:
http://legacy.imatix.com/html/sfl/
[+] [-] davidw|16 years ago|reply
[+] [-] jeremyw|16 years ago|reply
[+] [-] geocar|16 years ago|reply
It feels well organized almost throughout, and it's a joy to experience the clarity of thought that went into it. In fact, most of djb's code has a similar feeling to it.
Arthur Whitney's code: http://www.nsl.com/papers/origins.htm
Being able to read this (and not merely decode it, but read it, in a manner similar to how you would read a book) will broaden your horizons like nothing else I've seen.
[+] [-] slackenerny|16 years ago|reply
[+] [-] plinkplonk|16 years ago|reply
The best code I've seen: -
Common Lisp - "Paradigms of Artificial Intelligence Programming" by Peter Norvig and "On Lisp" by Paul Graham
C - "C Interfaces and Implementations" and "LCC- a compiler for ANSI C" both by David Hanson. I also found the code for the Player/Stage robotic sim framework surprisingly readable.
I liked the Scala Actors library code as well.
If any HNers know any great codebases in Haskell or Erlang, please post here.
[+] [-] mbowcock|16 years ago|reply
http://xmonad.org/
[+] [-] jsyedidia|16 years ago|reply
[+] [-] nixme|16 years ago|reply
Similar previous discussions:
http://news.ycombinator.com/item?id=225577
http://www.reddit.com/r/programming/comments/26dyh/ask_reddi...
[+] [-] idlewords|16 years ago|reply
[+] [-] keefe|16 years ago|reply
[+] [-] shabda|16 years ago|reply
[+] [-] axod|16 years ago|reply
[+] [-] davepeck|16 years ago|reply
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree...
[+] [-] revetkn|16 years ago|reply
[+] [-] boucher|16 years ago|reply
Joe tends to do things his own way, which works out fine, but does tend to depart from most people's Cocoa/Touch code.
[+] [-] spokey|16 years ago|reply
[+] [-] biohacker42|16 years ago|reply
--EDIT---
Found it: http://web.archive.org/web/20050315135351/http://nanocrew.ne...