Coding - my guidelines and recommendations
Here are a few guidelines I follow and recommend. If anything presented here as "obvious" does not seem so to you, or if you want extra reading on a subject, please let me know so that I can make things more clear for future readers too!
Following these guidelines help ensure that your pages render correctly in all browsers. If you already know HTML, you'll find that they are almost all you need to be writing XHTML documents (which would have been more popular if it had been simply named "HTML5", by the way).
The detailed list below could be summed up in a few words: use structural markup, use CSS for all things presentational, and make sure your documents are well-formed and validate. Now for the details!
- handcode
- start your HTML documents with a doctype declaration and validate them (validate the CSS too!)
- even when your pages validate, do some cross-browser (and platform!) testing...
- close all your tags (
<p>and<li>included) - nest your tags properly (
<a><b>text</b></a>) - avoid the
<font>tag, use CSS instead - please don't
<blink>or<marquee>! - use lowercase for tags and attributes
- quote all attribute values
- use the
titleattribute as much as you wish - use heading tags to indicate hierarchy in the document
- avoid workarounds, hacks and deprecated elements whenever possible
- code without attributes or "presentation" tags
- don't use tables for layout purposes
- name your CSS classes according to the function of the class, and not the resulting appearance
- in your CSS file, use precise selectors if the styles do not seem to render in certain browsers (like
TD.content P.logentry { whatever }- tables often break the "flow", and this is a good reason not to use them for layout) - use pixels to define your CSS classes (though this might be changing, I still haven't figured out the best way to go yet - please bear with me)
- write for the web [more links here]
- don't use frames
- and of course, use a little PHP - it makes maintenance and life so much easier!
Most of the points here derive from the need for standards...
More reading
My pet peeves...
I'm a tolerant person, but some things just bug me. For no rational-logical reason. As this list seems to get longer every day, I thought I might as well concentrate it in one spot.
Now, just because these are my peeves, it doesn't mean I'm telling you they are bad. Nor will I hate you for hitting upon them. It's just that I can only take so much in one day ; )
So, here we are. My ever-growing list of pet peeves:
- javascript mouseover scrollbars: I like to scroll at my own speed, thank you!
- double spaces after full stops
- trading links
- bragging about being linked to by such-and-such "celebrity"
- incessant talking about how many "hits" or "visits" one's site is getting and how to increase them
- haikus
- coloured scroll-bars
- "rate me" boxes
- chunk after chunk of IM (or IRC, or ICQ) conversations
- "see this" or "go here" links
- all-centered body text
- total lack of uppercase letters (sorry d)
- viewing source only to see heaps of untrimmed ScreamWeaver code
- small grey text on black backgrounds *squint*
Still want to be friends?



