Book Club: Software Design for Flexibility
post by stuhlmueller · 2021-03-18T15:42:59.376Z · LW · GW · 1 commentsContents
1 comment
Gerry Sussman's new book on how to build adaptive systems just came out. It's called "Software Design for Flexibility: How to Avoid Programming Yourself into a Corner" and it covers similar ground to Sussman's advanced symbolic programming class which I liked a lot. The class itself is a kind of follow-up to SICP.
I'm reading the book over the next 8 weeks. If you want to read it together, and share notes and toy implementations, add your name to this doc.
Excerpt:
Our goal in this book is to investigate how to construct computational systems so that they can be easily adapted to changing requirements. One should not have to modify a working program. One should be able to add to it to implement new functionality or to adjust old functions for new requirements. We call this additive programming. We explore techniques to add functionality to an existing program without breaking it.
1 comments
Comments sorted by top scores.
comment by norswap · 2021-03-26T00:41:10.530Z · LW(p) · GW(p)
I can't judge because I didn't follow the course, but I'd like to share my a priori reaction:
One should not have to modify a working program. One should be able to add to it to implement new functionality or to adjust old functions for new requirements. We call this additive programming.
That does sound like a terrible idea. It's often used to justify horrendous abstractions and over-architecturing, for instance. Now this can make sense when third-parties depend on the code. But if you can change the code, it's often better to do so.
The other school that I am aware on this is to use programming paradigms where you can forcibly add to existing code (for instance, Aspect Programming). This hasn't generally been very successful, and it's not incredibly difficult to understand why: the existing code makes some assumptions, which it does not document (and which are liable to change) - it's easy for the "injected" code to break these assumptions.
I think I've heard of "additive programming" in another context with a slightly different definition. If you can isolate in advance the class of things that can be added (say you have a role playing game, and you know you might add new character classes, and new dungeons for instance). Then making it so that when these things are added, they can be added by writing code in a single location is "additive", whereas having to modify things all over the place is not. I think this is a excellent idea, but it is by it's very nature restricted to the kind of changes you can predict.
Anyhow, I'm curious to see how the course holds up to the promise (who knows, maybe it does hold the grail). If you have been following the course and you want to share your perspective, I'll be grateful.