7 Do One Thing Well and Other Unix Principles

This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

—Douglas McIlroy

The prevailing philosophy of the Unix operating system is simple: do one thing well. This means, for example, that it’s generally better to create a function or module that can solve one problem, reliably and efficiently, than to try to tackle multiple problems at the same time. Later in this chapter, you’ll see some Python code examples of “do one thing well” in action and learn how the ...

Get The Art of Clean Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.