Josh Swords

The era of beautiful code

I remember finding Tom Augspurger's pandas code years ago and thinking it was beautiful.1

It sounds weird to say today, and new engineers might think wtf does it matter. But beautiful code used to be a thing. It was code that worked and had style.

I think it stemmed from the hacker's adage that "code is read more than it's written". So we found ways to write code that doubled as an explanation for whoever came next.

But it was more than clarity. You could have two functionally identical, well-documented programs, and one would just feel better. Beautiful code.

It was usually the mark of an experienced engineer; it wasn’t novices writing beautiful code.

It’s probably still true that code is read more than it’s written. Just not by humans.

And machines don’t care about style. Now that AI has made code cheap to produce and cheap to replace, its exact expression matters less.

Quantity is a quality all its own, but it’s trodden all over beauty.

And I realised recently that I don't have the same admiration of code any more.

I think that’s an era we’ve left behind. The era of beautiful code is no more.

Footnotes

  1. Tom Augspurger was one of core pandas maintainers. See his Method Chaining post from over a decade ago⁠(!). MrPowers Spark code too.

#musing