Is Programming Similar to Composing Music?
Some note worthy parallels for these professions. I am sure it will strike a chord with you.
Join the DZone community and get the full member experience.Join For Free
over the last couple of decades, computer scientists with an interest in both musical composition and programming have managed to marry the two together. artificial intelligence can now compose music that is practically indistinguishable from that which is created by professional musicians.
it’s no secret that many professional developers have a real passion for music, and many musicians dabble in computer programming too. for example, elvis costello, the prolific british musician who’s been described as ‘ the finest songwriter of his generation ’ operated an ibm 360 in the 1970s before his musical career took off.
you can see why people might be drawn in by both concepts; there’s a lot that composing melodies and writing algorithms have in common. on the surface the two may seem quite disparate, but there is a creative side to developing, and a mechanical side to composing. so, just how similar is programming to composing music?
you’ve got the music in you
let’s first take a look at the similarities between composition and programming.
1. they are both about following logical rules
composing music, just like programming, requires what the ancient greeks called the trivium . you need:
- grammar: a solid grasp of the fundamentals – be that musical notation and theory or knowledge of programming language rules
- logic: you need to be able to create ‘logical arguments’. when writing music or code you need to follow logical rules to get the ‘moving parts’ to work together correctly.
- rhetoric: as well as following grammar and logic, you need to be able to persuade listeners and users of new approaches to standard practice.
without following the fundamentals of composition or development, things just don’t work. a haphazardly written program will be full of bugs, in the same sense an ill-formed chord structure will create dissonance .
2. they are about making something beautiful from small parts
to be a great pianist, you must first practice and perfect the basics: simple, repetitive scales and arpeggios. to be a great developer, you need to spend a lot of time ensuring even the simplest expressions are elegantly and correctly coded. once you have the small pieces in place, you’re then able to build something greater, which is equally as important:
3. you need to be able to see the bigger picture
just as a composer must consider all the different sections of the orchestra and how they will gel together, a developer needs to hold an abstract ‘bigger picture’ in their head as they start building their program’s architecture. both disciplines are about building up towards something bigger and better.
4. self-expression is key
music and software development both require creativity and self-expression; both are about cultivating your own style and creating something new and inspiring.
5. you need to be technically engaged
musicians and developers need to spend a long time thinking about how their creations will interact with other outputs, and in the hands of ‘end users’. a composer may add accent marks to instruct members of the orchestra the style in which to play. a guitarist may want to think about using external hardware (amps, effect pedals etc.) or how they want their song to be produced in the studio. developers similarly need to bear in mind how others will use their end-products, on which kind of device and in what context.
6. they both include collaborative and individualistic aspects
mozart might have spent a lot of time alone working out how his next composition would sound, yet his skillset also required working with others – namely the musicians he was conducting. similarly, the most successful developers can’t be pure introverts; they need to collaborate with end users, managers, ux designers and so on.
i’m no musical dev!
while there are a lot of things these disciplines hold in common, it’s worth hearing out the arguments against. not every developer is set out to be the next beethoven!
1 . is this kind of comparison just a way that we as developers puff up our egos?
as the author of the coding horror blog argues, comparisons that developers draw between their craft and painting, music or other art forms could be seen more as self-aggrandizement than a real comparison. of course, we’d all like to think that the app we’re building is just as wonderful as the best of gershwin , or that the website we just designed has the same lasting impact as miles davis’ kind of blue . but let’s be honest, it’s not quite the same thing, is it?
2. programming is about solving a problem
when you’re asked to design an app, for example, it’s usually in order to solve a specific business or consumer problem. developers excel at solving this kind of issue, yet can this really be compared to music? at its purest, composition should be about representing and inspiring pure feelings and emotion.
3. programming has a very different purpose than music
when you develop any kind of tool, the final goal is for an end user to be able to do something specific with it. say you’re building a business app – your creation should mean that the end user’s day to day tasks are facilitated. music, by contrast, doesn’t really serve a specific ‘purpose’, beyond pure enjoyment.
weighing the balance
the jury is still out on this one; while it’s clear that composition and development definitely hold certain factors in common, there are also a lot of areas where they diverge. what we do know is that both developers and musicians can enrich our lives and give us things we never knew we needed and which we now can’t live without.
Published at DZone with permission of Josh Anderson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.