Programming, or writing code, may seem not so closely related to “art” or “aesthetics”, and chances are that people may never need to or get to see the code behind a computer or mobile application when they’re using it, hence the appearance of the code itself doesn’t seem to matter too much. However, for programmers and programming-related workers, how the code actually looks plays a substantial role-it makes the code easier or harder to read, understand, and modify, and that’s where aesthetics comes in.
To illustrate, from my personal experience as a programmer, there are two aspects I would attend to when I write code: text alignment and text styling.
Just as writing for other purposes, there are actually common practices to follow when programmers arrange their code: spacing, alignment/indentation, and wrappings. While these do not necessarily affect how the codes are compiled and executed, proper text alignment does help regulating thoughts and comprehending when a code is read. In the cases where indentations and new lines actually have program-level meanings like Python and Swift, these text arrangements also help with code layout. To illustrate, no one would be happy to read some code that is displayed like the way it happens in the following picture:
Another aspect worthy of my attention is the styling of the code text itself.
In this way, texts are not squeezed together, and every word with the same number of characters have the same visual length.
On the other hand, different from how people normally writes articles, colours play a decent role in programming. Colouring the code during writing is really helpful, as it differentiates different components (variables, functions/methods, language-reserved words, declarators, comments, etc) inside a program file almost immediately. For instance, a chunk of code with proper colouring may look like this:
From colour design theories and our visual experience, we can tell that a set of triadic colours does serve as a basic type of colour composition that satisfies human eyes. It is really interesting to find this amazing correlation between art basics and programming.
Coming back to the topic, as has been shown in the above peek, programming codes can have nice aesthetics when properly styled and formatted, just like how regular articles do. And as it happens, it is amazing how one may discover that something ordinary in their everyday life actually implements concepts across subjects that they might otherwise seldom think about.