Railroad Programming

Railroad programming is a functional programming paradigm that manages flow control, especially success vs failure, without messy if/else chains or exceptions everywhere.

The image comes from the sequence of step, expressed as a train track: one rail links the different successes, while the other rail links all the failures. It is possible to go from success to failure.

See also Railway Oriented Programming: A Functional Approach to Error Handling and Railway-Oriented Programming in PHP.

Related : Paradigm