jargon

Comparison

Function compositionvsPipes and filters

Function composition

you built one function out of three others, and the intermediate values never got names.

Combining functions so the output of one becomes the input of the next, producing a new function rather than a result. It is pipes and filters at the expression level, and it is why small single-purpose functions are worth more than they look. It requires the pieces to agree on their types, which is exactly the constraint that keeps a composed pipeline honest.

Full entry →

Pipes and filters

each stage takes one thing and returns another, knows nothing about its neighbours, and you reordered two of them safely.

Decomposing processing into independent stages connected by a uniform channel, so each stage transforms and passes along. Unix pipelines, compilers, ETL jobs and stream processors are all this shape, and its virtue is that stages compose, reorder and parallelise because they share only the data format. The constraint is that shared format: anything a stage needs that the pipe does not carry has to be smuggled, and that is where the design breaks down.

Full entry →

Related comparisons