Hello, my name is Jan Jarfalk and I am an interaction designer and interface developer.

I’ve been working professionally with the web since 2002. Back then I had my own company and did everything myself. Now I am a bit more specific - I do usability, accessibility and a lot of client side coding. This, Unwrongest, is my personal lab. This is where I try, learn and evolve.

I am a Swedish citizen from Stockholm that currently lives and works in Sydney, Australia. From here I work for Getupdated's Stockholm based division 'Social Media', where we help our clients to create social networks.

I put function, before design. I love beautiful interfaces, but I like them simple and obvious. I like things that are fast and responsive. Take a look at my projects and I am certain you will notice and appreciate my slipstreamed approach.

There are a lot of Konami Code easter eggs out there and also a lot of guides on how to implement your own. Most of these guides have one thing in common; they are using overly verbose code for something you could fit inside a Twitter tweet.

The last week I’ve seen a dozens of blog posts related to Facebook’s, Jquery’s and many others hidden implementation of the ‘Konami code’ and how to implement one yourself.

One of the things I noticed was that people tend to write very verbose code, meaning, they tend to write a lot more code then they need too. Take a look at Abhi’s 30-rows implementation or Trevor’s Cheat Code Jquery plugin(!).

There are numbers of valid explanations to why people write verbose code; to be overly clear for educational purposes is one. But if you do that, I think you should also teach people that they shouldn’t make a habit out of it, especially when it comes to something so small that it fits inside a Twitter tweet.

// Tweetable Konami code
var k=[];addEventListener("keyup",function(e){ k.push(e.keyCode);if(k.toString().indexOf("38,38,40,40,37,39,37,39,66,65")>=0)cheat()},true);

The code above will fire the function cheat() when you enter the Konami Code (up,up,down,down,left,right,left,right,b,a). The code might be a bit too concies, but I was mainly trying to make a point.

Haven’t seen the Konami Code in action?

Go to www.facebook.com and login. Click once anywhere on your home page and type the following sequence using your keyboard: Up, Up, Down, Down, Left, Right, Left, Right, B, A, Enter Key. Click again or scroll the page.

Comments

  • Hi Jan,

    Nice tweetable code.

    However my intention was never to send it over as a tweet ;) As you said, a bit longer because it should be self explainatory :D

    -Abhi

  • I disagree, you should be in the habit of writing verbose code… cryptic, compressed, unreadable code is never a good idea!

    Cute, though!

  • 20 Oct 2009 | skube says:

    Gives an error in IE6

    • 08 Nov 2009 | RicardoC says:

      Well, the error in IE6 doesn’t matter because most of the website don’t support IE6 anymore ;)

  • fapEY8 nnvajmkezakc, [url=http://htdzlukrnfam.com/]htdzlukrnfam[/url], [link=http://pagtwwcotmdd.com/]pagtwwcotmdd[/link], http://rwgtgfcgetdx.com/

  • 08 Jan 2010 | alain says:

    client side code should be as small as possible and that includes JS. Server side code can be as descriptive as you want since it wont travel in the cloud.

    Also, Jan code is quite simple to understand if you just add a few line of comments.

  • 28 Jul 2010 | shimy1984 says:

    Easy to read code is the best code.

    If you want to shrink it down for production, gzip and/or minify.

    Still a good post though.

Make a comment