Where can I find great code?
October 2, 2011 10:45 AM Subscribe
What open-source projects should I look at to see examples of great design and clear coding style?
Details: I work in C++ and Python on a large, computationally intensive desktop application. I am looking for examples that are at least somewhat relevant, i.e. not Haskell or microcontroller assembly.
Details: I work in C++ and Python on a large, computationally intensive desktop application. I am looking for examples that are at least somewhat relevant, i.e. not Haskell or microcontroller assembly.
Big, and serious, friendly, and usable: The Qt cross-platform C++ library. (Git repository.)
Really super technical and exquisitely constructed: The cross-platform utility library Boost.
These two projects are very well written and - also important - the documentation is quite good.
posted by krilli at 11:11 AM on October 2, 2011 [1 favorite]
Really super technical and exquisitely constructed: The cross-platform utility library Boost.
These two projects are very well written and - also important - the documentation is quite good.
posted by krilli at 11:11 AM on October 2, 2011 [1 favorite]
I can highly recommend Flask, available on Github. It's a great web-microframework. If more people commented and structured their code like these guys, the world would be a better place.
posted by Static Vagabond at 11:12 AM on October 2, 2011
posted by Static Vagabond at 11:12 AM on October 2, 2011
For a really good example of what not to do, take a look at the NetHack source code. (Not intended as off-topic - I really did learn a lot from looking at it. It's a window into the terrible and stupid past.)
posted by krilli at 11:14 AM on October 2, 2011
posted by krilli at 11:14 AM on October 2, 2011
OpenBSD, code written exactly to the guidelines. Really nice to read once you've absorbed the style guide.
posted by adventureloop at 12:15 PM on October 2, 2011 [1 favorite]
posted by adventureloop at 12:15 PM on October 2, 2011 [1 favorite]
I was going to say OpenBSD or the Linux kernel (although apparently there are parts of the latter that are...not so good, but the recent commits are pretty closely watched).
posted by Kadin2048 at 8:15 PM on October 2, 2011
posted by Kadin2048 at 8:15 PM on October 2, 2011
Sweetcode is dead now but if you use the Way Back Machine you'll find some gems. It was driven by one guy so a lot of it is stuff that he thought were clever hacks but there's pointers to well written code in there.
posted by rdr at 5:57 AM on October 3, 2011
posted by rdr at 5:57 AM on October 3, 2011
It's Javascript, but the annotated source of backbone.js is a work of art.
(Oh, and that documentation was produced with the equally-beautiful Docco)
posted by schmod at 8:00 AM on October 3, 2011
(Oh, and that documentation was produced with the equally-beautiful Docco)
posted by schmod at 8:00 AM on October 3, 2011
I will disagree with Kadin2048 about the Linux kernel, but he's completely correct about OpenBSD (as is adventureloop).
I like the "original Unix" source, as found in the Lions book.
posted by phliar at 2:21 PM on October 3, 2011
I like the "original Unix" source, as found in the Lions book.
posted by phliar at 2:21 PM on October 3, 2011
This thread is closed to new comments.
posted by asphericalcow at 10:59 AM on October 2, 2011