[OPPORTUNISTIC UPDATE]
Since I'm seeing so many hits for this page, and since most of you are developers, I thought it might be worth trying to do a little blatant recruiting ![]()
If you are an exceptional, passionate front end developer (HTML, CSS, JS) and you want to work in an awesome SCRUM team at a huge multinational company in the South of the Netherlands, please drop me a line (DM my Twitter account).
There are also opportunities for developers (front and/or back end) and UNIX gurus at another brilliant company (Competa) in the Randstad. Basically, if you love tech and you're looking for work in Holland, get in touch!
[UPDATE]
This code isn't meant to do anything - it's purely symbolic.
And yes, I know it will cause a stack overflow if you run it - that's the point that I die, "run out" of memory or suffer some other system failure. Clearly I'm not immortal, so there needs to be some end to the recursion eventually
(function(){var k=[];return function j(){k.push(i);j();}})()();
That's what I got tattooed on my forearm last week. Reactions have ranged from incredulity to hilarity, but I love it.
So why did I decide to spend the rest of my life with an obscure snippet of JavaScript on my body? Well, because I wanted a tattoo that meant something to me, not anyone else. I wanted something linked to my work and my passion: web development. And I wanted something no one else would have.
I briefly Googled "developer tattoos" and "programmer tattoos" looking for inspiration, but the only good thing that came up was the (admittedly brilliant) </head> <body> tattoo that you've doubtless already seen:
Having been let down by the Interwebs, I thought "how better to commemorate my love for code than in code?".
The obvious choice of language was JavaScript. It's the language I've been using the longest (although I've only been seriously into it for the past year or so since I got to work on JigLibJS). JavaScript is also one of core foundations of the web, and looking at recent developments that's not likely to change anytime soon. Also, it's an open standard, which is what I believe the web should be all about.
So, what should I say with my code? I decided I wanted something to remind me of the values and philosophies I strive to apply every day in my work, and in my life.
(function(){var k=[];return function j(){k.push(i);j();}})()();
This code structure is called a closure. If you don't know what a closure is, you can read about it here: via Wikipedia. The short version: it's a function that returns another function. The returned function has access to anything created in the scope of the parent function - just like private class members in full blown object oriented languages like C# or Java. I decided to go for this structure for 2 reasons: firstly because I find it very beautiful, and secondly because I wanted the code to support growth or accumulation in some way.
(function(){var k=[];return function j(){k.push(i);j();}})()();
The k array represents knowledge or experience.
(function(){var k=[];return function j(){k.push(i);j();}})()();
The function j returned by the closure is recursive. This is to remind me that I should maintain my own drive and motivation - that I should always expect more of myself.
(function(){var k=[];return function j(){k.push(i);j();}})()();
On every call, the function j attempts to add the contents of variable i out of the global scope to the enclosed array k. The eagle eyed will notice that I have not included a safety check here so that if i is undefined, the code will error out and the recursion of j will fail. This is intentional. The variable i represents input from other people, and I want to remember that I should always seek the advice and opinions of those around me. I know that I cannot grow in isolation, hence the catastrophic consequences of failing to garner the contributions of others. As I mentioned above, the k array represents knowledge or experience, and this part of the code also reminds me that I should always learn from the input I elicit. This doesn't mean to say that I should always accept or act upon advice I receive, just that I should learn from it. Even poor opinions can teach us a lot about the people who offer them
(function(){var k=[];return function j(){k.push(i);j();}})()();
Both the closure and the returned function j are self invoking. That means that the code will run itself: the functions do not need to be invoked from elsewhere. This is to remind me that I should take the initiative in my life and work, not rely on external influences for the impetus to start new things.
So, that's it. Every time I look at my arm I will be reminded of the values that are important to me, and of my love for code.
Much better than some Chinese characters that may or may not mean "luck" or "strength" I think, and every bit as cryptic.



cool tatoo.. but dude, that canvas animation of yours is wasting like 20% off my CPU. And flashblock can’t catch that
It’s a crime against humanity.
Thanks jc

20% of your CPU? What are you browsing on? A Commodore 64?
My entire Firefox process is only using 14% of one of my 8 cores! Well worth it for such an awesome animation I reckon.
Seriously though, I’d be interested to know what browser, OS and hardware you’re on.
And… are you J. Random Hacker by any chance?
I don’t know of a C64 browser that can interpret javascript. (as a matter of fact, I have one too
) but yeah, I didn’t clarify that. I meant off one of my cores. I’m browsing on an ancient P4-based system (core duo) with Firefox 6 (Gentoo linux running compiz). Yeah it’s an awesome animation but wouldn’t an animated gif, apng or anything else be enough ? Why javascript ? My ARM920T-based phone with firefox wouldn’t like this site at all…
Maybe at least let the animation stop when a person scrolls outside the image or switches tab if js is necessary?
And yeah, I am, I came here by your tweet
Yeah, fair point
Actually, there is an animated gif version as a fallback for browsers that don’t support canvas.
I made it in JavaScript, because I intend to implement control of the character when I get some time. So you can kick, punch, duck, jump etc. using all the animations from the original arcade game.
I’m sure someone’s going to build a CanvasBlock plugin before long.
I will look into disabling the animation when it’s off-screen as you suggest though.
Wow that sound really cool, be sure to tweet about that
I found this thing, supposedly you can tell a tab becomes active or inactive by the window focus and blur events: http://stackoverflow.com/questions/1760250/how-to-tell-if-browser-tab-is-active
But I can’t find if you can tell whether at least a portion of canvas is ‘being drawn to the screen’.. If you find it, I’d like to know too
Will do
And thanks for the link – will read it tomorrow. Bed time now!
What, no syntax highlighting?
I did consider it, but I was afraid people might think I was a geek.
Is there any reason to believe you’re not?
I was trying to be funny. Of course I’m a hopeless geek
Right, it’s much better to highlight function’s name in your favourite tattoo design
For more ideas try to use advices on how to design your own tattoo
Bob
Would have been nicer if you sent me the link before I got the tattoo! Damn your lack of prescience.
Lisp would have been more succinct and more enduring- plus you could have disposed of the statements and had pure expressions.
But JS is the future of the web in my view, and it’s what I work most with nowadays.
on just lambda calculus
or just lambda calculus
Fantastic sir. I was a little appalled at its length at first, but, after your explanation, I think it’s absolutely perfect.
Thank you, sir. You are a scholar and a gentleman : )
Do you always mock your commenters?
I wasn’t trying to mock you. My thanks was genuine, I assure you.
Clearly the trailing paranthesis also represent a pair of balls no?
Brilliant! Extra meaning.
I got a JS tattoo too! Check it out here: http://www.qwertypants.me
Nice one! Less cryptic and easier to explain to non coders too I should imagine.
Thanks! And yes, it’s pretty self explanatory. I think you and I are the only ones I’ve seen with JS tattoos… on the same arm no less! Good stuff
It looks infected. You’ll probably lose your arm.
I was just going to scold you for not defining i, then I went back and reread. Good call, sir.
+1 for the minified js. -1 for use of global variable. That’s a big reason to implement closure, avoiding global scope!
I never seen so much love for code. Never.
Mine is a bit simpler, but same concept.
https://lh6.googleusercontent.com/-zRAtlpP-3kU/TjyqFALzaII/AAAAAAAAAQU/POpIu9kNtds/s1024/IMG_20110805_193430.jpg
Well, that beats Euler’s Identity tattooed on my back. Very cool and creative tattoo; the explanation is also superb.
Thank you.
Tattoo underneath it:
ReferenceError: i is not defined
That’s intentional : )
http://matt.might.net/articles/compiling-up-to-lambda-calculus/
But.. but… it is infinitely recursive. I agree that is is worth while to always try to learn something from everything you experience, but eventually, something has got to kill that thread or you’ll have no resources left to learn new things cause you’ll always be busy re-interpreting everything you have learned so far.
Sorry, I went way too meta.
Nice tattoo and nice meaning.
Maybe his JS-Engine implements tail-recursion…
Personally, I have the combinators S & K tattooed to my chest. It always reminds me that simple rules give complexity, never under estimate the potential of any system, and that I can exploit the simple rules to get complex behaviour.
For reference, S and K are Turing Complete, and using \ as a lambda character. The top is S, and the bottom is K:
\f.\g.\x.(f x) (g x)
\x.\y.x
I’m actually surprised you didn’t make bigger. But very nice and definitely a great conversation starter – even with non-geek laides.
Actually, I suspect it might have a strong contraceptive effect : )
What’s the significance of the stack overflow error that results from executing this function?
That’s when I die or start dribbling. The point is to keep going until there is a system failure.
I’m not that familiar with this syntax, but aren’t you adding the same i over and over?
Yeah, but i comes out of global scope and it’s value can change outside of this code.
Okay, so I assume from your response that it runs asynchronously. You better make sure you keep updating i really quickly or your k[] will fill up with duplicates
Nice tatoo & explanation, but you should have asked your tatoo artist to use a fixed-width font
My arm isn’t long enough to fit a monospaced font
Awesome tattoo!
I also love the font you use for your site. Very beautiful and legible.
Thanks
@font-face ftw!
I was going to say the opposite. For some reason, your font renders very poorly on my system (WinXP – ugh, work PC, Chrome 14)
http://i.imgur.com/AbtHM.png
Wow, that is fugly!
WinXP + @font-face == fail
Strange that Chrome doesn’t respond to the hack for switching off Windows font smoothing.
Refactoring this code will be particularly hard to do now
i = can’t get a job without a long sleeve shirt
j/k
or how about
your google wallet = cost of tattoo + cost of tattoo removal
j/k again
seriously though… have fun explaining that one EVERYTIME someone asks you about it!
Inspired. Awesome work!
Wonderfully thought-out, like a true genius programmer. Unfortunately, it looks like it was designed by a programmer, too! When you’re old, the entire function will be a huge blob of green and will most certainly not run anymore
Another coder’s tattoo: http://www.flickr.com/photos/an-di/5752060161/in/set-72157626790449098. The arm is of Brian Leroux.
I think I’ll do this code someday. In C.
int main(void){ int x = 0×00677548, y = 0x0053206F, z = 0x00616E65; printf(“%s%s%s\n”, &x, &y, &z); return 0; }
How long is your arm?
Probably doesn`t fit, but I got a smaller version
void main(){ int x = 0×00677548; printf(“%so\n”, &x); }
Totally regretting the COBOL tattoo I got now.
Mad respect to you my brother in blood. You do code, without which my design would be a dead pixel on the screen, I do design. You wear your geekiness with pride, I wear mine. http://www.nivas.hr/blog/2009/01/20/more-blood-for-the-adobe/
Internet *high five*.
Internet high five back
But once you call the returned function it will never return control and variable i will always be the same.
You will even have to reboot yourself every time you run that.
It’s not designed to be run – it’s purely symbolic
Well, I guess our environment is not a browser and we are not one single process, so variable i WILL do change, so the code is fine.
We all need to reboot ourselves from time to time, anyway…
Indeed
IF (yes, big if) I were to ever consider a Tattoo it would read: “Live to code, code to live” to paraphrase Harley Davidson enthusiasts.
Can I tattoo that on my arm too? Love the idea and your explanation.
You should come up with your own idea to make it your own!
It’s a lot more satisfying to have something personal to you I think