Songs in code

Posted by – 2009/09/15

I’m a bit late on commenting on this Twitter meme as it’s over a month old, like all memes it’s a variation of something as old as the Earth and just recently revived. The concept is simple, just write a song lyric or title as a code snippet, set it as your status and share with others by linking the #songsincode hashtag. That’s all.

Someone’s even made a database of all the posts where you can vote on the entries. Most are boring and just consist of lyrics padded out by punctuation, but there are some quite creative, non-obvious ones which use programming constructs to infer the lyrics. Here’s mine

(Hover over the links for spoilers)

class BillieJean : public girl
{ 
  int i; 
  relationship lover;
public: 
  BillieJean(relationship &me) 
  : lover(!me), i(1) {} 
};

spoil

body() { 
  print '<body>' . body() . '</body>'; 
} 
love() { 
  body();
}

spoil

/* mon = 255; tue=wed=0xaaaaaa; */ 
if (friday)
  love.insert(me);

spoil

GET /back.html HTTP/1.1
 
HTTP/1.1 301
Location: /you_once_belonged.html

spoil

Some of my favourites (with slight edits):

video$ kill -9 `ps -ef | grep radio*`

by brozow

int main() {
  return -1;
  get_Satisfaction();
}

by stevecooperorg

$live = ($you==true) ? false : false;

by o_Freud_o

$i = '<HTML><HEAD></HEAD></HTML>';

by whybird

class City : Rock, Roll {};

by alexmdac

try {
  get(WHAT_YOU_WANT);
} finally {
  get(WHAT_YOU_NEED);
}

by rickgrundy

/dev/null << shout();

by plikrg

0 Comments on Songs in code

Respond | Trackback

Respond

Comments

Comments