Code Mode

23:45 Fri 02 Feb 2007. Updated: 00:47 03 Feb 2007
[, , , ]

My mind is very much focused on coding at the moment. Especially JavaScript/HTML/CSS.

It’s mainly been for work, but a lot of it is discretionary. For example, my friend Varia has been given a task that involves compiling a bunch of statistics from disparate sources into an Excel spreadsheet (yuck), and I decided that I would help her out by extracting some of the data from those sources that are web pages, using Greasemonkey and AJAX. And I got really into that project, despite the fact that it’s mainly screen-scraping.

Although screen-scraping seems so much more pleasant when you have access to the Document Object Model (hence my post about wanting that from other scripting languages).

I’ve also been involved in a project at work that involves writing a specification for transforming HTML into templates/containers for our system, and have gotten quite into that. I’ve been asked to write the spec because I spent a lot of time at Nimblefish doing that transformation manually, and my experience is valuable. I tend to like to write references implementations as well as a specification, though, in areas where I have the ability to do that. And where I can’t do all of it, or it isn’t feasible, I’ll often do proof-of-concept implementations in JavaScript.

I still don’t know if it’s just because it’s the language I know best, but I enjoy writing in it. Mostly small things like the HackyCalendarReminderPlugin for TiddlyWiki, but sometimes larger projects also. Part of it is definitely just enjoying how far the language has come since the early days (or how far my understanding of it has come).

This evening, I decided that what I wanted to spend my time doing, after coding both Greasemonkey stuff and DOM-traversal stuff for work, was coding JavaScript that would take any elements whose sizes were in pixels and define those sizes with em-based units instead. This is mainly aimed at images, so that my “elastic” designs, which are all proportional to font size so that increasing the font size makes the entire layout bigger, can affect images on resize too rather than leaving them out of proportion to the rest.

I originally intended this as something to put on pages of mine where I felt the need, but as I write this I realize that it could make an excellent Greasemonkey script or bookmarklet, because it would give me the ability to make everything on any page “elastic”.

There are some things to watch out for, such as different font sizes in different parts of pages (as that affects em size), and also the effects of padding on the computed width of elements.

But I want to work on it, and the others. I’m just in that mode. Good in some ways, bad in others, because I have other stuff to do, and because I suspect this kind of intense focus can lead to burnout if I don’t temper it with other acitivity.

Balance. I might want to just code, but I need to push myself to do other things, because both balance and self-discipline are important.

One Response to “Code Mode”

  1. NiallM Says:

    Ah, coding. One of the True Ways to flow.

Leave a Reply