Developers Rethink "Complexity": Is Your Code Costing People More Than CPU?

Summary
It has been reported that a recent PhiloDev post, highlighted on Hacker News, argues complexity in code is not just about Big O. The piece lays out a taxonomy — computational complexity, domain (business) complexity, cyclomatic and Halstead measures, and a surprising turn toward linguistic complexity drawn from psycholinguistics. The author uses familiar examples (insertion sort’s O(n²) versus counting sort’s O(n)) to show that a faster algorithm on paper can still be worse in practice if it increases cognitive overhead for the humans who must read, maintain, or reuse it.
Examples and trade-offs
Which is costlier: CPU cycles or developer hours? The article argues the latter often wins. Counting sort may be asymptotically better, but it requires assumptions (non‑negative integers, bounded range) and creates surprising edge cases — the sort of gotchas that cost tickets, late nights, and trust. Meanwhile, a straightforward insertion sort is slow but readable; it mirrors how people think about sorting. The post also introduces linguistic complexity metrics and suggests measuring how hard a natural‑language description of code is to understand — a neat bridge between software metrics and human factors.
Why it matters
This isn't academic hair‑splitting. It has been reported that the author recommends treating human thinking time as a first‑class resource when designing and choosing implementations, and using a mix of metrics to make those trade‑offs visible. In an era when AI can spit out clever, terse solutions, the emotional cost of brittle, opaque code is real: teams burn out, knowledge evaporates, and systems become fragile. The takeaway? Faster isn't always better; clearer often is. Who knew readability might be the new performance hack?
Sources: philodev.one, Hacker News
Comments