About the article

Subject: About the article
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Wed, 28 Apr 1999 12:59:12 -0400
Hi,

I just saw that the version posted wasn't updated with the version I have on
my machine, so I posted the new one at:
http://www.netfolder.com/SGML/HTML-CSS%20Formatting%20objects.html

Note: You'll notice that I write DSSSL scripts differently from what we are
used to. This is to increase readability. Speaking of this. For a lot of
novice to dsssl the following script is easier to understand than the usual
one:

Sample of new format:

(element name
      (make paragraph
???? font-family-name: "Verdana"
?????font-size: 12pt;
???? font-weight: 'bold
?????quadding: 'center
???? space-before: 23pt
     (process-children)
)
)

usual way
(element name
  (make paragraph
???? font-family-name: "Verdana"
?????font-size: 12pt;
???? font-weight: 'bold
?????quadding: 'center
???? space-before: 23pt
     (process-children)))

I noticed this thing when writing CSS style sheets. I got this question: how
a dsssl script is more complicated than a CSS script. Why people do say that
() stuff confuse them. How did I reacted the first time I saw a DSSSL
script, etc...
I saw, that the main difficulty I got was to perceive rapidly the block
nature of DSSSL construct. A CSS bloc (not a CSS bloc but a language bloc
construct) is written as follow:
SPAN.name

font-family: Verdana;
font-weight: 700;
font-style: normal;
font-size: 12pt;
color: #000000;
}

some put more emphasis on the bloc of instructions itself like done by some
C/C++ programmers.

SPAN.name
{ 
font-family: Verdana; 
font-weight: 700; 
font-style: normal; 
font-size: 12pt; 
color: #000000; 
} 

the two above way of writing show clearly on the first sight what the bloc is. However a notation like:
(element name 
  (make paragraph 
???? font-family-name: "Verdana" 
?????font-size: 12pt; 
???? font-weight: 'bold 
?????quadding: 'center 
???? space-before: 23pt 
     (process-children)))

gives more difficulties to people to recognize rapidly the different containment or bloc relationship among the elements. If we rewrite the expression as:

(element name 
     (make paragraph 
????    font-family-name: "Verdana" 
?????   font-size: 12pt; 
????    font-weight: 'bold 
?????   quadding: 'center 
????    space-before: 23pt 
        (process-children)
    ) 
)

Visually, we use indentation and the () delimiters to reinforce the bloc nature of the constructs. the pattern emerge more rapidly and the containment relationship is more obvious. Also, the script is easier to debug for missing delimiters.

My personal opinion is that DSSSL was perceived as more complex because of the habit to write scripts in a more compact way. This practice just made that scripts are harder to decode for containment pattern. So, maybe, DSSSL was perceived as difficult mainly because of this script writing practice. This is why, now, I write dsssl scripts with indentation and blocs. When I showed the scripts to novices, they all said it is not so hard. But when I showed the same script with the usual way of writing they mostly said that they have difficulties to get the relationships.

As we learned 22 years ago with GUI research, spatial relationship is important for pattern recognition.

Now you know, why all my DSSSL script are more like:
(bloc
   (bloc
     att:val
   )
) 

than like the traditional (the more containment relationship you have the worse the ")))))" is

(bloc
  (bloc
  att:val))

Why I am doing this? because I want DSSSL to have the place it deserve in our world.

regards
Didier PH Martin
mailto:martind@xxxxxxxxxxxxx
http://www.netfolder.com 


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread