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 (#songsincode), that was very entertaining. I wanted to give it try with other songs, so I gathered my fellow brogrammers 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 and we’ll award our favourite “Codified Song” with a $100 Gift Certificate for Amazon to buy all the cool swag 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

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

Michael Jackson – Billie Jean

best_things_in_life = ['your kiss']

Hall & Oates – Kiss on My List


Splendau Ballet – True

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;

The Lonely Island feat. Akon – I Just Had Sex

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

Justin Bieber – Never Say Never

try {
} catch {

function get_all_love() {
   throw new Exception("grenade");

Bruno Mars – Grenade

while ( {

Willow Smith – Whip My Hair

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

Drake – Forever

$detroit = new City("Rock");

Kiss – Detroit Rock City

class City extends RockNRoll {}

Starship – Built This City

~/$ make dreams-come-true

Hall and Oates – Make My Dreams Come True

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

Jackson 5 – Blame it on the boogie

if (self.bank_account.totalBalance() == 1000000)):
   return buyFurCoat()

def buyFurCoat():
   // That's cruel!
   return notRealFurCoat()

Barenaked Ladies – Million Dollars

~/$ cat anthem
45 18 * * * shuffle

LMFAO – Party Rock Anthem

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

Creedence Clearwater Revival: Bad Moon Rising

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

U2 – With or Without you

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

A Flock of Seagulls – I Ran

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

Dead or Alive – You Spin Me Round

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

Madonna – Like a Virgin

if(!self.fight){ = False;

Beastie Boys – Right to Party

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

self.public = {
   calm: True,
   ready: True


Eminem – Lose yourself

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

Rebecca Black – Friday

8 Comments (add comment)

Colin says:
Aug 19/11 6:53 pm

var mGaye = {
getItOn: function(baby) {
if (baby.curPos != {

groove: function(baby) {
// this is a family blog

Colin says:
Aug 19/11 6:56 pm


I could do this all night! So much fun!

Ben says:
Aug 19/11 7:06 pm

Ruby Jay-Z

>> problems.count
=> 99
>> problems.include?(:bitch)
=> false

John says:
Aug 22/11 6:34 am

Here’s mine :-)

Noelle = new Object;
dirtbag.dream( Noelle );
Noelle.ringsbell = true; = true;
Noelle.givesdamn = false;

Aug 22/11 6:26 pm

(Me + you) && (you + me)
var nomatter = dice.toss(); assert (it != null)
me.Only1(you); assert(you == me.Only1());
(Me + you).happy = so;

Sep 1/11 3:29 pm

Who won?

Ryan says:
Sep 7/11 10:46 am

Late entry, but made me laugh….

$ touch /this
touch: /this: Permission denied

Richard says:
Sep 7/11 10:47 am

[mchammer@hammertime syslog]$ touch /this
touch: cannot touch `/this’: Permission denied

Leave a Comment ( *required)