Tuesday, September 25, 2007

Why good HTML programming is like good screenwriting.

In the past couple of days I've been busy working on my homepage(s). I didn't have the funds to employ either a professional webpage designer or to buy professional software, like dreamweaver. I tried both the MS Office Publisher that came with my MS Office package, and the on-line design wizard offered by my domain host, but found both way to constrictive. So I had a friend teach me the basics of HTML and CSS, borrowed the excellent "HTML & XHTML - The Definitive Guide" by Chuck Musciano & Bill Kennedy, and set out to do it myself.
Ok, I depend heavily on W3School's HTML and CSS Tutorials, SELFHTML, and the Templates of of CSS Intensivstation and grateful use Notepad++ for the actual code writing, but I'm actually writing the code - understanding it - instead of just doing some magic on a GUI-based program.
Which is new for me, at least as far as working on my computer is concerned. Normally I'm a total oblivious end-user, with not even the slightest grip on the underlying mechanisms of the stuff I'm using. Normally I also think that's completely ok, Pirsig and The Art of Motorcycle Maintenance notwithstanding. I don't need to understand the principle of heat exchangers to get a bionade from my fridge. But in this case, I find myself oddly enjoying working with the basic HTML building blocks.
In the beginning it was just the mixture of not-enough-money and too-much-artistic-vision that drove me to even try trying it this way. But when my friend - who, at least as a programmer, is Mr. A-Place-For-Everything-And-Everything-In-Its-Place - started to explain to me some of the basic idea sof HTML, I sort of got into it totally. Because, the way he told it to me, HTML is about knowing what you want to create, before you create it. Sure you can simply start at one end and start adding in text and images and links and edit the style this way and that, until you have addressed every individual pixel of your browser window, but to my friend that was more than unaethetic, it was almost heretical, and anyway, the W3C is slowly fading these options out. Soon, the new XHTML standard will no longer permit this sort of "cruft".
The way it should be done is this: You come up with a unified design - the fonds used, the styles of the headlines, even the way the text-body, the headlines and the images, borders, margins, and all that work together, and you put this down in your Cascading Style Sheet, a seperate file from your actual webpage, that is more a how-to style reference guideline for the webpage itself. And then you write the actual webpage, which in its ideal form schould contain only the actualy content: the text, the links, etc. And all the browser does when it displays this content, is check on the CSS-page how to display it.
This is a lot like writing a screen play.
Because of course you can simply sit down and start on page one with "Fade in: Ext. Hearst Castle - Night" and continue until "The flames consume the sled. The last thing we see is the company logo and its name: Rosebud. Fade to Black." But I seriously doubt you will create something as masterful as Citizen Kane. I even doubt you will ever reach that last page. You will drown in cruft before you ever get there.
The way to do it, is to know what your story is about, to decide on the plot, the main characters, their need and want, on the turning points, that define the acts and sequences, and then whith everything in its place, you can "fill in" those Sequences and Scenes with the actual content, the action and dialogue that will be all that should in the end be visible to the audience.
Of course writers like Robert Ben Garant (Night at the Museum, Balls of Fury) are quite correct, when they advise writers to "do it. Write. Don't mull. Write it down. If you are not writing constantly, you [...] are not a writer."
But that same principle also goes for designing webpages in code. If you only plan, but never actually program, your webpage might have the potential of being the best ever, only it never gets made. I am writing, rewriting, and even redesigning my page all the time, at the moment. But I don't re-design little details without keeping their place in the "grand scheme" of my design in mind at all times. Just as you should never re-write scenes in your script without knowing exactly what mechanical parts of the overall script mechanism they represent, and how changing any of it influences the whole. And to be able to keep this image, this map, of the whole script in mind, is to understand its structure. For that, it needs to have one.
The secret as always lies in the correct balance: Too much time invested in structuring leads to great ideas that are never executed. Too little leads to cruft and chaos and slow death in the La Brea Tar Pits.
But for myself, I must say, that writing my own homepage in HTML has taught me bunches about how to write my next script.

3 comments:

Anonymous said...
This comment has been removed by a blog administrator.
帳號 said...
This comment has been removed by a blog administrator.
Anonymous said...

~~天天開心~~祝您快樂~~............................................................