Lurker News
This is one my favourite questions, asked by idlewords: https://news.ycombinator.com/item?id=879101 But its been a long time since then, and with a new set of programming languages, I believe there are new code bases that's worth studying about and learning from. So, which code-base should I be reading about to improve myself?

Comments (166) 76 threads

Show all comments

Showing thread 8 of 76

jacquesm5 replies#

  C -> Varnish
  PHP -> Yii
  Ruby -> Merb
  Scheme -> Arc
  Clojure -> Core
  JavaScript -> Multeor
Any languages in particular that you're interested in not covered above?
throwaway13qf85#

  Haskell -> XMonad
Bootvis1 reply#
I have some experience with Yii and coming from Django I'm not impressed with the _functionality_. Maybe the code is really great but why not study something Symphony which, arguably, achieves more and is therefore better at solving the same problem?
jacquesm1 reply#
Because we're not talking about the functionality but about the quality of the codebase? (Unless I'm misunderstanding).
Bootvis#
Agreed but if function follows form then Yii is somewhat lacking. Maybe I'm just biased because when I was in a tight spot digging through the source and docs didn't get me where I wanted to be.

Looking at their GitHub now I must admit that the source code and comments look pretty good.

SatyajitSarangi4 replies#
Thanks for this list.

I was mostly looking for Python, Javascript, Haskell and C#. Any help regarding that?
Also, as I believe this thread will also help others, you can go ahead and post about any other code-bases for other languages.

timClicks2 replies#
Modules within the Python standard library are very well written. The source code also provides very good examples of decent unit tests.
AnkhMorporkian#
I would stay the heck away from the collections and itertools modules to be honest. Raymond H. is an amazing coder, but he' s a madman.
gatehouse#
Agreed.

Here is a link to cpython 2.7 libraries: http://hg.python.org/cpython/file/70274d53c1dd/Lib
Those that are implemented in C are in the "Modules" folder from the top level.
I think you [OP] will get the most benefit from reading libraries that you use often because it will give you some direction.
If there are 3rd party libraries you use heavily those will be interesting too.
It is very very difficult to just pick up megabytes of code and start reading them and find it useful. You will be able to pick up style and conventions but not really high-level engineering decisions.
My suggestion is to take software that you use regularly and run it through a debugger. Since you use it you know the problem domain. And with the debugger the code you're reading gets real context. I've done this with Git for example.
And also look at the design documents for big OSS projects.

nubela#
requests module is very well written
sophacles#
For C# i found the disruptor.net code to be very nice. It's mostly a direct port of disruptor from java - but it definitely was pretty nice to read through.
egonschiele#
For Haskell, Hakyll's source is pretty well written.
decode#

    PHP -> Yii
Are you suggesting specifically Yii 1 or Yii 2, or either one?