Skip to content(if available)orjump to list(if available)

Don MacKinnon: Why Simplicity Beats Cleverness in Software Design [audio]

Mikhail_Edoshin

Simplicity and complexity are not opposites. Things become complex when we attend to multiple simple things at the same time.

For example, we have an algorithm that requires a key-value store with typical semantic. For the purposes of our algorithm we could simulate that store using an array and straightforward search and insert routines that just loop through the array without trying to be smart. Then we could attend to details of that key-value store and use a more efficient approach, this time without thinking about our original algorithm; or, perhaps, with a clear understanding of its access pattern.

In both cases the task at hand won't be more complex than necessary. But if we try to do both at the same time, it will be way more complex.

Here the separation is clear, but in real programming it is not clear and to discover these lines of separations is basically the essence of building a system. I think Brad Cox was occupied with that with his Software-IC concept and I kind of share his view that this is yet to happen. Things we build are not as composable as they should be; as they are in other industries.

ZuoCen_Liu

While I agree with MacKinnon in principle, we must acknowledge that simplicity is a luxury enabled by the surplus of compute power. > There are domains where 'cleverness' isn't just a vanity project, but a hard requirement. Take the Fast Inverse Square Root from Quake III or modern Zero-copy networking in high-throughput systems like Kafka. If we prioritized 'simple and readable' code in those contexts, we would be leaving orders of magnitude of performance on the table.

Sometimes, 'clever' code is simply code that refuses to ignore the underlying reality of the hardware. The danger isn't cleverness itself, but unnecessary cleverness applied to problems where the bottleneck is human understanding rather than machine execution.

netbioserror

Obvious is good. Optimization can come later. Cleverness is for when you are out of options.

The programming landscape 30+ years ago and its severely constrained resources strongly biased our idea of "good software" in favor of cleverness. I think we can say we know better now. Having been responsible for picking up someone else's clever code myself.

themafia

> severely constrained resources

Energy is a resource. Mobile computing devices demonstrate this constraint already. I predict that what is old will become new again.

andersmurphy

Do we? I feel the layers of abstraction are quite extensive now. They are anything but simple.

Ygg2

(Good) Abstraction is there to hide complexity. I don't think it's controversial to say that software has become extremely complex. You need to support more spoken languages, more backends, more complex devices, etc.

elktown

The most complex thing to support is peoples' resumes. If carpenters were incentivized like software devs are, we'd quickly start seeing multi-story garden sheds in reinforced concrete because every carpenters dream job at Bunkers Inc. pays 10x more.