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
    Cover of Software Design for Flexibility

    Software Design for Flexibility

    Chris Hanson, Gerald Jay Sussman · 2021

    Strategies for building large systems that can be easily adapted for new situations with only minor programming modifications. Time pressures encourage programmers to write code that works well for a narrow purpose, with no room to grow. But the best systems are evolvable; they can be adapted for new situations by adding code, rather than changing the existing code. The authors describe techniques they have found effective--over their combined 100-plus years of programming experience--that will help programmers avoid programming themselves into corners. The authors explore ways to enhance flexibility by: Organizing systems using combinators to compose mix-and-match parts, ranging from small functions to whole arithmetics, with standardized interfaces Augmenting data with independent annotation layers, such as units of measurement or provenance Combining independent pieces of partial information using unification or propagation Separating control structure from problem domain with domain models, rule systems and pattern matching, propagation, and dependency-directed backtracking Extending the programming language, using dynamically extensible evaluators

    Software EngineeringProgramming
    Open LibraryAmazon
    Stats for nerds
    8recommend
    32mentions
    27people
    2020–2026years
    34% recommend63% neutral3% critical

    Mentions per year

    2020202120222023202420252026

    What Hacker News says

    1. zelphirkaltJul 2026
      To see really elegant and great code, I recommend looking in books. I have seen elegant code in: SICP, The Little Schemer, Software Design for Flexibility.
      thread
    2. Phiwise_Sep 2024
      By analogy, programmers like LISP over other syntax for the same reason that creative children like LEGO over other toys. It's not that the pieces in the box are more beautiful than any other individual example of molded plastic, but because they are purpose-built to be the maximizing mold such that a box full of them gives more flexibility and potential than a box of any other shape you might choose. Lisp syntax is the way it is to create a human-machine interface with as much similarity between the two sides as possible, so the human approaches machine power when you write code, and the machine approaches human reasonability when you inspect running code.

      For examples, McCarthy's original purpose was to demonstrate the effectiveness of a symbolic differentiation process he had dreamt up, so he devised the syntax and meta-circular evaluator of lisp to make it maximally obvious from the program text that the differentiation system was mathematically correct, while keeping it maximally obvious from the program model definition that it was computationally concrete. In response to new trends in the programming field, Lispers write mind-bending books like "Let over Lambda", "The Art of the Metaobject Protocol", or "Software Design for Flexibility" to show that, when your syntax and model is right, you can radically change how you solve problems not by rewriting your spec or switching languages but by just adding more lisp to the lisp you already have, which has the same simplicity as radically increasing the sculptures a child can make by just adding more lego to the lego they already have.

      Lisps, on the other hand, tend to add features as just more convenient versions of things they can already do: Macrology for self-adapting code? Just lisp functions on lisp data structures corresponding to lisp functions. Actors for a concurrent execution model? Lisp functions as lisp data parameterized by higher-order lisp functions. Composable continuations for error handling? A lisp function exploring a lisp data structure of lisp data structures of lisp functions. It's turtles all the way down. Paul Graham points out that you can understand the social hype the presence or absence of a feature like operator overloading as a consequence of friction-ful syntaxes, while lispers care much less because replacing a function you don't prefer with one you do for your use case is straightforward in a friction-free syntax. When he decided to build a reddit clone for tech entrepreneurs he didn't need an outside data system just to get started, he only had to spin up a pool of threads for sessions to directly modify s-expression literals in memory, which he could save or modify by printing straight to disk and load by just reading the lisp syntax back into memory like all lisp code is, with no execution intermediary like languages such as the Pythons tend to have complicating things enough to make comparatively big services like a whole database for a private gossip forum worth the effort. The syntax doesn't make lisp first-order beautiful, it makes lisp the hacker's local maximum, which is second-order beautiful, and honestly isn't much harder to get into the habit of reading once you know it's worth it.

      thread
    3. zelphirkaltAug 2023
      You are saying engineers should build software, that doesn't frequently require changes to fit some new use case? Outrageous. Then we would have to do proper engineering and make things flexible, anticipating potential use-cases. We would have to heed advice written in books such as PAIP (or more recently "Software Design for Flexibility"). Can we be expected to know literature of our own field?
      thread
    4. zelphirkaltFeb 2023
      Learn from some of the best. For example read and do the exercises of SICP followed by "Software Design for Flexibility - How to avoid programming yourself into a Corner". The authors have more than 50y of experience and go through multiple iterations and refactorings of examples, pointing out good and bad aspects of the code.
      thread
    5. JHonakerAug 2022
      Well I did it in Scheme, but there's no reason it wouldn't have worked in Julia. If you're interested in this, the relatively recent Software Design for Flexibility by Chris Hanson and GJS [1] has a pretty good couple of chapters on creating a generic procedure system (and a lot of other really cool things). Edit: In fact, it has an example doing just this example: symbolic alternative evaluation. Where they get the closed form solution from a simple differential equation solver without changing any code in the solver.

      Now that I think about it, this idea is pretty much how automatic differentiation works in Julia. (Really everything in Julia.) You can look at the libraries Flux.jl and Zygote.jl. There are probably more now, I've been out of the Julia ecosystem for about a year or so.

      [1] https://mitpress.mit.edu/9780262045490/

      thread
    6. zenkatFeb 2022
      OP here. Thank you for all of the great suggestions! I've compiled all the references into this spreadsheet: <https://docs.google.com/spreadsheets/d/1kgFSWp7rM3ZegweXAoMN...>

      From my perspective, the top "must-reads" are:

      -- John K Ousterhout, A Philosophy of Software Design

      -- Titus Winter (et al), Software Engineering at Google

      -- Hanson and Sussman, Software Design for Flexibility

      Other interesting titles that caught my eye:

      -- Peter Naur, Programming as Theory Building

      -- Scott Wlaschin, Domain Modeling Made Functional

      -- Yehonathan Sharvit, Data-Oriented Programming: Unlearning objects (upcoming)

      -- Nick Tune, Patterns, Principles, and Practises of Domain Driven Design

      -- Robert L. Glass, Facts and Fallacies of Software Engineering

      -- Donald Reinertsen, The Principles of Product development Flow

      -- Eric Normand, Grokking Simplicity

      thread

    Related

    Cover of A Philosophy of Software Design
    2018–2026

    A Philosophy of Software Design

    John K. Ousterhout
    163 recommend · 342
    Cover of Designing Data-Intensive Applications
    2014–2026

    Designing Data-Intensive Applications

    Martin Kleppmann
    457 recommend · 846
    Cover of Design Patterns
    2007–2026

    Design Patterns

    Erich Gamma
    95 recommend · 491
    Cover of Domain-Driven Design
    2007–2026

    Domain-Driven Design

    Eric Evans
    104 recommend · 252
    Cover of Refactoring
    2007–2026

    Refactoring

    Martin Fowler
    94 recommend · 179
    Software FoundationsBenjamin C. Pierce
    2011–2026

    Software Foundations

    Benjamin C. Pierce
    58 recommend · 77
    Refactoring UIAdam Wathan
    2018–2026

    Refactoring UI

    Adam Wathan
    129 recommend · 167
    Cover of How to Design Programs
    2007–2026

    How to Design Programs

    Matthias Felleisen
    277 recommend · 776