Why I’d like to write software like I was playing music

I love classical music (mostly Indian). As a kid, I learnt to play the Mridangam (a percussion instrument that comes from South India), but did not get beyond an intermediate level of mastery. Some day, I yearn to learn again…

Music is an art and a craft. While writing software is a craft, I’d like to think it has some qualities of art (some might say, ‘black art’). Perhaps this is due to the relative infancy of the science of writing software. Certainly, there is no way for a layman to appreciate the intricacies of well-written software, other than to marvel at the finished (?!) product. But that is a different debate.


A musician spends years learning and practicing technique. The elements are few, yet permit endless creativity in how they are used together within a framework of tempo (‘taal’), tone (‘raag’), and form. The first challenge is to acquire an ‘ear’ as one plays. Feedback is instantaneous, and the artist knows it the moment he has strayed.

When I mentor a beginner, I strive for them to pick up an ‘eye’ for the code they write. There is organisation, form, abstraction, collaboration, idiom, attention to detail, …even style. With experience, I observe that I begin to suspect something has gone wrong the moment I have strayed from my own standards for these ‘qualities’, even as I work towards my next commit.

I push for them to acquire and set their own high standards. The documentation (and the necessary experimentation) can teach someone the nuts and bolts of it all. I can only impart an awareness of these (possibly more subtle) things. The programming language, the platform, the tools, the libraries, and other such “implementation” specifics will melt into the background, and will inevitably change from season to season, and year to year. But an appreciation for these ‘qualities’ will hold us in good stead amidst the change.


Then, there is deliberate practice. One of the most beautiful words I’ve ever heard is ‘riyaaz’. In the ‘guru-shishya parampara’, it is almost a sin to fudge sustained daily practice. Malcom Gladwell wrote about the 10,000 hour rule in “Outliers”. There are differing opinions about this, but I suspect there is more than a kernel of truth. I certainly can write better software as I keep practicing. Perhaps it is just in terms of improved understanding of the same set of requirements, and lessons learned from hindsight working on the same piece of software, and not so much about an improvement in capability.

I don’t know yet. But I certainly don’t have evidence that says I should practice less to improve my software-writing skills.


The musician spends almost as many hours tuning his Stradivarius. If you have seen a top musician travel, you will see them obsess about how their equipment get into the aircraft hold, and safely out at the destination. The computer, the network, the servers, and other infrastructure are my equipment, and it is important to me to know and master my equipment (and the environments, tools, and techniques). I lay them out with care and pick up and use the right tools for each task. I “listen” to the equipment carefully, remove the cruft that accumulates, and upgrade things as often as I can.


Creating music is a social activity. There is certainly no professional musician who performs, or likes to perform solo. There is no performance without the listener. The audience vote with their applause.

I hope that I will write software that others on the team can live with, not just on my team today, but on other teams in the future once we’ve moved on. I hope that both me and others on the team “carry their own weight”, and are ‘in tune’, note by note.

The software we write performs for our users. I would like for us to write software that the user will stand up and applaud. Our “CDs” will just fly off the shelves, if we could write such beautiful software.


When I go to a music festival; the artists are all at the top of their game. They have certainly transcended technique. When you listen to the very best, it seems almost as if the musical instrument is a natural extension of their personality. But one still has a preference for certain musicians over others that are ‘equally good’. I suspect it is the creative energy that some of them can harness better, that sets them apart.

The creative element is certainly accessible to someone writing software. These immortal lines from “The Mythical Man-Month” come to mind:

“Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”

We are all creating as we write our next line of code. Am I inspired enough as I do so? Do I inspire my fellow performers on our orchestra, as we churn out our next symphony? Do we improvise and not just mimic as we play the well-known pieces?

I have to go now…I can begin to hear some of us preparing to churn out our next composition this afternoon, and I have to play my part in it. You are invited to the performance…!

Krishnan Mani


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s