I rarely do blog posts just to link to somebody else, because I think my blog is not read by so many people that anyway wouldn’t have discovered that link otherwise.

So I suppose you seen this already Super Mario in Javascript made by Jacob Seidelin. There are many aspects of it what I like:

  1. Its fun to play
  2. It again proves that javascript is a language capable of doing such things
  3. It uses inline graphics. Thats right, no external files. While this is not a problem in any other scenario, in web it saves that extra http request, that with such small sprites adds a lot of overhead.
  4. It is awesome small. Just lately I played around with some Cover Flow js widgets (namely ProtoFlow and ImageFlow, in combination with HighSlide and LightBoxv2) and I was very disappointed that these libs are just that huge. I am willing to take extra bytes for eye candy, but I wont take 40KB just for opening a enlarged version of an image.
  5. It is compressed but not packed. Many people use Dan Edwards packer to make their Javascript smaller. This indeed brings a few bytes, however on every page load the browser has to unpack the script. Even the cached one! I found statistics on this some time ago, unfortunately cannot find them anymore, but they, additionally to common sense, convinced me that packing Javascript is not a good idea.

A very interesting idea is that he aliases some often used functions:

appChild = function(parent, child) {return parent.appendChild(child);}

by doing so YUI Compressor can shrink the method name, because its a local variable. Pretty neat idea.

Now back to ProtoFlow coding :-)

Ah by the way, does anybody have a better,smaller alternative for lightboxv2?
Features should be: Fade background, display caption, handle multiple pictures in a row (next+prev) Autoresize to screen (a feature that LightBox doesn’t handle). Ideally it should use Prototype and scriptaculous, as this is already set for the project. And it should be small. YUI compressed less than 15k