Ben Godfrey

Archive for April, 2003

Questions

For my upcoming ALA article (man, saying that feels good, even if it doesn’t get published), I would like to be able to draw on the feelings of major designers. To this end I’m thinking about sending a simple questionnaire to the web teams responsible for a number of high profile sites.

I’m not sure what the questions will be, but here’s some rough ideas:

  1. Why do you use appropriate layout system to layout xyz.com?
  2. if the page is tables Why don’t you use CSS for layout? CSS is very powerful. Is it because you don’t know about CSS, don’t know how to recreate your layout in CSS or some other reason? else if the page is CSS Why don’t you use tables? They’re tried and trusted
  3. Why is design important for your site? may get the answer “because everybody else has it” which would be fruitless
  4. If you could change one thing about HTML+CSS to make it a little easier to do your job, what would that be?
  5. Do the designers at your location design pages bottom-up by writing code or top-down, using tools such as Illustrator, Freehand, Photoshop or the Gimp?

The other thing to think about is mentioning my ideas. If I say I want to put the grids back into web design, will that influence the answers? Probably. Do I want this? Not sure, I wouldn’t mind feedback on my ideas from the people running the top sites on the net.

iTunes 4

The big new feature in iTunes 4 is Music Store. I’ve already read one person who said “finally somebody has got it right”. I’m inclined to agree. You have a bunch of browseable pages leading you to playlists of purchaseable tracks. They look just like other iTunes playlists, you can even double click the tracks to hear a sample. You can access music from any label and you buy songs for 99¢. It doesn’t work outside the US yet and the selection currently looks bad. I searched for Aphex then Bambaataa and got nothing before giving up and going back to the zzzone.

Micropayments. Fantastic. I’ve got lots of albums where I’m missing a track or two and I’ve got lots of artist collections where I’m missing the odd release. I’ll pay about 60p to get that missing track, oh God I will, I’m a major tidier. If you’ve heard a DJ drop a tune you really like, why spend weeks waiting for it to arrive on SoulSeek or Kazaa when you can just hit a button and let your card do the talking and not much talking at that? I think this is the next stage for music sales, I think that everybody involved here is going to make money. I’m sad that MP3 didn’t quite destroy the music industry. Hopefully it will someday.

Good point from Martwine

Commenting on my initial foray into syntax, Mart said:

I think a really important aspect is what the system defaults to if you don’t give it a specific piece of info — like if you didn’t specify sizes for #gc2, it would default to the simplest sensible configuration rather than making cells disappear off the edge of the screen

Choosing what defaults to use when will be really tricky, given how optimised CSS is, but it is really important will have to be addressed before it is possible to write pages at all.

Zeldman!

An unexpected turn. Last night I sent a rant to Jeffrey Zeldman, of ALA and WaSP fame. The man is one of the gurus of web hacking and for some reason I felt like he might hear my plaintive call. Amazingly, he did. He told me that if I wanted to write an article about all this for ALA, he would consider publishing it. ALA has a readership of about 65,000 people a week!

First of all, wow! Secondly this, and other feedback I’ve had today, has put my activity so far into perspective a bit.

I’ve become way too passionate about it. I need to chill. I feel bad about the ranting and I apologise to all who bore the fury, particularly Eric Meyer. Who I actually also got a message from today, but it was just to tell me not to include replies in my messages to his css-discuss mailing list.

Also, perhaps dropping in and heckling the authors of CSS was not the best way to go about this. I was expecting them to enter into a discussion a bit more, but I guess that’s a bit idealistic. Writing an article for ALA is the ideal next step. It will give me a forum to air my ideas and put them up for peer review. Hopefully I will be able to refine feedback from that article and other channels into an actual proposal. If I can’t get the article on to ALA, then I guess I should just shut up.

I really should read more as well. Theres a lot left undiscovered in www-style archives. Zeldman has written a good many articles about web design that I haven’t read and should. My argument will (and should) sink like a rock if I retread old ground, or fail to see the obvious.

BBC News and some example grid syntax

The BBC news site could in many ways be described as a bellwhether and a goal. It’s intensely gridded and is a pretty nice layout. Also, it’s very highly visited and needs to be compatible with everything. They’re not going to be abandoning tables soon. Still, the page could be used as a test case for new syntax.

One thing that occurs to me about any new kind of grid layout is that it needs to have a much more flexible approach to columns and rows. Obviously it wouldn’t be a grid if there wasn’t some kind of consistency in sizes between blocks, but when layouts get more complex the table author has to rely on increasingly more cunning configurations of colspan and rowspan in order to get the right sized blocks into the layout.

I have been thinking that a good system might be one where the author can define a basic grid, perhaps like this:

#g {
   display: grid;
   width: fit-viewport;
   height: fit-viewport;
   x-subdivisions: 3;
   y-subdivisions: 3;
}

And then define how blocks interact with that grid (gu = grid units):

#gc1 {
   display: grid-cell;
   top: 0;
   left: 0;
   width: 3gu;
   height: 1gu;
}

#gc2 {
   display: grid-cell;
   top: 1gu;
   left: 0;
   width: 3gu;
   height: 2gu;
}

When applied to the following HTML:

<div id="g">
   <div id="gc1">
      Hi mum!
   </div>
   <div id="gc2">
      Look at my page!
   </div>
</div>

This stylesheet would provide a result similar to this table, filling the whole browser window:

Hi mum!
Look at my page!

It also occurred to me that it might be possible to write a simple transformation engine for CSS that takes my suggested syntax and renders it in current HTML+CSS as best it can. Ideally the HTML would not need to be rewritten and the CSS could be translated easily by mapping fluid values on to a specified frame size, in the same way that a browser would eventually anyway. This would be a valuable resource for testing and experimenting. Maybe it’s worth investigating SAC, but it might more useful just to implement it with REs.

Need to read

CSS layout needs to be symmetrical. I’m not sure how the conversation got started, but posts from this thread have turned up in a number of my trawls through the www-style archives. It’s fairly recent (2002) and there seems to be a lot of opinion being about the CSS’s deficiencies.

Urge to kill… rising…

<rant offensiveness="uncompromising">

Feeling really pissed off right now. I just put IE PC back into standards mode by removing the XML prolog from all of the pages of this site, only to see my vertically centered content disappear to the top of the window.

How can any system claim to be a complete design tool when it’s concept of space is so wildly schizophrenic (it’s some paper, it’s a window, it looks crap whatever media you choose)? Because nobody responsible for thinking it up was a designer, that’s how.

I’ve been reading some of the extracts from Eric Meyer’s Eric Meyer on CSS. Eric is one of the WG as well. His page is bullshit, I’m sorry, I’m sure he’s a great guy and everything and he has certainly been a key player in getting us to the situation we’re at now. However, all he does is bang on about how CSS is God’s gift to designers. He demonstrates this with a series of lacklustre designs that clearly originate from the bottom up. Then, in one example that does look vaguely nice, his demo copy is a thinly veiled attack on “pretentious” designers! Aaargh! It makes me livid.

These people are taking the web back to the days when we were all hacking tables to do cool stuff. They’ve written crap specs so that we’re all forced to buy their books or pour through vast tutorials telling us how to make ugly pages we don’t want!

Designers work top-down and while there are no people producing layouts in Illustrator and feeding them to the community, web design is fucked. Adoption of XHTML and CSS layout is not going to happen. I’m even considering putting my prologs back in and perhaps dropping back to XHTML transitional or even HTML 4.

As a side note. I briefly went looking for the origins of the tables bad mantra. It seems to me that it’s a semantic point raised in passing in the Web Content Accessibility Guidelines. That’s it. Tables aren’t accessible so web designers should be deprived of their most expressive tool and not given a replacement. Cunts!

The more I think about this the more I think that the way forward is to bring tables right on back again, but in the way I outlined earlier. Create a new set of syntax starting with some display properties called grid or something and implement them in CSS3. Examine why authors are using tables and provide them with a better alternative, instead of telling them they suck because blind people don’t get design. That’s never been an issue in any other market, where design is vital to performance, so why should poor beleagured web authors be crapped on by a standards body that’s out of touch with reality?

</rant>

An interesting suggestion

From the archives, another design problem.

Ah ha!

The CSS3 border module is well ahead of me, solving the problem of creating rich graphical borders. Sweet. I’ve suggested that another set of properties be added that are almost identical to those for specifying corner radii, but for beveling.

16:49. Restate my assumptions

I’ve just been reading design books in Books Etc and looking at pavements and thinking about the discussion so far. My thoughts:

  1. Grids are a great layout tool. Tables are a bad implementation of grids. There’s no rotation or layering. Elements that should interact weakly (like borders) sometimes have to interact strongly with the content. A good idea might be to formalise layout grids into something other than <table>s, splitting them from data tables completely.
  2. Positioning hierarchies are also very useful. Grids and indeed complex borders would be halfway implemented if we could nest layouts within blocks and define rigid rules for the sizing of those blocks. CSS2 states “[Positioning proerties] specify offsets with respect to the box’s containing block.” This is cool, but it also states “Absolutely positioned boxes are taken out of the normal flow. This means they have no impact on the layout of later siblings.” Thus the result is not what you might predict. See this demo.
  3. CSS is too dumb to suit authors. Authors can specify very quickly what they want to do in different situations, CSS does not allow them to write these specifications down. Example. If Hype is scaled so that it’s only 200 pixels wide, I would want the columns to be stacked, but not in the order they are defined in the HTML. I’d want 1,3,2 instead of 1,2,3. This ties in with a lot of Coises’ problems and constraints seem like a good way to express these nuances. However, I think that conditionals are really what’s needed here and the constraints proposal doesn’t really address that.

XML prolog puts IE 6 into quirks mode

For a while I’ve been aware that there is a problem with including the XML prolog (<?xml version="1.0"?>) in XHTML documents, but nobody has explained what it was and I didn’t bother to go looking. However, it puts IE 6 into “render like IE 5” mode which seems pretty dumb, however, it answers a few questions.

I will be removing the prolog from the pages on this site sometime soon.

Bugger

After asking the WG to explain their thoughts on CCSS, Hixie said he didn’t understand it and that a proposal in the form of a CSS 3 module with lots of examples would go a long way to solving that problem.

Why should I be writing out proposals on my budget of no money? The W3C has a large budget. I’ve identified some problems and I’m willing to both identify and catalog more. Call me naive but I thought it would be up to the W3C to go about the business of finding solutions. Oh well, that’s another drain on my time.

More discussion

After I replied, I got quite a bit of feedback. Hixie explained himself a bit more and pointed me in the direction of a few things in CSS 3. Nothing startling. He confessed that he agreed that CSS may require some extra bits. The problem is that the layouts desired are not simple to specify and nobody, least of all me, has gone far towards solving the problem of condensing the required knowledge into syntax.

Then a proposal from academia for a system called Constraint CSS emerged. In the proposal the authors discuss the additions of rules that describe relationships mathematically. For example, that the first column in a table should be twice as wide as the second, with syntax something like:

#col2[width] = #col1[width] * 2

It looks like a very powerful system, although I have only read the specification briefly. I asked the WG members to feed back on what consideration, if any, they’ve given this proposal, how tricky it would be to add to the current specification and how serious the effect would be on browser code. If a proposal for a change to CSS is to be serious, it has to be incredibly easy for the buffoons responsible for IE PC to code. Preferably it should be done for them.

Hixie weighs in

In my last mail to the list I asked the spec people to comment. Ian Hickson (AKA Hixie) of Mozilla did. Hixie is one of the specifications group and standards QA for Netscape. He’s also an implementor and is really one of the browser big guns right now. However, he said nothing more than that CSS has tables, a cop out!

Tables are good for some things, but in complicated layouts they get nasty. Now we have CSS, but we have the same situation. It’s good, but decent layouts are too complicated to build. A rock! A hard place! Which way to turn? In the last year I’ve solved most problems by using both systems, which is silly and rapidly going out of date.

More feedback

Coises says:

Designers want and need control, but /not/ at the pixel-engineer level CSS2 so readily provides. We need control at the /logical/ level

It’s the relationships between blocks which are difficult to express in CSS, but the ability to define these relationships is what makes tables such a great tool for displaying changing content in a diverse range of environments, the core task of web design.

Some support!

I just replied to www-style quickly explaining my plan, the same content as the previous post but-one really. I got one reply almost straight away:

Just FYI I completely agree with you. Other than inconsistency across browsers, tables are a great layout mechanism — easy to understand and very powerful. I think that the CSS designers saw the “misuse” of tables and threw the baby out with the bathwater. If you simply renamed the TABLE tag to LAYOUT, you’d have a simpler, more powerful, and more familiar tool than CSS layout and no semantic or accessibility issues.

This expresses something which I agree with but hadn’t put down in writing. Sometimes, grids (AKA tables) are a very simple and powerful tool that CSS doesn’t provide. The main problem with trying to do things the CSS way is that often the content needs to jostle with other areas to be laid out properly. It’s those relationships that absolute positioning can’t express, but tables do with ease.

Another problem layout

Blocks with pretty graphical borders.

Often you see content managed sites that feature content split up into multiple blocks. The chief example is probably the weblog. Many people like to put nice graphical borders around each “portlet”, but this requires tables or a whole bunch of CSS faff. The gist is simple, a particular graphic at each corner and then others that scale either vertically or horizontally to fit the sides, the sizes of which are dictated by the content.

An example would be the portlets down the left of Amazon’s front page or the content areas on The Forum’s site (one of mine).

This problem distills down to a more fundamental one: the problem of arranging one piece of content at the left side of a block and another at the right. Another example would be a toolbar that has navigational links on the left, and displays the time on the right. This is a doddle with tables, but in CSS, the float property isn’t powerful enough and wasn’t really designed for the task. As usual you can go a long with absolute positioning here, but it’s usefulness begins to break down as you start including more complex content in your two regions.

CSS Interface Design

I’m still struggling with CSS. I use it lots, the vast majority of problems that I have with are due to browser implementations of the standards, particularly in doing different things for IE PC and the rest of the world. However, there are some things that CSS makes too tricky. I believe that most of them are tricky because CSS is a document language and many of the sites I’m trying to build are application interfaces. I’ve been told this by members of the www-style list. I don’t think it’s enough to just have a document language for making web sites. I think that the reason that CSS layout is being adopted so slowly is that it fails to give designers the toolkit they need to make their jobs easier.

To this end I’m trying to put together a plan of action. I’d like to make friends who feel similarly and are eloquent and informed enough to argue the point on the lists and come up with alternatives (this doesn’t include me yet :-). At the moment, I’d like to put together a list of 5 layouts that are essential to the web and hard to do in CSS. So far I have the 3-col layout with content above and flowed properly below (e.g. Hype) and the content block centered to the browser window (e.g. Hype’s front page). If you have more please send them in.

I wrote to www-style I mentioned these two layouts and said that I thought that CSS’s toolbox was off-kilter. I got two replies. One discussed a method of centering in CSS which is tricksy and has bugs, the other suggested using CSS table properties like display:table;, which seems to be back at square one. The second reply also said “CSS *is* a document language”. This is fair enough, but I think that’s the problem. OK CSS can’t do what I want, fine, but I need something that can.

Teeth, Muscles, Shares

Teeth

I went to the shiny dentist. They rang me yesterday morning, having got my number from 1471 (the UK’s “who rang me?” number) and asked what I had been calling about. I said I’d like to make an appointment and they gave me one at 11:30 yesterday, which was about two hours after the conversation. Impressed, I cancelled my other appointment.

I was a bit nervous, I hadn’t been to the dentist for five years and I was worried that I might need loads of work. But no! My teeth are absolutely fine! They’re stained yes, but I did smoke for five years, so that’s not so surprising. Plus I had already noticed this. Then he gave me a clean and a polish. This was remarkably dentist-like, I can see why people are afraid. He had a protective visor and basically drilled the tartar off my teeth with a very high pitched motorised thingy. Same with the polish, except at lower speed and with wierd blue gunk. It was quite intimidating and went on for a good five minutes. During which I just lay there with my mouth open, trying not to get my tongue in the way.

Afterwards though my teeth are quite a bit whiter. The bottom front ones tingle a bit from being exposed once more at the back and I can’t stop feeling them with my tongue.

Muscles

Later on yesterday I decided to get to the swimming pool as well. It’s only a ten minute walk away, if that. The pool is really new. It was built in a joint venture by the council and a health club group. There’s a baby pool and a main pool for the public and a whole load of gym stuff and another pool for club members. It’s a very expensive club, but the pool is only £2.95. Given that everything else in Fulham is eight quid or more, this was a relief.

The changing rooms were unisex, which threw me at first. I walked in, a fully clothed man, to see women in swimsuits and towels. I promptly walked out again and asked where the men’s where. In fact all the actual changing areas are cubicles and just the lockers are shared. The pool itself was new and shiny and not too full, which was a relief. When I swim I have to leave my glasses behind. I am pretty short sighted. This has two effects, 1. I can’t read signs telling me that on no account should I do what I’m doing and, 2. I feel nervous, as you would if you didn’t have complete control of all your senses and were in a new environment.

When I started swimming I found that the pool had order. Three swimming lanes, slow, medium and fast, and a messing about bit for kids and slackers. I tried the fast lane and did crawl, swimming pretty quickly for three lengths. I almost died. I discovered that I have no upper body strength and that my lungs and heart needed gentler treatment. To be fair I had just eaten before leaving the house, which was a bad idea, all my blood was still diverted to my digestive system and my heart had to work extra hard to keep me going. After a rest, I spent the next hour pootling up and down the slow lane doing breast stroke.

Afterwards I stank of Chlorine and had to shower. My body didn’t hurt too much (not like after the running). My shoulders are a bit tense today, but that’s about it. I will be going again.

Shares

Today I got a call from my Dad. My Dad is the MD of a small company he started about 15 years ago. They make database software for hospitals. Things have been fairly hard in that time, he’s never become rich, but he’s not lost the company either and it has paid his salary for all that time. Recently he’s not enjoying it very much and has been talking about moving on. So it was a pleasant surprise to hear today that a much larger company has made an offer to buy his company.

It’s a serious offer. Apparently the valuation is spot on and also they want to complete the transaction fairly quickly. I am a shareholder in my Dad’s company. When it was founded, he gave 1,000 shares each to me, my two sisters and other family members. He was actually phoning me because as a shareholder I have to be informed and I have to sign some stuff. My shares will be moderately valuable if all goes well, but I’m more happy for him. He’s worked very hard to keep the company working and now it’s got to the point of success, where he can claim back his effort. It’s strange that the measure of success should be the ability to get out and I think he’s sad to see the end on one level. Still, he’s fifty now and it sounds like this path suits the way his life is going very well. Although he will be an employee of the purchasing company for a while, in a year’s time he will be free to do whatever he wants.

Bottom-clenchingly simple hierarchical Javascript menus

  1. Create your HTML as a set of divs, nested like so:

    DIV nested diagram, the system comprises a recursive set of divs of class node, each node keeps it's children within another div of class child

  2. Whack this in your stylesheet:

    .child { margin-left:15px; display:none; }

  3. Stick the following function in the page and call it from onclick on every node that has children:

    function selectNode(id) {
        node = document.getElementById("child" + id);
        if (node) {
            if (node.open) {
                node.style.display = "none";
                document.images["node" + id].src = "closed.gif";
                node.open = false;
            }
            else {
                node.style.display = "block";
                document.images["node" + id].src = "open.gif";
                node.open = true;
            }
        }
    }

The best bit is that sub trees remain open while hidden. To explain, imagine Blah and Blah 2 have been clicked and Blah 3 is visible. If you know click Blah you will hide Blahs 1, 2, 3 and 4. But if you click Blah again, Blah 3 will still be visible under Blah 2. You really have to see it in action, so here’s one I made earlier.

Exercise

I don’t get out much. I work from home and I generally end up working fairly hard. I have to make myself leave the house. Recently I have been practicing work fairly well, getting up at eight and working until five, taking an hour or so break during the day and going outside.

I’ve been mapping out the area in a series of long walks starting here and looping broadly around Fulham. I have also been known to run. Though only once and my feet hurt afterwards because I ran in skate shoes. I’d like to carry on, so I’m looking at getting a pair of proper running shoes, AKA wide-boy trainers, when I can afford them.

This morning I decided to go out for a walk first thing. I have been thinking about it because I sit at my machine rather restlessly all day, having to wander about the flat a bit every half an hour. It makes sense to stretch my legs first. Indeed everybody else does it and I have found in the past that the journey to work in the mornings is useful for getting properly woken up. When I discovered that we had no milk I knew the time had come.

I passed a nice looking dentist on Munster Road as well. I’ve signed up for a registration appointment with one on Fulham High Road, but I walked past that one (unintentionally) last night and it looked a bit grubby whereas this one was really sparkly. I’m in two minds but I may cancel my appointment and get one at the nearer place. The quality of the decor probably doesn’t say anything about the quality of the treatment, but it does say a little something about the equipment. Actually, scratch that, the fact that the place is nicely kitted out probably means that the dentists are good at extorting money from private customers. Something I don’t intend to be.

Anyway, exercise. I’ve been doing minor in-house exercises as well, sit-ups, push-ups and so on. Later on today I intend to go and explore the local swimming pool. It will be the first time I’ve been swimming for about a year. The pool is a public part of a swanky private gym, so the facilities should also be swanky.

Here’s to six-pack abs and upper arms of steel! Not really, here’s to not dying of heart disease for at least a couple of decades.

Flash in Safari Beta 2

I’ve just added a few more animating features to the front page Flash movie and as I was checking it I noticed that there was a noticeable difference in speed when running it under Safari against running it in the Flash IDE. On checking my old stuff as well, it looks like Apple has seriously improved Flash performance in this release. This is a Very Good Thing. Mac Flash performance has always been crap, particularly considering that a large proportion of quality Flash is built on Macs.

More boating

This weekend is obviously the weekend of water. Today Louise and I went out on to the Thames with Louise’s parents in their boat. They have a 40-foot cruiser that is also their home. We met them at St Katharine’s Dock just near Tower Bridge and plodded along the river from there to Richmond, where they put us off and we got a bus home.

It was really cool seeing the city from the river. I suspect that I may have been on a river cruise when I was young but I can’t remember. It was interesting learning about the bridges! I can’t really explain the experience very well, but I recommend it and, for now, make do with my photos.

Also, we just watched The American President, Aaron Sorkin’s film prototype for The West Wing with Michael Douglas in the eponymous role. It was a crazy jumble of bits of and members of the cast of The West Wing. It was also much more schmoltzy and I enjoyed it less because of that. Still, it filled a void that no series of WW is currently filling, and whetted my appetite for the next one.

Google-tastic

I just found out that if you Google “web developer london“, I come third. Cool!

Safari issue

Apple: there’s a bug in Safari with hyperlinked images positioned with position:relative;. Here’s a test case.

The gallery is finished!

All week long I have been working on a gallery section for this site in my spare time. Today it is finally finished. Making it dragged on, but I’m very happy with the results. And now I can go back and sort out the links in my NYC post.

I’m going to do that tomorrow though.

Boating in the park

Louise’s friend Megan came to visit. Megan works on cruise ships and has a glamorous life flying around the place, the apex of which was two weeks training in Watford. Megan is cool, she’s very sarcastic, which kind of disarmed me a bit at first, but now I’ve worked it out I like her and we get on pretty well.

Louise suggested a few days ago that since Megan was in town we should do something cool and that boating at Hyde Park sounded good. With the weather getting sunnier and hotter day after day it did sound good, so off we went to Kensington.

The park was really nice. All the flora is really getting started for summer now and there were droves of people frying in the sun. It was really windy, but it didn’t affect the heat too much and I was really happy in shorts and a t-shirt. We wandered around for a bit, sat on the grass and snacked on sandwiches and ice cream before hiring a rowing boat for half an hour.

Half an hour sounds short but, believe me, my arms hurt enough now. It was great fun badly rowing around the lake, occasionally bumping into the sides due to lack of concentration and skill. Rowing is hard and coordinating two rowers is even harder. We got there eventually and had a good trek around the bit of the Serpentine they let us into.

Afterwards we went to the pub briefly and ate again, but we were all pretty knackered from the exercise and spent the rest of the evening on the sofa.

For the first time yesterday I went for a run. I don’t get out of the house much, I have to make myself go out for an hour a day and I’m trying to increase the amount of exercise I do. I have collected a little bit of “stored energy” on my belly, but that’s not completely why I went. I do need to do more regular exercise anyway. The trouble is, if I think about being unhealthy, I just start thinking about the fact that 16 months ago I stopped smoking and I haven’t had a cigarette since, which makes me feel unduly great about myself. Megan was a personal trainer for a long time and she advised me that I could burn my “stored energy” in a month if I ran for half an hour three times a week. I will try it, but my record with commitment is not good, which I guess is damning it prematurely. If I can do it once every three or four days, that would be cool.

I must make sure I warm up before exercise in future. My muscles are reminding me of this as I type.

Perhaps I’m just too old

Somehow I doubt it (I’m 24). What I increasingly resent in HTML development is being forced to relearn stuff I’ve known forever and watching new and progressively uglier bits of CSS move into my lexicon.

Today I adopted the phrase “line-height:0px; font-size:0px;”. The authors of the CSS2 specification in their infinite wisdom decided to flesh out the specifics of laying out inline elements within block elements with respect to baselines and such. What they decided has a big vague patch where images are concerned. Traditionally if I put a single pixel image into a table cell the dimensions of that table cell should also be 1x1. Not any more. The new standard implies that the image should be placed on the font baseline rather than at the bottom of the block and that the minimum height of the cell is that of the line-height value (almost always inherited from the page fonts you’re using). This is retarded. Worse still, it’s vague enough to allow the Microsoft implementers (Tantek Çelik in particular) to argue that the desired behaviour is actually that exhibited by older browsers and for the Moz team (championed by Hixie) and evidently the Safari team to go the other way. Read this discussion to see what I mean.

I haven’t gone to the depths of employing the box model hack. That is a nasty piece of work that should not be used IMHO.

The whole point of CSS is to make to easier to develop pages and yet with things like the line-height and box model hacks the pages just become more and more browser specific again. With line-height it’s not too bad because older browsers don’t even consult that value on cells without text, which are the only ones it should be employed on.

I don’t think the layouts I’m trying to build with HTML are particularly revolutionary, in fact, the opposite is true. The layouts I build are exactly the same as thousands of others that can be seen all over the web. Most of these layouts still rely on the state of play at HTML 4, with the odd bit of cunning CSS creeping in on sites like Wired. The thing is it seems to actually be getting harder to build a nice layout with the content divided up by designerly borders and stuff. OK, I can understand why they would want to make it harder to use tables for layout, but why haven’t they provided the tools to build the sites everybody wants to build?

Examples: a scaling block of text with a red 2px border with 10px cut corners; a multi-column layout; a login box that is centred in the middle of the browser. All of these things are just about possible in CSS but they are pain and involve things like the box model hack. Why? These are three extremely common tasks. For evidence of this see Amazon, Yahoo or Lycos, all of which are members of the top 10 most popular sites on the internet.

A while a go I got annoyed enough about this to email Bert Bos about the column specification that might be in the pipeline for CSS3. I don’t think I actually got a reply, but from all the discussion stuff I read around the subject it seemed to me that their reasoning for hamstringing CSS was that it is a system for marking up documents. Like HTML. Which is just crap, “we’re going to tell you not to do what you’re doing, but we’re not going to give you any alternative, plus, how dare you claim that it is our responsibility to do so” or something similar.

Well, that’s BS, the W3C is about finding solutions to the problems of real people both using and creating the web. If it doesn’t do that it is irrelevant. 90% of the time it does a very good job (overlooking for a moment that whole SOAP malarky) including in the area of developing the CSS specifications. I just wish it would think a bit more practically and less conceptually on the issue of interfaces vs. documents. I guess I’m going to have to join the w3-style mailing list. Nuts.

Mental note

Tomcat likes to cache things. I’ve just spent most of the afternoon trying to fix a bug which I thought was unfindable. I’d fix it ages ago, but Tomcat had remembered it, oh yes. Probably shouldn’t have been using a jar file at this point. I’m sticking to classes from now on.

Now that’s what I call gun control

In the UK it’s illegal to possess a hand gun of any kind. We’re introducing a minimum sentence of 5 years for people caught with them. We’re also outlawing replica hand guns due to the number of people accidentally shot by paranoid police armed response teams.

I totally agree with this situation. Who cares that I can’t hunt, hunting is not fun enough to justify the hundreds of deaths from shootings each year. Shooting is not fun enough either. I have no fear in my home, I don’t need to defend myself, I’m pretty confident that no-one’s going to break in. Even if they did I would be much happier for them to steal all my stuff than have it escalate to armed conflict resulting, almost certainly, in me getting horribly wounded or killed. Lower the stakes, stop the proliferation.

More from UKOnline.

Exif/BS

After installing several CPAN modules to dig Exif data out of JPEGs (including Image::Info) I was appalled that none of them found a thing. PHP’s read_exif_data function found a mine of information (literally I guess) in my digital picture library.

I’ve been meaning to do a gallery section for this site for a while, but I want to keep my iPhoto library and my online library in sync and make it easy for me to add new photos to both. Plus I didn’t want a database. iPhoto can export to HTML. It outputs an index page and a page with previous/next navigation for each image. It also generates scaled versions for thumbnails and for actual-size pictures if you wish. After toying with the idea of reformatting the output HTML in Perl or PHP, it occurred to me that this would mean that the design of the gallery section became static and that I would have to regenerate every time I wanted to tweak the pages.

So instead I’ve written a PHP script which reformats the iPhoto index page into an XML document and supplements it with interesting data from the Exif block of the images (e.g. date). The next step is to write PHP that will read these XML gallery definitions and produce an interface.

One note: Almost all of my images are 1600x1200, around 400k a piece. This is really too large for me to fit the several hundred I want on to my ISP’s disks so I have scaled them all to 1024. I’d rather have the flexibility provided by the Zope gallery used by Mat, which is really nice, but I haven’t the space. I will add a disclaimer stating that larger versions of images are available.

A lovely weekend in the country

We have just arrived back from celebrating Miles’ (Ladislav on Hype) birthday and Laotian New Year with Miles, my sister Kate, Ruth, Charlie, Greg, Robert and others in Oxford. My sister now lives there having studied at Christchurch and moved back home for a bit. Miles is at New college and Ruth is at St Hilda’s.

Last night we were fed to the gunnels by Miles and his team of crack Laotian chefs. The highlight was the fried chicken and ginger, which had more coconut than anything else it seemed, but was delicious. There was also a selection of other treats of many weird and wonderful varieties. We got progressively more pissed, pushing through the singing phase into Vodka and beyond to being phoned by the neighbours. It was a knees up alright. Miles’ mates from the Oxford University Light Entertainment Society (OULES) were nuts and we were all on fine form.

We all crammed into my sister’s house (Louise and I got a bed!), which is very nice. Today she took us around Oxford a bit, doing the tour guide thing, I’ve taken a ton of photos, which I’m currently HTMLising. We had a really nice pub lunch as well at the Turf Tavern. A classic English pub nestled between the dreaming spires.

Oxford is a funny place. It’s almost like they knew they were building the ultimate tourist exhibit of old world England. It’s wonderful in how purely ancient it is. I wouldn’t hesitate to recommend to any visitor to the UK that they visit the place.

We had a lovely weekend. We spent the whole time locked in really good conversation and we had a really good group feeling going the whole time. Miles and Charlie had never met in the real world, but, thanks to the power of Hype, they were like old friends. Louise and I were both very much reminded of our student days and missed that kind of group activity. When we got home today and dispatched Greg and Charlie back to their houses we both felt sad and a bit lonely. We hadn’t had a communal weekend party like that for a while before we left Norwich, but in London it’s even less likely. When the summer comes we vow to undertake all types of weekend craziness, including but not limited to, messing around in boats, on beaches and in parks. Come one, come all!

Estimates

After the major fuck up that was my estimate of the work involved in my last project, I was determined to do better this time. I have been reading a lot about extreme programming and have chosen to employ it’s methods in my work. Their advice with the design phase of a project is not to plan too much, to be ready for change and to be very careful when estimating deadlines. One phrase sticks in my head, if something looks like it’s going to take 3-4 days, break it down into smaller parts. Combine this with the rule that no one thing ever really takes less than half a day and you have a process which I hope will turn out to be vaguely accurate.

As I went through the project specification document with a fine toothcomb I thought about my work process. Sure I can acheive task X in an hour, but only if I’m already in the flow of work and I don’t have to orient myself to it. I can maybe achieve task X in that time, but there is no way that I can achieve eight tasks that should take an hour in one day, even if I work full pelt. It doesn’t work that way. I need tea, I need to send emails to clients, make phone calls, find files, research things. All of this adds up.

I had in mind another piece of advice that a friend of mine had given me, “You need to firmly believe in your ability to call the prices and time estimates (even when you are wincing your through an icy patch of the conversation) to ensure that he knows the reason why he has employed you at this critical time.” Too many often I have gone the other way and downgraded my estimates, only subtly, just erring on the lower side, and paid the penalty.

There’s always the possibility I have done that again this time. The extreme programmers talk about making estimates in ideal days and then multiplying by a load factor, usually in the order of 2 or 3. I didn’t do that. I made estimates in something more like genuine time and kept rounding up and then added about 15% extra to each of the five milestones and an extra 10% for project management. I did conceed to write documentation for everything in that time as well, but this is a low pressure task and one which can easily extend a few days beyond any deadline.

I feel relatively confident about the work. This is a miracle given that when we had the initial meeting my recent failure was fresh in my mind. Even just the concept of delivering “something within a week” was unduly stressful. As each milestone is met, my confidence will return more and more.

More going with the flow

I talked to my client about his design. He gave me reasons for keeping frames and we had a fairly spirited discussion about it. I’m still implementing the same project, but it’s OK now because I’m reassured that he didn’t just make things up and back up his decisions. Also a working demo is more urgent than I had understood, changing the goals slightly.

Definition

shirkload
shirk·load (shûrk’ ld)
n. The amount of shirking expected from a shirker in a specified time period.

When should you go with a flow you don’t like?

My client has designed a screenshot showing how they would like their application to look. The guy who made it is fairly good with Photoshop and it has rollovers and tabs with 3D effect and everything. However, whilst he is a fairly capable amateur designer, he doesn’t have a lot of knowledge of usability and has resulted to the standard muddling through approach. The design uses frames; employs a fair amount of javascript; will require frames to be kept in sync with each other and uses a JS tree view control.

Typically with the muddling through approach, a lot of it is fine. Syncing frames all the time will make the application more complicated as each page has to work out where what goes. The tree view is a worry as well. What if somebody hits it with a browser that can’t handle it? I will build it using DOM methods and CSS so it’s future proof, but I bet there are going to be people that use Netscape 4 to browse this application. Because it’s a functional application I believe it’s much more important that people can access it reliably. It’s OK when you can’t hit the latest Kylie website, but if you work in say, a hospital or a garage, you don’t want to be upgrading your browser just to get your job done.

Somehow I need to bring these issues into discussion without making the designer think I’m having a go at his design. I also admit that there is a side motive, some of the stuff he has asked me to do will be time-consuming to implement, so I’d rather not do it. My reason for this is not just laziness, they could use my time better to create a more functional application.

The dilemma is working out how much I’m hired to talk and how much to do. Often I’m hired to build and advise but that isn’t always the case. It’s not black and white, of course, some things are open for debate, others are resolutely not. I get the feeling that the design of this site is not up for debate and there’s only one way to find out. It’s not my favourite part of the job and I think that it might be worth looking at a course in client management or something. The reason it’s so hard is that when I’m in a meeting my primary goal is to please the client. When I’m coding, it’s to build an application quickly and without bugs. That means that I think of something and when I come to discuss it my view has been changed subtly by the desire to please my client.

Router fun

So I’d forgotten the admin password. I needed to setup port forwarding so my client can see their mini-server. I thought, how am I going to change stuff without the password. After reading around for a bit it seemed the only option was to reinstall the firmware.

This didn’t go according to plan and by five o’clock last night I had just a shell of a router that would not respond to any commands. Normally these things can be administered through a serial port if all else fails, but the key combination to boot into emergency prompt mode wasn’t working. This morning that very much confused the guy I spoke to at technical support.

However, one thing did work, the key combination to boot over BOOTP. So armed with a PDF explaining what was I required, I found BOOTP and TFTP servers for Windows and managed to rebuild the whole system over ethernet. That was cool, I’ve never done that before.

Then of course the configuration interface went into treacle mode. It’s taken me the best part of an hour just to configure the ADSL, DHCP, NAT and DNS. No idea why. Now it’s fixed though and I couldn’t really care any more.

I think I might read my email…

Things are looking up

It looks like I’ve got a lovely new project to work, my new client even lent me a mini-server. Which is nice.

Life of Pi

I really enjoyed reading Yann Martel’s very popular book. I don’t read much fiction which means I almost always enjoy it, but this was particularly satisfying in a way that Pi himself would understand.

The story is just out of reach of normality but not so far that it ever becomes really implausible. As a scientist (it’s my religion rather than my profession per se) I quickly become uncomfortable without reasonable argument to justify changes to the universe. Martel’s fine-grained world carries plenty of that, viewed through Pi’s steady observations. A lot of people might have found it a bit of a slog, with the fairly meticulous descriptions of which parts of a turtle are edible and the habits of animals both in zoos and the wild, but I loved sharing the wonder that Pi finds in everything nature offers him. In addition all the momentum of Pi’s rich world, gathered through the book, is spent marvelously well in the last fifty pages, more than justifying any earlier wanderings.