After some more hacking around, my code to handle IFF/ILBM images in HTML5 is reasonable complete, that is, it handles most of the image files I found, some exotic graphical modes.
The code is, of course, far from perfect, it was more a personal exercise than something useful – the image format that it handles is both obsolete and inefficient. One could ask me why I do this kind of things, and the obvious answer would be because it is fun. While this answer is valid, it is not very useful, in the sense that it does not explain what motivates me to do such coding, after all, coding is already my work, so why would I do it during my free time?
First, this coding that is pretty different from what I do for work: the scales are very different, a bit like an architect doodling houses as hobby. This code manipulates old data-structures where things were manipulated at a low-level, individual bits are manipulated around. At works, I rarely code at such a granularity, so it is an refreshing experience. Cracking open an old format like this is pretty much like a puzzle, trying to align the various instructions until the image look right.
This particular puzzle links images and data structures from the time I first learnt coding with much more modern technologies, spanning in time a good chunk of my coding experience.
While there is a strong technical basis, coding relies a lot on practice: quirks and idiosyncrasies are common, and without some intuition it is difficult to handle the monstrous complexity of the different frameworks and languages. Each time I have to learn a new one, there is this mixture of dread and excitement not unlike when one is at a foot of a mountain, about to try to climb on it. Small coding exercises like this one are a bit like a Sunday stroll on the small mountain close to my house.
Coding has certainly something in common with martial art practice – leading some to the concept of code dōjo. Like in martial arts, practice is important, but even more important is the notion of being in the flow, to be concentrated on the task at hand while at the same time being relaxed. Coders tend to express this as being in the zone, different words for a similar idea: at least for me, being in the flow while doing Aikidō is eerily similar to being in the zone at work.