Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Before you say it: yes, this "question" has been asked other times. However, I could not fine many of such questions and not that easily, and those I found had similar results. What I'm trying to say that there are no comprehensive lists of well written Open Source projects, so I decided to set some requirements for the entries (one or possibly more):

  • Idiomatic use of the language in which they are written
  • The project should be lightweight. Not as in "a few kbs", as in "clean" and possibly following the UNIX philosophy, making an efficient use of resources and performing its duty and nothing more. No code bloat, most importantly. Projects like Firefox and GNOME wouldn't qualify, for example.
  • Minimal reliance on external, non-standard libraries, with exceptions for some common FOSS libraries (curses, Xlib, OpenGL and possibly "usual suspects" like gtk+, webkit and Boost). Reliance on well-written libraries is welcome.
  • No reliance on proprietary software - for obvious reasons (programs that rely on XNA, DirectX, Cocoa and similar, for example).
  • Well-documented code is welcome.

Include link to web interfaces to their repositories if possible.

Here are some sample projects that often pop up in these threads:

Operating Systems

  • Plan 9 from Bell Labs: More or less, the official "sequel" to UNIX. Written in C by the same people who invented C!
  • NetBSD: The most portable BSD implementation, written in C and also a good example of portable and organized code.

Network and Databases

  • Sqlite: Extremely lightweight and extremely efficient, one of the best pieces of C software I've seen. Count the lines yourself!
  • Lighttpd: A small but pretty reliable web server written in C.

Programming languages and VMs

  • Lua: extremely lightweight multi-paradigm programming language. Written in C.
  • Tiny C Compiler: Really tiny C compiler. Not really comparable to GCC or Clang but does its job.
  • PyPy: A Python implementation written in Python.
  • Pharo: OK, I admit it, I'm not really a Smalltalk expert but Pharo is a fork of Squeak and looked rather interesting.
  • Stackless Python - An implementation of Python that doesn't rely on the C call stack - written in C (with some parts in Python)

Games and 3D:

  • Angband: One of the most accessible roguelike codebases around here, written in C.
  • Ogre3D: Cross-platform 3D engine. Gets bloated if you don't skip the platform-specific implementation code, otherwise is a pretty solid example of good C++ OO.
  • Simon Tatham's Portable Puzzle Collection: Title says it all.

Other - dwm: Lightweight window manager. Written in C.

Emulation and Reverse Engineering - Bochs: x86 emulator, written in C++ and tiny enough. - MAME: If you want to see C at one of its lowest levels, MAME is for you. May not be as clean as the other projects but it can teach you A LOT.

Before you ask: I didn't mention Linux because it has become quite bloated in the last few years, Linus has also confirmed it. Nonetheless, it'd be a great educational read the same, even if for other reasons. Same for GCC.

share
1  
Although this is an interesting topic I don't think that this fits here because - well - it is no question (see FAQ). –  Howard Jun 4 '11 at 17:13
    
There is a question - "What are some well-written FOSS projects that can be used for code reading and studying?" However, I think DOK is right, it would probably be better off somewhere else. –  Thomas Owens Jun 4 '11 at 17:15
1  
It is a question: if other fellow users know other nicely written FOSS codebases. I don't think that interesting posts should be closed just for the sake of having a question mark at the end or not; I thought it could be useful to other coders and I just posted it. Besides, you can just make it a wiki post - there are several others. If you want to close it just because it's not a question, at least wait a bit until some people contribute. I know many people who could learn a lot from reading other people's code. –  Godot Jun 4 '11 at 17:16
2  
@Howard: I understand your logic but I want you to understand mine - what's so bad about it? I mean, mine was a well-researched, thoughtful post. I didn't just ask for a list of names, unlike many other questions which are often accepted (such as "which Python web framework should I use for my ___")? That question can generate answers just as vague without being deemed "inappropriate". I could understand if it were a personal question but it's not; I posted it since the resources on the web are scarce and only a community like SO could give satisying answers. –  Godot Jun 4 '11 at 17:27
1  
I think this is a good question, even if it doesn't really have a single correct answer. –  Ed Woodcock Jun 4 '11 at 17:44
show 2 more comments

migration rejected from stackoverflow.com Sep 21 '13 at 22:24

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as too broad by World Engineer Sep 21 '13 at 22:24

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers

The well-known Boost C++ libraries are a good thing to be familiar with if you want to become more proficient at C++. Note that some of these libraries use quite advanced C++ programming techniques.

share
    
would you mind explaining more on what it does and why do you recommend it as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Sep 21 '13 at 11:15
add comment

The Mercurial project is relatively small, is well designed, has code standards, a test suite, code checking, and would be a good subject for study.

share
add comment

The MINIX 3 kernel's source code is very well documented, and it isn't as huge (under 6000 lines of executable code, according to the site) as, say, the Linux kernel.

MINIX is meant to be used in educational environments. It also has a decent book, Operating Systems Design and Implementation.

...Written by the creator of Minux, professional programmers will now have the most up-to-date tutorial and reference available today.

Revised to address the latest version of MINIX (MINIX 3), this streamlined, simplified new edition remains the only operating systems text to first explain relevant principles, then demonstrate their applications using a Unix-like operating system as a detailed example. It has been especially designed for high reliability, for use in embedded systems, and for ease of teaching...

share
add comment

Instead of choosing a FOSS project for study only, choose a project you can benefit from contributing to (even if it doesn't meet all your criteria).

  • You'll have to study and understand the code base to be able to contribute.
  • You'll have to discuss the code and your proposed changes with your peers.
  • There's no better way to learn than by doing.
  • You'll learn about FOSS project dynamics (which are much more than the code).
  • You'll get the benefits of your contributions.

Many successful projects are huge in lines of code and complexity. Attempting to write a contribution will force you to focus on a coherent part of the architecture and the infrastructure libraries.

I contributed the first thread pool class to Jetty when it was already a complete HTTP and Servlet server and Java didn't provide the facility. A profiler helped me cut vertically into the request dispatching mechanism of the server so I could intervene it at the core.

In other FOSS projects I started for Delphi, developers that initially submitted some small patches ultimately became the project experts, architects, and administrators.

share
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.