Skip to content
500 Lines or Less
TeX JavaScript Python HTML Haskell Ruby Other
Find file
Failed to load latest commit information.
_build Minimal HTML build; styles not working yet.
_includes Initializing repository for '500 Lines or Less'.
_layouts Initializing repository for '500 Lines or Less'.
blockcode Change blockcode biographical blurb.
ci Merge pull request #177 from Deborah-Digges/patch-3
cluster Add Dustin's bio.
contingent Contingent fixes.
crawler crawler: typo
css/bootstrap Initializing repository for '500 Lines or Less'.
dagoba Merge pull request #186 from dxnn/dagoba-typeset
data-store Work around bugs for now.
event-web-framework Move web framework chapter to std. project format.
flow-shop Attribution.
functionalDB Fix typo
html Mobile
image-filters Retab Java code to 2 spaces instead of tabs.
incomplete Archive tiled renderer chapter.
interpreter Fix local variable name in push_block method
minutiae Minimal HTML build; styles not working yet.
modeller Touch-ups to modeller chapter.
objmodel fix other image too
ocr Add image.
pedometer Changes for early-access release.
resource Update readme with logo.
same-origin-policy Typeset Alloy chapter.
sampler Last fixes for sampler.
spreadsheet Fix invalid url
static-analysis Fix typo.
template-engine remove redundant the
tex Merge branch 'master' into image-filter-typeset
web-server Latex
.classpath changing from node app tp clojure
.gitignore Typeset image filters chapter. Initializing repository for '500 Lines or Less'.
Makefile Initializing repository for '500 Lines or Less'. Archiving chapters from PRs.
_config.yml Initializing repository for '500 Lines or Less'. Typeset image filters chapter.
requirements.txt Minimal HTML build; styles not working yet.

500 Lines or Less

"What I cannot create, I do not understand."

-- Richard Feynman

This is the source for the book 500 Lines or Less, the fourth in the Architecture of Open Source Applications series. As with other books in the series, all written material will be covered by the Creative Commons - Attribution license, and all code by the MIT License: please see the license description for details. In addition, all royalties from paid-for versions will all go to Amnesty International.

The production of this book has been made possible by the financial support of PagerDuty.

PagerDuty Logo


Every architect studies family homes, apartments, schools, and other common types of buildings during her training. Equally, every programmer ought to know how a compiler turns text into instructions, how a spreadsheet updates cells, and how a database efficiently persists data.

Previous books in the AOSA series have done this by describing the high-level architecture of several mature open-source projects. While the lessons learned from those stories are valuable, they are sometimes difficult to absorb for programmers who have not yet had to build anything at that scale.

"500 Lines or Less" focuses on the design decisions and tradeoffs that experienced programmers make when they are writing code:

  • Why divide the application into these particular modules with these particular interfaces?
  • Why use inheritance here and composition there?
  • How do we predict where our program might need to be extended, and how can we make that easy for other programmers?

Each chapter consists of a walkthrough of a program that solves a canonical problem in software engineering in at most 500 source lines of code. We hope that the material in this book will help readers understand the varied approaches that engineers take when solving problems in different domains, and will serve as a basis for projects that extend or modify the contributions here.


Name Affiliation Project Online GitHub Email (if you choose)
Mike DiBernardo freelance editorial MichaelDiBernardo
Amy Brown indie editorial amyrbrown
Dustin Mitchell Mozilla cluster   djmitche
Audrey Tang, Socialtext, Apple spreadsheet audreyt
Greg Wilson Mozilla web-server gvwilson
Taavi Burns Previously at Points, now at PagerDuty data-store taavi
Guido van Rossum Dropbox crawler gvanrossum
A. Jesse Jiryu Davis MongoDB crawler ajdavis
Erick Dransch Upverter Modeller EkkiD
Ned Batchelder edX templating engine nedbat
Leah Hanson Google static analysis astrieanna
Christian Muise University of Melbourne flow-shop haz
Marina Samuel Mozilla ocr emtwo
Cate Huston Image Filter app catehstn
Yoav Rubin Microsoft In-memory functional database yoavrubin
Dessy Daskalov Nudge Rewards Pedometer dessy
Carl Friedrich Bolz King's College London object model cfbolz
Jessica Hamrick University of California, Berkeley sampler jhamrick
Allison Kaptur Hacker School byterun @akaptur @akaptur
Daniel Rocco BrightLink Technology contingent @drocco007 drocco007
Brandon Rhodes Dropbox contingent @brandon_rhodes brandon-rhodes
Dann Toliver Bento Box dagoba dxnn
Malini Das Twitch ci malini
Something went wrong with that request. Please try again.