Archive for January, 2007

Separation of content from presentation

Tuesday, January 30th, 2007

Truth be told it is nearly impossible to separate content from presentation with HTML and CSS while making semantically lean markup. At least that is true if the design of the presentation is complex and unique. Designers tend to like flourishes, embellishments, and other eye candy. Treated right, this is a good thing. Our minds like high-quality, stylized content. But high-quality design will add structures in the the markup that aren’t related to the actual content. These structures or hooks, are great for adding design elements, but bad for long-term maintainability of a site.

Here is an example of a design hook that I used while making the Harris Construction web site.

<div id=“big”>  <div id=“little”>div>
<div id=“rightConcrete”>div>
<div id=“topLeft”>
<div id=“topRight”>
<div id=“bottomLeft”>
<div id=“bottomRight”>

In retrospect, I could have developed this code better by using non-design specific ids. That would have been in the mindset of future reusability. Not that the hooks that I used can’t be reusable, but non-specific hooks would have been better. CSS Zen Garden uses a similar approach by adding non-semantic, empty divs much like the ones I used above. The Garden also uses ubiquitous id and class attributes to accommodate nearly every design situation that can be thought of. While this is good for the Garden’s purpose, leaner code means saved bandwidth, more maintainability, and many other thing.
What is the solution to this conundrum? Content Management Systems.

The only true way to separate content from presentation is to rely on a content management system. With a CMS, the possibilities for redesigns, media neutral delivery, and everything in between are limitless. A well-designed, flexible content management system will allow many different views of the content. This means that you can have a couple of HTML views (one for the primary design, one for printing, one for handheld devices), a PDF view, an RSS feed, and much more. Content Management Systems enable website managers to flex their designs in a cost effective manner.

Content management systems do more than just help with separating content from separation. But that is saved for a later post.

On Web Accessibility

Sunday, January 21st, 2007

What is accessibility?

In the world of the web, accessibility means providing a broad audience the opportunity to “view” your web site, regardless of their disability. Accessible web sites are needed to accommodate people with disabilities such as no-to-low vision, color blindness, and limited mobility. These web sites can be used with assistive technology – screen readers, Braille tactile feedback devices, embossing printers, and TDD.

Who needs accessible web sites?

There are two main groups whose web sites should be accessible. The first is all state and federal agencies as they are required by law to accommodate those with special needs. The second is any organization or company that wants to reach a broader audience and wants the additional benefits of meeting web accessibility standards.

How is accessibility regulated?

The requirements for State of Kansas agencies are described in the Web Content Accessibility Guidelines for the State of Kansas Version 2.0. The federal requirements for all federal and state agencies are covered by Section 508 of the Rehabilitation Act. These guidelines are based on valid CSS2+ with either HTML4.0+ or XHTML 1.0+ code, which are collectively known as web standards. Both federal and state guidelines are very similar in their requirements and suggestions.

How to create an accessible web site?

There are two keys to creating and maintaining an accessible website. The first key is valid and appropriate use of web standards. Web pages should be tested for errors by the World Wide Web Consortium’s on-line validator, which identifies any incorrect use of web standards within the page.

Being able to validate a document’s semantic structure is only part of what is needed to create an accessible web site. The second key is to craft pages with accessibility in mind. Documents should be able to gracefully degrade to web browsers that do not have the ability to read the document in its intended format. For a video interview on your site, for example, a transcript of that interview should be available to a person who cannot hear. Additionally, pages should not rely on visual elements alone for tasks such as navigation, nor should they be worded in a confusing manner.

What are the benefits of web standards and accessibility?

Reduced Bandwidth

In general, a web page that uses web standards is 25-50% smaller in file size than a traditional web page because the page uses less markup and is separated from the look and feel of the site. The practical benefits of this are faster download time for your users and lower costs for your hosting service.

Easier Maintenance

The benefit of having smaller documents is also apparent in maintenance. Since most of the traditional HTML is replaced with web standard HTML, site developers and maintainers can concentrate on what is most important: the content of the page.

More Access

CSS2+ allows users to be able to access your site with more devices. One of the mainstays of CSS is the ability to apply a different style sheet to a document to change both its appearance and its user interface. Different style sheets can be used to enable a PDA, a voice reader, a Braille display, or other devices to access your site. High-contrast, large-print, and printable versions of your site can also be created.

Happier Federal Government

As noted earlier, the government requires that any federal agency must meet Section 508 guidelines of the Rehabilitation Act. For more information, visit www.section508.gov.

Better Search Engine Indexing

Search engines can use up to 100 different criteria for ranking your sites within their search results. Web standards allow you to place the content of your document near the top of the document source. This allows search engines to index the page’s content before processing the navigation and other repetitive elements. Some search engines scan only the top of web documents.

Terms Used in This Document

TDD (aka TTY)– Telecommunications Device for the Deaf. When a deaf customer calls, this device relays the through an operator. The operator then types what you say. That is then transmitted back to the caller’s TDD. The TDD then “displays” what you said. TDD devices are included in the CSS specification and can be used to enhance a sites accessibility.

HTML – HyperText Markup Language. HTML is the format the most web pages are coded in. The current version of HTML is 4.01.

XHMTL – Extensible HyperText Markup Language. XHTML is a reformation of HTML 4.0 into XML.

XML – Extensible Markup Language. XML is a flexible way to create standard information formats and share both the format and the data on the World Wide Web.

Markup – Markup is another term for the HTML that surrounds the real content of a web page. It describes to a browser how the document should be displayed.

Web Standards – Web standards are specifications on how to properly code your web pages. The pertinent web standard specifications for most web sites are HTML4.0+ or XHTML 1.0+ and CSS2+.

World Wide Web Consortium (W3C) – The W3C is a mostly volunteer group that develops open, well-defined specifications and guidelines for web development.

Cascading Style Sheet (aka CSS or style sheet) – CSS is the principle technology for controlling a site’s look and feel, including colors, fonts, and general layout.

The McDonaldization of company culture

Monday, January 8th, 2007

While working on-site at another company, I have noticed a distinct lack of strong company culture. The place is a bit sluggish, and non-interactive in their daily activities. The one bit of “fun” that is injected into the environment is corporate culture icons: Dilbert cartoons, Office Space paraphernalia, and other equally clichéd items.
In lieu of good, strong company culture, is it okay to adopt the mainstream clichés for corporate culture? Is it better to have no culture than trite culture? How should a company go about building its own culture?
It seems to me that even when corporate clichés are injected into a company that not much is really achieved by it. The problem is much more systemic than that. The company needs a fresh perspective, a fresh start, some real interaction with each other to build a distinct culture that works for them.

Modifying a datatype in Oracle

Friday, January 5th, 2007

The syntax for modifying a column’s datatype in Oracle is

alter table table_name modify column_name new_datatype;

Managers of technical teams

Friday, January 5th, 2007

I met recently with a manager of a technical team. In the conversation he - a non-techie - mentioned that you don’t have to be technical to manage a technical team, thereby implying that if you are technical that you can’t manage a technical team. I was a bit dismayed by this insight. I don’t believe it one bit. A corollary to this thought is having a non-creative person in charge of a creative team.

Managers have a lot of responsibilities. One of which is to help a team resolve differences and problem when they arise. A non-technical manager is no help to a technical team that encounters a problem.

As with most things, a good manager is a function of the person, their attitudes, and the attitudes of the team members. My questions are what makes a good manager, is a manager with technical expertise better suited for managing a technical team or vice versa?

Directory structure for web interface

Wednesday, January 3rd, 2007

With every new web site that I create, I use a very specific directory structure for the ui. This allows the root web directory to not become over saturated with folders that do not contain actual web content. My folder structure is as follows

  • ui
    • css
    • images
    • js

Essentially, I use one main folder to contain all user interface elements: cascading style sheets, images, and javascript. The css folder can contain numerous files depending on the complexity of the web site and interface. The images folders contains the images for the web site framework. This includes any images needed for the general design, icons, buttons, and any other design imagery. The images folder does not contain images as they relate to a particular page or article. Those images are handled differently depending on the complexity of the site. The js folder is used to hold all javascripts. I thought about separating them out into behaviors and other scripts, but in the end I decided not to. I don’t use a ton of javascript (yet) so I didn’t see the need for the separation.

If there are multiple designs for a project, I use the following structure:

  • ui
    • design 1
      • css
      • images
      • js
    • design 2
      • css
      • images
      • js

In this case, I give design 1 and design 2 a name that refers to the design. If the design is a retro 50’s design, I use something like stylin50s. If it is an oceanscape sort of thing, I name it something like comotionontheocean. I have a little bit of fun with the names. It keeps me sane somehow.