What makes code beautiful? What makes it ugly? What makes it pleasing to the eye? What makes it an eyesore?
What is beauty to you? Is your wife beautiful? Are your children beautiful? Those flowers, that sunrise, that ocean, that chiseled muscular physique on that model or sports(wo)man – are they beautiful to you? Maybe yes. But why? Can you explain it?
I am by nature an aesthete, and for me things have to look pretty. I would say what makes things pretty is if they perform what they are meant to perform, and it makes them visually appealing if they have the right proporions – you know, not too fat, not too thin, not too short, not too tall. Just like the golden ratio governing the proportion between several body parts or other natural objects. You’d think when it comes to code, similar principles should apply, right?
Well, you will be right. And maybe many of us do it instinctively. But many of us probably also do it subconsciously and don’t really think about it. This talk here will probably shed some light on the concept. I am not too impressed by the depth of the talk, yet it is a topic that should be at the back of every programmer’s head, if only for the reason that keeping code clean and pretty will make it easier for you to edit or modify or even understand it later.