- From: Philip TAYLOR <P.Taylor@Rhul.Ac.Uk>
- Date: Sat, 03 Apr 2004 22:49:54 +0000
- To: Thomas 'PointedEars' Lahn <w3c@PointedEars.de>
- Cc: www-style@w3.org
Thomas 'PointedEars' Lahn wrote: [snip] > Besides CSS being AIUI not a programming language and thus there are no > "CSS programmers" (but only CSS authors), I would respectfully suggest that CSS is a declarative programming language by any reasonable definition of that term. > style guides for programming > languages usually recommend to write whitespace before paranthesed > expressions only if it fits the previous code. The "Code Conventions > for the Java Programming Language" [1], e.g., recommend to write > whitespace before conditional expressions being used as arguments of > conditional statements (in general: keywords followed by paranthesis): > > ... if (x) ... > > to distinguish them clearly from method calls where the whitespace > should be left out: > > ... foobar(x) ... It would be interesting to know what fraction of practising Java programmers (a) are aware of that recommendation, and (b) are prepared to follow it. > Since rect(...) is defined as a function by section 4.1.1 of the CSS2 > Specification and its upcoming revision 1, If "rect (...)" [sorry, space crept in automatically) is defined as a function, does that not add weight to my argument that CSS is a programming language ? > when it comes to code style > and thus legibility of code, it is IMO correct to disallow whitespace > here. I find that a very proscriptive approach. A programmer (or author, to avoid further argument about the exact nature of CSS) should surely be free to express his/her ideas in any way which seems to him/her to clarify his/her intent, provided only that his/her chosen way does not introduce ambiguity ? For eample, I have always felt that the Perl "rule" that requires an opening brace to occur at the end of line 1 and the matching close brace to be at the beginning of line-n to be totally out of order. This convention (which I believe originates in the C-programming world) was unknown to those of us who honed our programming skills on Algol-68, and remains (to my mind) an abomination to be avoided by all right-minded individuals ... > On the other hand, since CSS is not a programming language and the > "clip" property is a standalone one, I would not mind if whitespace > would be allowed there, but not to be recommended anyway. However, > this nevertheless requires careful consideration: if "clip" is likely > to become part of a composed property (like "border"), the allowed > whitespace would then aggravate parsing of the value of that property. That point I willing concede. Philip Taylor, RHBNC
Received on Saturday, 3 April 2004 15:50:01 UTC