Archive for April, 2005

Semantic code = coding usability

Everybody is talking about why you “should” serve your XTML pages as “application/xml” or something similar. I really think that they are missing the point.

In my opinion the most important reason for promoting and using XHTML is not that it is XML and therefore inherits all the programming possibilities. The main reason is the coding practice that follows from its use.
Writing user-friendly (read developer friendly) code is the most important issue here. And not the fact that you can write valid code that adheres to some scheme or DTD.
Getting your code to validate is just as fun and enlightening as beating your head against the wall.

Everybody relax; getting your pages to validate is not the main goal. It is a means to an end.

But before we get there, we should learn to write easy to maintain code. This will make things easier to debug in search for validation errors if we want to get validated code.

Coding your pages in XHTML “must” mean that you write semantic code and try to separate content from presentation. Most people tend to apply a few simple rules (close your FONT tags!!) to generate a valid impression of XHTML. But unfortunately they are completely missing the point. (Though this will get them the goodies that come from using XML syntax.)

XHTML is rich and can really add meaning to a document. The presentation from Tantek emphasizes this and shows that the tags are really designed to tell the developer the contents purpose inside an element. (Remember that XML was designed for humans and machines.)

It is the same thing when you write code in PHP, VB or Java. Most of the time you use a naming convention for your variables and functions. Just to make it a bit more easy to read and understand.
Ever read some code that uses function names like: function do_aRt() or variable names like var aRt_01 ? Doesn’t make sense, does it?
That is why they invented the Hungarian notation, or camelcase for writing more developer friendly class names and variables.
It makes things much easier if you want to review your code after a year.

Same thing counts for XHTML. If you use descriptive elements, things will be so much easier to read and to maintain your code (assuming that you read your code).

The following is just an example to make things a bit clearer.
Suppose you are hired to do the layout for a Chinese or Arabic website. You get to write the HTML templates and the CSS files, based on the existing website.
The first view on the code shows me tagsoup, with several nested tables and a few DIV’s and FONT tags. Where to start?
If the previous developer used tables for layout and never added the slightest indication of what the function of the content was, you are lost.
Back to the owners and request a detailed wireframe in English!

Start with really thinking about the content that you are trying to display and maybe 1 of the 91 tags could add some meaning to that. The Markup reference from Mozilla really does a good job with adding good semantics to existing tags. And of course read the SimpleQuiz from Dan Cederholm.

Adobe koopt Macromedia

Adobe en Macromedia gaan 1 grote gigant vormen waarschijnlijk om Microsoft voor te zijn.

De nieuwe interface technologie�n gebaseerd op XML staan nu allemaal in de startblokken en het gaat weer een nek aan nek race worden.

  • Adobe/Macromedia heeft Macromedia Flex of MXML en Flash.
  • Microsoft heeft XAML.

De toepassing van MXML is niet helemaal dezelfde omdat Flex op de server verwerkt wordt, en omgezet wordt in bvb. Flash. XAML heeft het “nadeel” dat het uitsluitend op Windows draait.

De vraag is of we allemaal in XAML gaan werken of in Flash. 1 bedrijf heeft daar al een oplossing voor en maakt een converter om XAML in Flash om te zetten.

Nog meer nieuws:

Artikels terug online

Met de verhuis naar een ander host is er verschrikkelijk veel blijven liggen, onder andere de artikels die ik een vorig leven heb geschreven.

Nederlandstalige WordPress voor Belgen

Op dit moment heb ik net de .mo bestanden van Michel opgeladen, maar ik voel mij er niet helemaal tevreden bij. Die directheid van onze nederburen, zaken zoals “roep het maar” als je een reactie wil achterlaten, geeft mij een onbehaaglijk gevoel.

Daarom ben ik net begonnen met de vertaling van de engelse versie en indien het past neem ik de zinnen over van de nederburen.
De vertaling is goed gedaan en er is duidelijk wat werk in gestoken. Maar er zijn ook andere zaken die mij storen, o.a. het veelvuldig gebruik van engelse woorden waarvoor er toch nederlandse equivalenten zijn.

Het bestand telt 801 zinnentjes en ik heb er nog 734 te gaan.
Wie zich geroepen voelt, alle hulp is welkom.

Voor meer informatie over hoe je dit best aanpakt kan je terecht op de codex van WordPress. Software is ook beschikbaar voor Windows: poedit en voor Unix varianten als Mac OS X: gettext.

Update

Op dit moment gebruik mijn vertaalde versie op de website en niet langer die van Michel.
Nog 703 te gaan.

Categories

About

My name is Len Dierickx and this is my personal blog. I studied Musicology at the UG, long time ago but got more and more into webdevelopment. I started this blog because the EuroIA summit in Brussels (Belgium, Oct 2005), was such an inspiration. And I was thinking about a blog on IA a while now, so that was the extra kick I needed to get it actually done.

Powered by WordPress