Painting with code
I’ve been painting since childhood, exhibited paintings at couple of exhibitions. Also, I’ve been coding throughout college as part of curriculum which continued in my professional life as a developer. Every time I indulge in coding, it always felt like painting. Perhaps it is joy of creating and the creative juices that flow is the same. I was wondering if I could correlate the process from both the worlds and share my thoughts. Perhaps it resonates with readers. So, here I come to pen down my thoughts!
This write up is effort to compare and match the dots of both worlds. Although it’s difficult to put a finger on exact parts of processes and tie them together, it is more of an approximate matching. Hopefully it helps to look things from a different angle about the way we think about building software, orients mind to look at building software as an art work, in particular the process of coding.
In coding world, we often come across terms such as architecture, design, low level design, coding, reviewing and so on which are building blocks in terms of process of building software. In a parallel world of?art (painting) we have thumbnail sketch, composition, actual sketch, under painting, big patches and detailing brush strokes match those processes from software world.
Let’s see how they match up in terms of process and patterns of thoughts, I would like to call them ‘thought patterns’.
Thumbnail sketch vs proof of concept (PoC)
Thumbnail is rough sketch often done on corner of a sketchbook which is very loose depiction of overall painting.
Guess what we can compare it in coding process??It could be “back of the envelope” calculation or rough box and stick diagrams. If a bit of coding is involved, it can be termed as proof of concept (PoC).
These activities help us visualise how end goal might look like in very crude fashion -ideation.
Composition vs architecture?
Often we tend to separate code and architecture roles. As a matter of fact, a good piece of code involves understanding of architecture which clearly lays out relationship with other parts of the code/components. Such as, interfaces which carves out ‘borders’ between code components.
These borders can be defined differently by different architectures.
For example:?
Similarly, painting involves understanding of placement of objects, their interaction with light source depicted in painting, depth of the painting, like objects in the far is in lighter tone of than the ones in the front. Also, to understand ‘movement’ of the eyes of a viewer, which is comparable to ‘user experience’ or ‘ease’ is software.?
What about review? Taking a step back and viewing it from various points of view such as, how a future change in requirements needs to fit or check if it is able to handle catastrophic events. This is formally termed as?“architecture review”.?
In painting world, it is literally taking a few steps back from the easel to get a ‘feeling of right aesthetic’ as an artist.
Once architecture is laid out, ideas to fill up those components starts to ooze. So, the next obvious step is to think about individual components. It’s more?like ‘fill in the blanks’ or ‘fill in the colours’ activity in kindergarten.
Large brush strokes vs high level design?
Now that we know which object fits in which place, in a painting we take a large brush filled with ample amount of paint and fill up the objects. Note that we are not touching or altering the placement of objects.?
It is very similar to carving out major ‘classes’, ‘functions’, interface files,flow diagrams, namespaces without altering the interfaces.
One of the pitfalls in this activity is to focus on granular level items because it feels like it can be done easily and temptation to figure out all at once. This not only distracts from big picture but also affects sub components' interaction in long run.
领英推荐
Smaller brush strokes (detailing) vs low level design and coding?
Detailing with smaller strokes, carefully done to get visual objects to life. This involves a great skill acquired over years of practice because chances of things going wrong is too high in every step.
For example: Right amount of paint to get right tone, right pressure on canvas with paint brush, ability to hold brush still and manoeuvre?just right to get the borders clean, etc.
Similarly code snippets carefully crafted to cater to interfaces, classes and functions. Skills around this may involve subclassing, writing many new functions, constant refactoring along with knowledge of design patterns which helps to move the code around to make it more manageable, writing utilities and libraries, understanding time and space complexities, knowing language specific pitfalls such as handling dangling pointers, null pointers in C/C++ or a simple loop which may overstep on unknown memory only to crash. List of being aware of these things can grow incredibly long!
How do we ensure painting is just fine in art? it is subjective to viewer but in code we need to make sure that we have sufficient tests, observability (logging), debug-ability etc. This is the place where code diverges from being an art to a measurable scientific product.
Common traits of artists and developers.
Patience. In my opinion this is the most important trait.
Painting can be challenging and it can test the limits because these is a lot of room to mess it up even if it’s well planned ahead of time. Only way to get better is to make most mistakes and naturally, over the period of time, we kind of notice patterns that create mess.?
One of the examples in coding is having multiple return statements with different types in dynamically typed languages like python (languages like C can detect them in compile time). This makes it harder for the caller functions to handle various data types and adds room for errors when function adds a new return statement. It is nightmare if someone else is calling the function which usually is the case.?
A similar mistake can happen when artist is not aware of source of light and rushing up to filling colours engrossed in the ‘creative’ process to make that one object under the brush look beautiful but in a bigger picture it may look odd or clumsy.
Since mistakes of various degrees can occur at every step, it can be notoriously irritating and feel like walking on the edge of the knife. This is the exact reason why many people quit painting or coding. It can be a stressful, treacherous process initially until one comes across most common mistakes and learns to to handle them.
Other traits include
What is it so special about creating?
Process of coding, painting or any other form of art can be rewarding in terms of being engrossed, engaged for long periods of time. It is a gateway to get be disconnected from the distracted world -more like meditation. Another reward is looking at finished work -oh it never does, isn’t it?, and wondering how it went from nothing to a piece of beautiful work, satisfaction of having created something out of thin air. It’s like magic. There it is, your ‘aha!’ moment to cherish.
What does it take to be good at it?
Well, we can learn all the jargons, make pleasing presentations (which is an another different skill altogether), etc. but nothing can ever replace sheer practice.?
It’s not only with code vs painting.?Any artistic journey has similar pattern. For instance, in music a composition is outlined like architecture in software, and then filled with instruments, dynamics like writing actual code.?
This is one of the reasons why many people who are into coding love to sketch, paint, doodle, play musical instruments. Similarly you can see why some actors are good singers or musicians. Michelangelo was equally great at sculpting and painting, Leonardo Da Vinci was an artist, biologist, engineer among many other things. Rabindranath Tagore was a painter too, who penned several literature masterpieces and the list is endless.
It is a great way of leveraging learning experiences from one form of art to another.?This is one of the reasons I encourage my friends to continue practicing the hobby that they let go long ago. Any form of art you like which can reward in unexpected ways. Especially it helps to look at world from a different or fresh perspective.
I hope you can relate to art when you are writing code.
Thank you for reading. Let me know your thoughts!
Well written Diganth D R The blog depicts on how an artist is focused when he is passionate about his work. During the blog read, I could relate the importance of the traits which you mentioned to keep everything in track and being consistent. It's all about the continuous effort in the long run which gives so much of insight about the piece of work,It may be coding or any other form of art with right focus and the involvement one can create the sense of purpose in life.
Sr Manager
2 年Excellent Article, this topic we have discussed in so many instances, and I am glad you took out time to write them down.
Technical Leader/LPO at Nokia
2 年amazing lingo!!! totally get painting complexity now!! hope to paint soon!