<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learning the World &#187; new professionalism</title>
	<atom:link href="http://learningtheworld.eu/tag/new-professionalism/feed/" rel="self" type="application/rss+xml" />
	<link>http://learningtheworld.eu</link>
	<description></description>
	<lastBuildDate>Tue, 06 Nov 2012 00:17:33 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Best Practices in Web Development</title>
		<link>http://learningtheworld.eu/2006/best-practices/</link>
		<comments>http://learningtheworld.eu/2006/best-practices/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 16:56:19 +0000</pubDate>
		<dc:creator><![CDATA[Martin Kliehm]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[checklist]]></category>
		<category><![CDATA[common errors]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS reboot]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[new professionalism]]></category>
		<category><![CDATA[Roger Johansson]]></category>
		<category><![CDATA[Sean Fraser]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://learningtheworld.eu/2006/best-practices/</guid>
		<description><![CDATA[Roger Johansson and Sean Fraser recently reviewed websites which were submitted for the CSS Reboot Spring 2006, and they seemed to be quite shocked when 71.8% failed to validate. While this is sobering and to a degree surprising â€” one might expect better results from CSS aware developers on a relaunch â€” it confirmed my own results from reviewing a couple of high profile websites for clients.&#160;[&#8230;]]]></description>
				<content:encoded><![CDATA[<p id="intro"><strong><a href="http://www.456bereastreet.com/archive/200606/css_reboot_participants_far_from_standardsbased/" rel="colleague met" title="Roger Johansson about CSS reboot">Roger Johansson</a> and <a href="http://www.elementary-group-standards.com/web-standards/css-reboot-as-web-standards-validation-indicator.html" title="Sean Fraser about CSS reboot" rel="colleague">Sean Fraser</a> recently reviewed websites which were submitted for the <a href="http://www.cssreboot.com"><acronym title="Cascading Style Sheets">CSS</acronym> Reboot Spring 2006</a>, and they seemed to be quite shocked when 71.8% failed to validate.</strong> While this is sobering and to a degree surprising &mdash; one might expect better results from <acronym>CSS</acronym> aware developers on a relaunch &mdash; it confirmed my own results from reviewing a couple of high profile websites for clients.</p>

<h3 id="toc">In this article:</h3>

<ul class="toc">
    <li><a href="#case-study">Case study</a></li>
    <li><a href="#html">Best practices in <acronym title="Hypertext Markup Language">HTML</acronym></a></li>
    <li><a href="#css">Best practices in <acronym>CSS</acronym></a></li>
    <li><a href="#search-engines">Best practices for search engines</a></li>
</ul>

<h3 id="case-study">Case study</h3>

<p id="cs-intro">Over the years we made several <strong>technical analyses</strong> for the clients&rsquo; own websites and some of their competitors, including major German broadcasting companies, TV program journals, and a couple of large online travel sites.</p>

<p id="cs-scope">We were checking for overall performance like file sizes as well as best practices in <acronym title="Extensible Hypertext Markup Language">(X)HTML</acronym>, <acronym>CSS</acronym>, semantics, and some other aspects of friendliness to users and search engines. We mostly skipped accessibility because there were already severe errors in the other areas.</p>

<p id="cs-summary">It&rsquo;s not like these websites were made by some backstreet <del>crack houses</del> <ins>agencies</ins>. All have a well-known logo stuck to them, most of them get more than a million visits each month, some up to more than a hundred million. Still the reviews felt like a time-travel to 1998. In our elite circles we speak about a &ldquo;<a href="http://www.webstandards.org/2005/11/15/web-standards-and-the-new-professionalism/" title="Molly Holzschlag on the Web Standards Project (WaSP) website about new professionalism" rel="colleague met">new professionalism</a>,&rdquo; but <acronym>HTML</acronym> in the wild is <em>still</em> a <em>very</em> dark and ugly jungle.</p>

<p id="cs-common-errors"><strong>Most common errors</strong> were missing <code>alt</code>-attributes and unencoded <span class="nowrap"><code>&amp;</code>-characters</span> in <acronym title="Uniform Resource Locator">URL</acronym>s. Also quite common were <acronym title="Extensible Markup Language">XML</acronym> endslashes in <acronym>HTML</acronym> documents, or hacks from the nineties: proprietary attributes like <code>background</code> in table data, <code>height</code> in a table row, <code>marginwidth</code>, <code>marginheight</code>, <code>topmargin</code> and <code>leftmargin</code>, or missing <code>type</code> attributes in <code>style</code> and <code>script</code> tags.</p>

<p id="cs-proprietary-tags">Getting into the depths of old-school programming we found proprietary tags like <code>&lt;nobr&gt;</code>, <code>&lt;ilayer&gt;</code>, or <code>&lt;spacer&gt;</code>, misconceptions like <code>valign=&quot;center&quot;</code> instead of <code>&quot;middle&quot;</code>, forgotten closing tags, or tag soup like the classic <code>form</code> between table rows (to prevent top margins), block level elements inside of inline elements, <code>&lt;p&gt;</code> tags around everything (including tables and headlines!), or <code>script</code> tags before or after <code>&lt;html&gt; &lt;/html&gt;</code>. Especially ad servers and site statistics were infamous for their crappy stone-age code.</p>

<p id="cs-dtd">Only a few were missing a doctype declaration (DTD) altogether, most ran <acronym>HTML</acronym> transitional 4.01 in quirks mode, only one claimed to be <acronym>XHTML</acronym>&nbsp;1.1 (<em>gasp</em>). Seven out of ten had a charset encoding, but only the <acronym>XHTML</acronym> website did care to define the site&rsquo;s language. Almost all had no clue about <acronym>CSS</acronym> positioning and used table layout.</p>

<p id="cs-basics">Sometimes we encountered code where developers obviously hadn&rsquo;t understood even the most basic principles of <acronym>CSS</acronym>&nbsp;1. They used either <code>font</code> tags with <code>style</code> attributes, or other tags just <em>like</em> <code>font</code> tags with a lot of repeated inline <code>style</code>. Thus the advantages of <acronym>CSS</acronym> through central style sheets with classes and IDs were counteracted.</p>

<p id="cs-file-size">It didn&rsquo;t come as a surprise that the few websites using <acronym>CSS</acronym>&nbsp;2 for layout had <strong>significant smaller file sizes</strong>. Those with <acronym>CSS</acronym>&nbsp;2 had between 15-21&nbsp;<abbr title="Kilobyte">KB</abbr> of <acronym>HTML</acronym>, their competitors with table layout 55-95&nbsp;<abbr>KB</abbr>. Still you got to pay attention to the file size of images and rich media (including banners) as they frequently blow up the total amount. Be aware of <acronym title="Dynamic HTML">DHTML</acronym> menus, as they have a tendency to get out of control sizewise (<abbr title="40 kilobytes">40k</abbr> JavaScript in one case, <abbr title="85 kilobytes">85k</abbr> in another). Less than a total of <abbr title="100 kilobytes">100k</abbr> for the home page should be sufficient, even for sites with rich graphic interfaces.</p>

<p id="cs-checklist">I don&rsquo;t want to bore you with further rants about burning bandwidth with <abbr title="600 kilobytes">600k</abbr> large home pages (multiply <em>that</em> by a million), hence we thought positive and made a <strong>checklist of best practices</strong>. Although the checkpoints appear to be quite obvious and common sense when you read them, you might be surprised that the best website managed to fulfil 22 out of 29 checkpoints, the worst only 8, with an average of 12.</p>

<p id="cs-job-test">By the way, the <acronym>HTML</acronym> and <acronym>CSS</acronym> part of the checklist is more or less the same we use for testing the qualifications of <em>job applicants</em>. We associated a severity grade (<em>major</em>, <em>average</em>, <em>minor</em>) with each checkpoint, and for each error in the small task we give them we subtract 3, 2, or 1 point(s) respectively from a maximum of 100. Half the amount is subtracted when a checkpoint is partially fulfilled. We adopted that system from the German <a href="http://www.bitvtest.de" hreflang="de">accessibility test</a> &mdash; it&rsquo;s fair and a great way to compare test results.</p>

<p id="cs-checklist-intro">Here&rsquo;s the short version of our checklist. Feel free to make your own severity rating. Just be consistent in your own tests to get comparable results.</p>

<h3 id="html">Best practices in <acronym>HTML</acronym></h3>

<ol class="alpha">
    <li id="html-validation">The document <a href="http://validator.w3.org" title="External link to the World Wide Web Committee&rsquo;s validator">must validate</a> as <acronym>HTML</acronym> or <acronym>XHTML</acronym>.</li>
    <li id="html-dtd">The document must have a <strong><acronym title="Doctype Declaration">DTD</acronym></strong>.</li>
    <li id="html-character-encoding">The document must have a <a href="http://www.w3.org/TR/html401/charset.html#h-5.2.1" title="HTML 4.01 specification about character encoding">character encoding</a>, either through a <acronym title="Hypertext Transfer Protocol">HTTP</acronym> header or a <code>meta</code> tag.</li>
    <li id="html-language">
        <p>The document should have the <strong>language defined</strong> in the following ways:</p>
        <ul>
            <li><code>&lt;html lang=&quot;en&quot;&gt;</code></li>
            <li><code>&lt;html xml:lang=&quot;en&quot;&gt;</code></li>
            <li><code>&lt;meta name=&quot;content-language&quot; content=&quot;en&quot;&gt;</code></li>
        </ul>
    </li>
    <li id="html-quotes">All <strong>attribute values <a href="http://www.w3.org/TR/html4/intro/sgmltut.html#idx-attribute-6" title="HTML 4.01 Specification about quotes">should be quoted</a></strong>. In <acronym>XHTML</acronym>, <a href="http://www.w3.org/TR/xhtml1/#h-4.4" title="XHTML 1.0 Specification about quotes">quotes are mandatory</a>.</li>
    <li id="html-case">Element and attribute names should use a consistent case to enhance readability, preferred is <strong>lowercase</strong> for <acronym>XHTML</acronym> compability.</li>
    <li id="html-comments">Code should be well <code>&lt;!-- commented --></code> to help maintaining developers to get a fast grip of the basic structure and key concepts.</li>
    <li id="html-indention">Code should be consistently <strong>indented</strong>, tabs preferred over spaces.</li>
    <li id="html-alt">Images, image maps and scripted content must have an <a href="http://www.w3.org/TR/html4/struct/objects.html#adef-alt" title="HTML 4.01 specification about alternative text"><code>alt</code>-attribute</a> with an appropriate value.</li>
    <li id="html-width-height">Images should always <a href="http://www.w3.org/TR/html401/struct/objects.html#adef-width-IMG" title="HTML 4.01 specification about width and height">specify their <code>width</code> and <code>height</code></a> to allow browsers to continue rendering while waiting for the image data.</li>
    <li id="html-entities">Some special characters like <code>&amp;quot;</code>, <code>&amp;lt;</code>, <code>&amp;gt;</code>, and <a href="http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2" title="HTML 4.01 specification about ampersands in URI attribute values"><code>&amp;amp;</code></a> (especially within attributes like <code>href</code> or <code>src</code>) must always be replaced by their <strong>character entities</strong> or numeric character references (NCR). Also characters not included in the character set, like <code>&amp;euro;</code> in ISO 8859-1, must be replaced. The <acronym title="World Wide Web Consortium">W3C</acronym> <abbr title="Internationalization">I18N</abbr> activity group further <a href="http://www.w3.org/International/questions/qa-escapes" title="W3C: Using character entities and NCRs">recommends</a> to replace other special characters like <code>&amp;ndash;</code>, but <em>not</em> common characters like &ldquo;&uuml;&rdquo; in German texts or &ldquo;&eacute;&rdquo; in French to maintain code readability.</li>
    <li id="html-type"><code>script</code> and <code>style</code> tags must have a <a href="http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.1" title="HTML 4.01 specification about the script type"><code>type</code></a> attribute.</li>
    <li id="html-js">
        <p><strong>JavaScript</strong> code should be included using <strong>external files</strong> for caching and better maintenance.</p>
        <p>Of course with <strong>Yahoo&rsquo;s performance research</strong> about <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/">browser cache</a> and <a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/"><acronym>HTTP</acronym> requests</a> you could discuss if external files load faster with several server requests through <code>script src=&quot;foo.js&quot;</code> or just one request and internal <acronym>HTML</acronym> code, but either way you should use central, non-redundant files and include them in one way or another.</p>
    </li>
</ol>

<h3 id="css">Best practices in <acronym>CSS</acronym></h3>

<ol class="alpha">
    <li id="css-validation"><acronym>CSS</acronym> <a href="http://jigsaw.w3.org/css-validator/" title="External link to the World Wide Web Consortium&rsquo;s CSS validator">must validate</a>.</li>
    <li id="css-positioning">Elements should be <strong>positioned with <acronym>CSS</acronym>&nbsp;2</strong>, not tables.</li>
    <li id="css-decoration">All ornamental lines, borders, background colors and -images, underlines and other <strong>decorational elements</strong> should be rendered <strong>with <acronym>CSS</acronym>&nbsp;2</strong>.</li>
    <li id="css-formatting"><strong>Text</strong> should be <strong>formatted with <acronym>CSS</acronym>&nbsp;1</strong>, not with <code>font</code> tags.</li>
    <li id="css-external">All style sheets should be included in reusable, centrally maintainable, and cacheable <strong>external <acronym>CSS</acronym> files</strong>, not as redundant code within the <acronym>HTML</acronym> files.</li>
    <li id="css-mime-type">External <acronym>CSS</acronym> files should be sent with the <strong>correct MIME type</strong> (<code>text/css</code>).</li>
    <li id="css-naming-conventions"><strong><acronym>CSS</acronym> classes and IDs must be valid</strong>, <abbr title="that is">i.e.</abbr> <a href="http://www.w3.org/TR/html401/types.html#type-id">beginning with a letter</a>, not a number or an underscore. IDs must be unique. Their names should be <a href="http://www.w3.org/QA/Tips/goodclassnames" title="W3C Quality Assurance Tip: Use &quot;class&quot; with semantics in mind">generic</a>, describe functionality rather than appearance.</li>
</ol>

<h3 id="search-engines">Best practices for search engines</h3>

<ol class="alpha">
    <li id="se-title">Use a <strong>descriptive title</strong> with the name of the website and consistent separating characters in it.</li>
    <li id="se-keywords">Use <strong>keywords, keyphrases, and a description</strong> reflecting the page&rsquo;s content.</li>
    <li id="se-url-design">The <a href="http://www.w3.org/Provider/Style/URI" title="Tim Berners-Lee&rsquo;s article &ldquo;Cool URIs don&rsquo;t change&rdquo;"><acronym>URL</acronym> should be descriptive</a>, <a href="http://www.adaptivepath.com/publications/essays/archives/000058.php" title="Jesse James Garrett about &ldquo;User-Centered URL Design&rdquo;">human-readable</a>, easy to remember, to bookmark, and easy to spell on a phone. Don&rsquo;t bother the user with file extensions, thus you will be future compatible and independent from your current software.</li>
    <li id="se-robots-txt">Use the <a href="http://www.robotstxt.org">Robots Exclusion Standard</a>, <abbr>i.e.</abbr> <code>robots.txt</code>.</li>
    <li id="se-relevance">The <strong>content should be as high up</strong> in the code as possible as it gets more relevance there.</li>
    <li id="se-semantics">Use <strong>proper semantic code</strong>, like headlines, or list items for anything that resembles a list. Don&rsquo;t use list items to get bullet points or headlines to set bold text.</li>
    <li id="se-link">Use <a href="http://www.w3.org/TR/html401/types.html#type-links" title="HTML 4.01 specification about link types"><code>&lt;link&gt;</code> tags</a> to specify relations between pages, like <code>rel=&quot;start&quot;</code>, <code>chapter</code>, <code>prev</code>, or <code>next</code>, as search engines might value your start page more, or browsers could preload <code>next</code> pages.</li>
    <li id="se-favicon">Use a <a href="http://favicon.com">favorite icon</a> for bookmarking and to keep your error log clean.</li>
    <li id="se-pics">Use the <a href="http://www.w3.org/PICS/"><acronym title="Platform for Internet Content Selection">PICS</acronym></a> <a href="http://www.icra.org" title="Internet Content Rating Association, external link where you can label your website">standard</a> to signal search engines and filter programs that your website is safe for kids.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://learningtheworld.eu/2006/best-practices/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
