Skip to Main Content
Official App
Free – Google Play
FreshBooks is Loved by American Small Business Owners
FreshBooks is Loved by Canadian Small Business Owners
FreshBooks is Loved by Small Business Owners in the UK
Dev Blog

Songs In Code Contest

by Anton Nguyen on August 18/2011

A Michael Jackson song came up on my iPod one day while I was writing unit tests. As I listened to him croning on and on about how “Billie Jean” was not his lover, I thought to myself, “why doesn’t he just write a unit test and assert this fact once and for all?”

This idea reminded me of a twitter meme a few years back (), that was very entertaining. I wanted to give it try with other songs, so I gathered my fellow and we started codifying our favourite songs.


We want to see what creative ways you can turn your favourite songs into code! Email your entries to [email protected] and we’ll award our favourite “Codified Song” with a $100 Gift Certificate for Amazon to buy you’ve been eyeing!

Send in your entries by 6:00 PM ET on August 23nd and the winner will be announced soon after!

Our Take on Songs in Code

Michael Jackson - Billie Jean

assertFalse(self.lover == "Billie Jean");

Hall & Oates - Kiss on My List

best_things_in_life = ['your kiss']

Splendau Ballet - True


The Lonely Island feat. Akon - I Just Had Sex

function is_valid($action) {
   switch($action) {
      case "she kept looking at her watch":
      return true;
      case "but I cried the whole time":
      return true;
      case "I think she might of been a racist":
      return true;
      case "she put a bag on my head":
      return true;
   return false;

Justin Bieber - Never Say Never

void say(string word) {
   if (word != "never") {

Bruno Mars - Grenade

try {
} catch {
function get_all_love() {
   throw new Exception("grenade");

Willow Smith - Whip My Hair

while ( {

Drake - Forever

SELECT FROM song s JOIN artist a ON s.artistid = a.artistid WHERE a.lname = "ever" AND a.fname = "greatest";

Kiss - Detroit Rock City

$detroit = new City("Rock");

Starship - Built This City

class City extends RockNRoll {}

Hall and Oates - Make My Dreams Come True

~/$ make dreams-come-true

Jackson 5 - Blame it on the boogie

git blame foot_control.c
0fcfd160 (The Boogie 1978-10-23 13:04:43 -0700 1) #include "funk.h"

Barenaked Ladies - Million Dollars

if (self.bank_account.totalBalance() == 1000000)):
   return buyFurCoat()
def buyFurCoat():
   // That's cruel!
   return notRealFurCoat()

LMFAO - Party Rock Anthem

~/$ cat anthem
45 18 * * * shuffle

Creedence Clearwater Revival: Bad Moon Rising

   .see([earthquake, earthquake, lightning])
   .see(new Date('25:00:00'))

U2 - With or Without you

return concat(("with" || "without"), "you");

A Flock of Seagulls - I Ran

while(night() && day()){

Dead or Alive - You Spin Me Round

assertLike(record, baby.spin(me.right_round()))

Madonna - Like a Virgin

~/$ ls -a
. ..
~/$ touch virgin

Beastie Boys - Right to Party

if(!self.fight){ = False;

Eminem - Lose yourself

self.private = {
   palms: sweaty,
   knees: weak,
   arms: heavy,
   sweater: { vomit: spaghetti},
   nervous: True
self.public = {
   calm: True,
   ready: True

Rebecca Black - Friday

$days = array('yesterday' => 'Thursday', 'today' => 'Friday', 'tomorrow' => 'Saturday', 'afterwards' => 'Sunday');