Ordered vs Unordered List

The UL and OL lists

[…] “unordered” isn’t really any better, because […]

We can certainly try to come up with better names for the UL and OL list types, but I really can’t see any merit in it: this seems rather like an attempt to rewrite history.

As far as I can reconstruct, the GIs LI, UL, and OL (where UL means “unordered list” and OL means “ordered list”) have been around for more than 30 years now (probably rather 40 years or more), and the history goes like something this:


The 70’s – Before SGML

Even before SGML, the precursor GML at IBM had “unordered” and “ordered” lists, and used UL and OL for the corresponding “tags”.

A hands-on description of the difference in the IBM documentation reads like this:

Unordered lists are similar to simple lists, except that each item in an unordered list is preceded by a special symbol. (The special symbol used depends on the device on which you are having your output printed.) You would use an unordered list when the items in the list are fairly long, maybe even many paragraphs, but don’t need to be in a specific sequence.

And for OL:

And then there’s the ordered list. Use an ordered list when the items you’re listing need to be in a specific sequence. An example of an ordered list follows. […]
When you create an ordered list, you don’t have to number the items yourself. The starter set does it for you. This saves you a lot of work when you decide to insert, delete, or rearrange items.

(The “starter set” is the “GML starter set (GMLSS)” product.)

The 80’s – SGML

Many of the GMLSS elements were adopted into the “general document” DTD example in annex E of ISO 8879:1986 (the very first SGML standard). As this DTD is in turn the very first “official”, publicly available, “document type”, one can truly say that LI, UL, and OL were already in use when “angle-bracket-tags” were invented and standardized.

The “general document” DTD has actually six kinds of list, of which only three (OL, UL, and DL—but not SL, NL, and GL) later made it into HTML. Regarding the “ordered” vs “unordered” meaning, the “user manual” for SGML, ISO/IEC/TR 9573:1988, describes the difference like this (in section 5.3.10):

The “general” document includes six types of lists:

  • “ordered” list, where there may be a need to refer to each item in the list. Typically the list items are numberred by the text-formatter.

  • “unordered” list, where there is no need to refer to any item in the list, but where each item should be clearly standing out. Typically the list items are indicated by bullets, stars, or dashes by the text-formatter.

[…]

I find these descriptions perfectly reasonable and not too presentation-biased. (The DTD has a LIREF element type dedicated to referencing list items, which is declared empty, so the intended meaning of “where there may be a need to refer to each item” seems to be that LIREF can be used to refer to OL list items, but should not or even can not be used to refer to UL items—although these can have an ID attribute too.)

The 90’s – Early WWW and HTML

These “types” of lists were then already inherited (via the AAP tag set) in the very first HTML sketches by Tim Barners-Lee. Note that in this 1992 specimen there is also the XMP element type from the “general document” DTD, with roughly the use and purpose of the later PRE and CODE element types. And the tags HP1, HP2, etc—also from the “general document” DTD—for highlighted phrases are also mentioned (qualified as “not currently used”) in early descriptions of HTML.

The HTML 2 specification dated 1995-09-22 used a different wording, leaning more to the “presentational” side, for the two list types. (I could not find earlier HTML descriptions than version 2.0;)

The 90’s – Stable HTML

Then HTML 3 added “customization” attributes for list elements, so that one can choose the “marker” style for list items. One more move in the “presentational markup” direction, in the absence of CSS or similar techniques. Consequently, the specification does not even bother to explicitly define any “semantic” differences between “ordered” or “unordered” lists, but only explains the rendering differences instead.

The later HTML 4.01 specification is again more explicit, and gives a distinction which is not purely presentational:

An ordered list, created using the OL element, should contain information where order should be emphasized, as in a recipe: […]

But the only “real” difference is again presentational:

Ordered and unordered lists are rendered in an identical manner except that visual user agents number ordered list items. User agents may present those numbers in a variety of ways. Unordered list items are not numbered.

The 2010’s – Shiny new HTML 5

It was only in HTML 5 that the—IMO silly—attempt to define a semantic difference was made in this manner:

The OL element represents a list of items, where the items have been intentionally ordered, such that changing the order would change the meaning of the document.

And accordingly, for UL:

The UL element represents a list of items, where the order of the items is not important — that is, where changing the order would not materially change the meaning of the document.

Taking these descriptions seriously would IMO mean that a user agent or any other application is free to re-order UL items, say alphabetically. This has always been the case for the order or attribute specification lists, but I doubt that many authors would be happy if their UL items were randomly re-ordered with the excuse that this “does not change the meaning of the document” …


To conclude this little excursion:

  • The terms “ordered list” and “unordered list” have been in use for literally decades,

  • but with quite some variation in explicitly or implicitly defined meaning.

  • But the pseudo-precise distinction made in HTML 5 based on “re-ordering does/does not change the meaning of the document” is IMO the least useful definition for these terms (what is the “meaning of a document”, after all?).

So probably the best thing to do in a CommonMark specification is to just talk about “ordered list” and “unordered list”, and leave the meaning of these terms implicitly defined by the fourty-year long common usage of these words …

2 Likes