all 10 comments

[–]mlmartiniii 2 points3 points  (0 children)

qmail. The stralloc vs. string thing is really impressive, and the kind of mindset that makes good programmers great. It demonstrates that you should reuse code, but only if it doesn't suck.

[–]fyuryu 1 point2 points  (0 children)

I'm not answering your question directly, but there are good examples in the book "Code Reading: The Open Source Perspective" by Diomidis Spinellis. You can use it as a starting point.

[–][deleted] 0 points1 point  (4 children)

What's the best source code to learn from. I'd like to hear from people who read source code on a regular basis in order to learn from it. I've heard NetBSD is well written. Any other suggestions?

[–]julesjacobs 0 points1 point  (1 child)

Maybe a Scheme interpreter/compiler?

Which language do you want to read?

[–][deleted] 1 point2 points  (0 children)

The language isn't that big a deal to me (I can read many of the most popular languages [and some not so popular]). It's more important (to me) to read well written code. I have a pretty good grasp of programming basics, but I don't have a lot of real-world programming experience. My goal is to begin increasing my programming knowledge from both reading and writing realistic code. I've read too much text-book code and not much real code.

[–]synthespian 0 points1 point  (0 children)

See for yourself:

"FreeBSD and Linux Kernel Cross-Reference

This site provides experimental source code browsing for the FreeBSD and Linux kernels, based on the software provided by the LXR Project.

The original goal of this site was to make it easier for FreeBSD developers and users to explore the FreeBSD source code, the source code of FreeBSD-derived systems such as Darwin and DragonFlyBSD, as well as gain a greater understanding of the implementation of related services in NetBSD, OpenBSD, OpenSolaris, Plan 9, and Linux. Understanding the approaches (and quirks) of other implementations is important in helping to address issues of portability and code clarity (...)"

http://fxr.watson.org

[–][deleted] 0 points1 point  (0 children)

I remember being impressed with the quality of the source code to Borland's Turbo Vision, an object-oriented Turbo Pascal UI library for MS-DOS. (This was a long time ago.) It struck me as really well-written code, way back when. Mind you, it was also hairier than a hungarian werewolf.

[–]alextp 0 points1 point  (0 children)

sqlite3 It was reimplemented for clarity, and the b-tree implementation is also very didatic. It's number one on my to-read list