Mark Llobrera

Guido van Rossum on “Cryptic Code”

This farewell to Guido van Rossum (creator of Python) on the Dropbox blog has some notes and quotes on code style and maintainability that resonated with me:

…as the company grew, new engineers who joined couldn’t understand the code. Clever code is usually short and cryptic, written by and for the individual who came up with it, but is hard for anyone else to understand—and nearly impossible to maintain. Guido called this “cowboy coding culture”. He recognized its value in our early stages of trying to implement things quickly, but knew it wouldn’t be sustainable over time…

“When asked, I would give people my opinion that maintainable code is more important than clever code,” he said. “If I encountered clever code that was particularly cryptic, and I had to do some maintenance on it, I would probably rewrite it. So I led by example, and also by talking to other people.”

It’s not always limited to new engineers, either. How often have you come across a piece of clever code, cursed under your breath at the person who wrote it, and then checked git blame to realize that the culprit was yourself, from several months/years prior?

The whole post reminded me of Christian Heilmann’s post, “Terseness Tension”, for which I also wrote notes.