Skip to main content

Songs in Code

out of the blue November 2, 2012

A little discussion on readable code-

Jacob Emerick

As a web developer with a wide variety of programming experience it is always interesting to jump into a new codebase. Even if the language is different than what I’m used to I can usually figure out what’s going on by looking for familiar structures or obvious logic paths. Sometimes, if I’m really lucky, the naming conventions and layout can be descriptive enough to show me what’s going on.

To show you how this could work I wanted to bring up an internet meme that showed up on Twitter in 2009. Named ‘songs in code’, the idea was to describe a song lyric or title using a programming language. Since it was on Twitter any snippets were restricted in length, so some of the entries were quite creative. Even if you don’t have any coding experience, go ahead and take a look at some of these snippets and see if you can figure out what song they represent!

Hopefully you were able to guess the song for a few of these blocks. Ideally code will be written in such a way that it gives as much context to an application as some of these song snippets. By thinking a little more about variable names and structure a programmer can help future people understand their application without wasting time guessing and browsing multiple blocks.

Oh, and in case you wanted to know what the titles were (in order)-

  • Satisfaction – Rolling Stones
  • Never Gonna Give You Up – Rick Astley
  • Let it Snow – Sammy Cahn

Happy coding!