Lambda the Ultimate

inactiveTopic The CSS debate rages on
started 2/17/2002; 8:42:45 AM - last post 2/19/2002; 1:06:07 PM
Ehud Lamm - The CSS debate rages on  blueArrow
2/17/2002; 8:42:45 AM (reads: 1811, responses: 4)
The CSS debate rages on
Mark Pilgrim in a well reasoned argument in favor of using CSS instead of tables for web layout. The debate is not new, but some prominent web developers don't agree. Follow the links from Mark's essay.

Let me try and give a language design point of view.

Languages are abstraction tools. When you describe something at the appropriate abstraction level, it is easier for you to describe it efficiently and correctly and at the same time your description is easier to understand.

Consider a simple for loop. Languages that provide this common looping structure allow the programmer to inform both the compiler and the human reader that the the number of iterations through the loop is known in advance, as opposed to the situation with while loops. This helps optimization, but also helps reading the code and proving it correct. [If you think I am wrong about this, chances are you are used to a language without this distinction, the most prominent example being C.]

CSS is a domain specific (declerative) language. It focuses on presentation details. It may be a bad language - I am not analyzing its strengths and weaknesses. Most of the advantages attributed to CSS are the result of this fact. CSS eases maintenance? Of course. The language localizes the presentation details, and separates them from the actual content. It also allows you to specify presentation details using concepts that were deemed appropriate for this task. CSS helps tools understand your site (e.g., tools for the disabled)? Sure. In just the same way as a for loop easier for the compiler to reason about.

One of the interesting characteristics of the web is the plethora of domain specific little languages. These languages can explain some of the success of cross-platform browsing, and the abundance of plugins and supporting tools.

An important feature of many, if not all, of these languages is that they are easily embeddable inside one another. Indeed, even the specification of tables can be seen as a micro-language inside HTML.

Remember: It is all about choosing the appropriate abstraction level.

Posted to Logic/Declerative by Ehud Lamm on 2/17/02; 9:30:49 AM

Dan Shappir - Re: The CSS debate rages on  blueArrow
2/18/2002; 3:07:19 AM (reads: 931, responses: 0)
CSS is evil because it doesn't have angled brackets! No syntax can be considered valid unless it can be parsed by XSLT.

Dan Shappir Author of XJava - the XML Java Language

Oleg - Re: The CSS debate rages on  blueArrow
2/18/2002; 11:59:45 AM (reads: 897, responses: 2)
"Why style sheets are harmful" by Jukka "Yucca" Korpela

A well-argued, compelling paper.

Ehud Lamm - Re: The CSS debate rages on  blueArrow
2/18/2002; 12:47:51 PM (reads: 971, responses: 1)
Why shouldn't the stylesheet provided by the author be the default, allowing the user to replace the presentation logic?

It seems to me that CSS encourage the author to use meaningful strucutre, that eases the task of providing alternative style sheets.

BTW: Mark allows users to replace the stylesheet used. The choice is limited to stylesheets provided by Mark, but this can easily be changed.

Ehud Lamm - Re: The CSS debate rages on  blueArrow
2/19/2002; 1:06:07 PM (reads: 1038, responses: 0)
I asked why shouldn't the stylesheet provided by the author be the default, allowing the user to replace the presentation logic. Well, it so happens that this is easily done.