Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    500 Lines or LessAmy Brown

    500 Lines or Less

    Amy Brown, Michael Dibernardo · 2016

    As we pointed out in The Architecture of Open Source Applications, architects look at thousands of buildings during their training, and study the critiques of many more. But most software developers only ever get to know a handful of programs well - usually programs they wrote themselves. This book provides you with the chance to study how 26 experienced programmers think when they are building something new. The programs you will read about in this book were all written from scratch to solve difficult problems. A web server, a pedometer, a Python interpreter, a web-based spreadsheet, and many more applications are written, in 500 lines of code or less, and described by their creators so that you can learn from their insights and their mistakes.

    Programming
    Open LibraryAmazon
    Stats for nerds
    15recommend
    28mentions
    24people
    2014–2026years
    68% recommend32% neutral

    Mentions per year

    2014201620182020202220242026

    What Hacker News says

    1. ramon156Feb 2025
      Not a repo but I remember a book titled something like "architecture in 500 lines or less" that had really pretty explanations and diagrams
      thread
    2. vram22Apr 2024
      The 500 Lines or Less section from https://aosabook.org/en/

      The Architecture of Open Source Applications

      thread
    3. mumblemumbleOct 2023
      Remembering that a line of code is a price you pay, and not an accomplishment in and of itself, is a valuable mindset to maintain. And I think that 500 lines is a comparable volume of code to digest across many languages. It may accomplish varying amounts of useful work, but that's beside the point. The purpose of this work is not to engage in an inter-language, inter-domain pissing match; it's to meditate on the human economics of software design. It says as much in the introduction: "500 Lines or Less focuses on the design decisions that programmers make in the small."

      Thinking about these things does matter. This past week I refactored a somewhat challenging piece of code my team had been maintaining from several hundred lines of code to about 30, without playing code golf. And I found and removed bugs (and even a little bit of code golf) in the process. Similar to what the book's introduction suggests, a lot of this change was down to rethinking the abstractions and decomposition of the code. The original version apparently tried to force the problem to fit a preselected design pattern. Doing that instead of decomposing the problem according to its own natural structure really does seem to have resulted in a ~10X code bloat factor.

      thread
    4. iudqnolqSep 2023
      You might like the book 500 Lines or Less, Experienced Programmers solve interesting problems

      https://www.amazon.com/500-Lines-Less-Amy-Brown/dp/132987127...

      thread
    5. iudqnolqMay 2023
      Check out the book "500 Lines or Less: Experienced programmers solve interesting problems"

      I especially like the chapter "A Python Interpreter Written in Python": https://aosabook.org/en/500L/a-python-interpreter-written-in...

      thread
    6. chubotOct 2022
      Thanks, definitely a good resource

      Though I do think it's illumating to see the smallest, slowest code that implements the spec

      Similar to the "500 lines or less" book, or say a TCP/IP implementation in Python

      I cloned it, and it's ~3600 lines, which is very interesting. I didn't think you could implement anything that passes 95% of an sqlite test suite in that much code, as sqlite itself is at least 200K lines IIRC.

      It has a ton of features built up over 20 years. Sure you save a lot by not having a disk pager, efficient data structures, and so forth, but still that's pretty small, and parsing/tokenizing is over 1000 lines of it.

      thread

    Related

    Cover of The architecture of open source applications
    2011–2026

    The architecture of open source applications

    Amy Brown
    204 recommend · 257
    Cover of Teaching Tech Together
    2018–2024

    Teaching Tech Together

    Greg Wilson
    5 recommend · 6
    Cover of Writing efficient programs
    2010–2024

    Writing efficient programs

    Jon Louis Bentley
    9 recommend · 24
    Cover of More programming pearls
    2008–2025

    More programming pearls

    Jon Louis Bentley
    12 recommend · 27
    Exercises in Programming StyleCristina Videira Lopes
    2016–2025

    Exercises in Programming Style

    Cristina Videira Lopes
    11 recommend · 17
    Cover of Code Complete
    2007–2026

    Code Complete

    Steve McConnell
    393 recommend · 894
    Cover of Smalltalk-80
    2010–2025

    Smalltalk-80

    Adele Goldberg
    8 recommend · 13
    Cover of Programming Perl
    2007–2026

    Programming Perl

    Larry Wall
    90 recommend · 298