Urgent.News

What's breaking now, across thousands of outlets.

Tech

simple is not small

Simple does not necessarily equate to small. A program can be small in size but still complex and difficult to understand. Rich Hickey defines simplicity as having only one braid, contrasting it with complexity which involves braiding multiple things together. Coupling, or the connection between different features, is what makes a program complex.

This is evident in the Unix pipeline example where sorting and counting frequencies are linked. The pipeline is small but intricate and inefficient due to the coupling of sorting and counting. On the other hand, a complex program like Google Drive for Desktop, though large, feels simple to the user. Complexity arises when features are interconnected without necessitating such connections.

Examples include Rust's structs which couple type-checking to a fixed data representation, making iteration over structs cumbersome. Clojure, however, decouples data representations from type checking, allowing for more flexible and readable code. This decoupling makes Clojure programs simpler and easier to understand. Despite the benefits of simplicity, keeping a program small is often practical due to limited resources or constraints.

However, the key takeaway is that simplicity should always be prioritized, regardless of the program's size.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at jyn.dev →

More in Tech

More from Thursday 3 September →