To write great code you must first read great code – our reading list

You become a better writer by reading great works and writing, a lot. This is as true for writing code as it is for writing books. Whether you consider it a craft, art or skill, to become better at writing code you need to excercise (i.e. write code!) and you need to study.

code

And there is no better way to study how to program, how to design and structure programs, how to build architectures and name things, than by reading others peoples code. Unfortunately there is a lot of bad code out there. Here is our list of a few great code resources to read and learn from:

  • Real World Implementation of Text book Algorithms

Yes, they do really get implemented from time to time. And it is actually quite interesting to see, how this works (and changes) in practice. There has been a great StackExchange Thread on this a while back, covering all types of Lists, Hashes, Searches, Sorting and so on. Highly recommended!

  • BackboneJS

is one 1500-line file of cide, implementing a whole frontend-side MVC. It uses advanced JS features to do that. Even better, they have annotated the whole source file for your consumption: Annotated Source Code(annotated source code)

  • UnderscoreJS

along with BackboneJS comes UnderscoreJS, which also has a fully annotated source code, which backbone uses exensively to get its job done.

  • Linux Kernel

Of course the Linux Kernel is a great project with an amazing infrastructure, as well as very elegant code. And we aren't the first to realise it, actually there are full fletched tours on the Linux Source code and helpful pointer on where to get started.

  • Python's NDB

If you already know about some Python and Metaclasses and have some knowledge on Key-Value-Store-Database-Theory, Guido van Rossum, inventor of Python, totally rewrote the Database layer of Google AppEngine (on BigTable) and it is incredible. You can find the full source code of NDB here.

  • HTTP Stack

If you are interested to learn more about the HTTP-Protocol and Web-Stacks, there are two really elegantly build projects I'd recommend reading: the ruby-framework Sinatra (start at base.rb) and the Python framework flask (start at app.py)

About the Authors

Benjamin Kampmann

is freelance Software Developer and Product Creator. Aside from helping with the organisation of workshops and events, he is part of the strategic team and author of many of the blueprints. ben at Hackership dot org

Discussion