Regularity is a symptom of bad code

Paul Graham, in his essay Revenge of the Nerds, says:

When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I’m using abstractions that aren’t powerful enough - often that I’m generating by hand the expansions of some macro that I need to write.

This has really stuck in my head! I keep thinking it when I write code. It’s like a little angel sitting on my shoulder saying “No. No, Afternoon, abstract this, use a list comprehension, create a function, or a class, or a higher-order function, don’t just be lazy.” It’s a force for good.