WIP - TBD

I always catch myself admiring simple and elegant algorithms whenever I'm reviewing a codebase or trying to learn a new technique. It's a strange feeling because I don't fully understand what criteria my brain uses to define what I consider elegant or beautiful. The feeling of admiration that makes me gaze at something–it doesn't matter if it's a painting, picture, or a landscape—is also incomprehensible to me most of the time. I have no background knowledge on what and how personal taste is developed, and it's especially intriguing to me why I find some algorithms more elegant than others. When talking about the physical world, it's easier for me to grasp why I consider some things prettier than others, but I've never managed to understand why I make those distinctions when looking at code. The goal of writing this article is to aid me on finding an answer to that.

The most interesting part of this endeavour is that I should not need any type of theoretical knowledge to understand my own taste, or at least I'd like to avoid looking inwards with someone else's glasses. So, why do I find some code more elegant than others? There are some definitions that I have to understand to answers such questions. Firstly, what is elegancy? What is an algorithm? And, most importantly, how do my brain relate those concepts?

What is elegancy

It's so beautiful when I stumble across such simple but open ended questions. As someone with a very technical background, I find myself struggling to reason about those concepts. It's hard for me to accept a definition that is not based on established axioms. And having spent most of my life focused on specific topics, makes it harder to find axioms outside the computer science realm to build my logic upon. If I need to understand a topic related to Set Theory, I can rely on the ZFC axioms but I have no idea what to base my logic upon when trying to ask "What is elegancy?". Here I'm facing an crossing, should I try to build up my reasoning from scratch to answer that question or should I try to once again stand on the shoulders of giants?

What is an algorithm

On the beautiful overlap of the abstract

Back to posts