On approaching HTML

There are different ways to write proper HTML and they depend on a number of things like personal preference, maintenance, extensibility, portability and context. Here I will outline two general commonly practised approaches: minimalistic and verbose (or abstract). These are the extremes on opposite ends of the spectrum.

Minimal

This way of writing markup focuses on the absolute essentials to encapsulate the content in the document. The advantage; without adding any unnecessary clutter (i.e., containers, attributes etc.), it maintains its meaning. On the other hand, handling different contexts for similar patterns in other various documents is usually forced to be written differently. In other words, it makes creating and reusing templates a little more difficult on the site.

Verbose or abstract

Expanded form is open ended in a sense that any number of containers can be used on top of the base requirements. The good thing about this approach is that, markup can be written in a fashion that leads to useful templating. As templates are defined at a granular level (abstraction), it becomes very portable and easy to maintain where common patterns occur across documents. Another advantage as well as a disadvantage in certain cases is that it can allow a greater presentational opportunity where needed, and at the same time, often create extra unused containers.

Summary

Use the minimalistic approach where code may need to be changed or moved around. On small scale sites, this works quite well. Avoid this on larger sites where heavy templating is a requirement as it will create a redundant markup system.

The verbose or abstract structure is often found in documents that make use of existing templates (e.g., CMS HTML templates) to improve development complexity. For instance, templating compound microformats on large sites tends to be verbose or abstract since common patterns are used often.

By factoring in context; maintenance, extensibility, portability, for the markup can help determine which approach to take.

Published

Interactions

1 interaction

Contempt’s photoContempt replied on

Very good article. I like the fact that you break it down into sections about different approaches. Personally I believe that the verbose approach is great if you're going to build one "skeleton" and then branch off and clone it multiple times.

It's great as long as you watch your rear end for footprints if you plan on interlinking the sites later on and get "reported" for anything. That's what the minimal approach is for, quick and dirty sites that look good enough for a mini site (such as a 5 page).

Great post.