True in UNIX, true in Functional Programming

The UNIX Philosophy has nine principles. These same principles are core to functional programming as I understand it.

Below find the nine principles of UNIX interpreted in terms of FP, ordered by the strikingness of the parallel.

1. Small is beautiful.

Small functions, small abstractions. The simpler the function, the easier it is to see what it will do.

2. Make each program do one thing well.

Each function should have one purpose.

9. Make every program a filter.

Make it composable! It is composability that builds functions and abstractions into larger systems without complicatedness.

6. Use software leverage to your advantage.

Composability leads to reusable parts. Also, write tiny DSLs for your own use.

3. Build a prototype as soon as possible.

The interactive REPL lets us prototype functions.

4. Choose portability over efficiency.

Don’t depend on the environment, even if it would be easier to root around in the database or system properties. Keep functions “data in, data out.”

8. Avoid captive user interfaces.

Imperative style may be most obvious to the programmer, but it is not the most flexible for her long-term use. Avoid inflexible contexts that look easy-to-use.

5. Store data in flat text files.

Functions should have visibility into the data, and its structure should be clear. With immutable data, choose clarity over encapsulation.

7. Use shell scripts to increase leverage and portability.

OK, yeah, I got nothing.


principles drawn from: