|[5 earlier articles]|
|Re: Use of punctuation in a language? bobduff@shell01.TheWorld.com (Robert A Duff) (2003-11-08)|
|Re: Use of punctuation in a language? firstname.lastname@example.org (Ray Dillinger) (2003-11-11)|
|Re: Use of punctuation in a language? email@example.com (James Cownie) (2003-11-11)|
|Re: Use of punctuation in a language? firstname.lastname@example.org (Doug Landauer) (2003-11-11)|
|Re: Use of punctuation in a language? Martin.Ward@durham.ac.uk (Martin Ward) (2003-11-11)|
|Re: Use of punctuation in a language? email@example.com (Jan C. =?iso-8859-1?Q?Vorbr=FCggen?=) (2003-11-21)|
|Re: Use of punctuation in a language? firstname.lastname@example.org (2003-11-21)|
|Re: Use of punctuation in a language? email@example.com (2003-12-03)|
|Re: Use of punctuation in a language? firstname.lastname@example.org (Ron House) (2003-12-03)|
|Date:||21 Nov 2003 00:46:38 -0500|
|Organization:||AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com|
|Posted-Date:||21 Nov 2003 00:46:38 EST|
James Cownie <email@example.com> schreibt:
> a := b + c +
>is fine, but
> a := b + c
> + d
>would give an error.
>Leaving a trailing operator at the end of the line is very simple to
>learn, and is also a good visual cue that the expression needs to
That's one point of view. In your example you silently use indentation, to make
the continuation lines better perceptible to the human reader. This is not
necessarily possible in languages where indentation also has a syntactical
meaning. There also exist cases where a different indentation is not wanted,
and that's why I instead prefer to move operators to the begin of continuation
lines, so that the human(!) reader can identify continuation lines easily.
if a and b
and c then
Now the continuation lines can have the same indentation as the continued line,
and different from the following code with deeper indentation.
Please note that multi-line statements typically have very long lines, and
typically are ragged at the end, so that it is NOT so obvious to the reader
which of these long lines have dangling operators at the end. Continuation
marks at the begin of the lines are much easier to recognize by humans,
regardless of whether operators or indentation is used for that purpose.
When writing this, I just came across another "punctuation" topic:
My example could be rewritten as
if a and b
where the continuation lines are indented, and the indentation is "restored" by
the "then" line. I don't like such additional lines, because they make the text
longer and consequently require more scrolling for the same amount of
information. But in C it would look strange when the ")" at the end of a
condition would stand in a line of its own.
Return to the
Search the comp.compilers archives again.