First off, thanks Zach for writing an elegant and cogent book that really does succeed in putting into words what I feel like I already knew.
As I was reading I had some questions, would love to hear anyone's thoughts as to some answers.
Pg. 111
The book says we can only do three things to data, "accrete, reduce, and reshape it".
What about a function that takes a word in spanish and returns a word in english? What operation are we performing on our input in this case? Is this just a reduction of our spanish word into an english word?
Pg. 118
"It is useful and often necessary for the completion of a task to be acknowledged back up the chain ... This state should exist in a single place at the edge of the system so that other processes can safely forget a command once they've passed it along."
This actually applies to a real world example at my day job.
Proc A communicates to Proc B via PubSub in Redis. Proc A sets a key, and doesn't worry about Proc B acknowledging the completion of the command, or even the receiving of the command. It's nice because Proc A doesn't have to wait for Proc B at all. However there are times when Proc B doesn't receive the command for whatever reason.
How can that failure be recorded in any process in the system without introducing a step where Proc A waits to know if Proc B received the command? Or is this just exactly what queues are made for? If you're answer is "queue", I don't see how a queue can't just be Proc B in this example.
Pg 90
Questions about "principled component" vs "principled system" and my guesses at answers.
What's the relation between a "component", "system" and "module"?
> A component can be a process, module, or a single function. A system is made of components. A component can not be stretched across more than one process.
What's a concrete example of a "central design principle"?
> "In the geocoding component, all latitude and longitude data is represented as a 2-vector of [lat lon]"
Is a principle component internally structured as a hierarchy, or is that just a principled system?
> A principle component can be structured as a hierarchy if the component is large enough
Pg 113
"The semantics of our data are defined by the effects it produces when passed into our functions. ... The push phase begins wherever our functions perform effects. Put another way, it begins where the meaning of our data is defined."
In that quote, is the place "the meaning of our data defined" just the functions that will interpret the data?
Would you consider a pull from out of process "performing an effect"?
Pg 114
"A process is composed of operational phases at the edges and a functional phase at the middle"
^ These are my favorite programs to write, but too often I have to write a program that looks like:
- Pull data
- Transform data
- Pull data
- Pull data
- Transform data
- Push data
For example, making a series of web requests who's results depend on each other. Where are the edges and middle of the system here? I guess the only thing to do is keep the transforms free of side effects?
Pg 65
The book says that we can't create an "open" conditional by putting the predicates and clauses into a data structure because of the possible overlapping cases and non determinant order.
But what if we also encode the order in this data structure? Then the code that interprets the data structure could just use the encoded order. What am I missing?
Loved the model for modules. I work in python now so I struggle between OOM patterns and my favored clojure functional patterns. Thinking at the module level (a collection of functions and data, but most importantly names and interfaces) really clicks for me. It doesn't matter if the module exposes objects or dicts or functions, but getting clear on the invariants and assumptions is super helpful.
I really enjoyed the read, thanks for putting so much into it Zach!