| Date: | Mon, 30 Jun 1997 15:13:18 +0100 |
| Reply-To: | John Whittington <johnw@MAG-NET.CO.UK> |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | John Whittington <johnw@MAG-NET.CO.UK> |
| Subject: | Re: Extended inline comment Considered Harmful |
|
|
| Content-Type: | text/plain; charset="us-ascii" |
|---|
On Mon, 30 Jun 1997, John Herbert <herbertj@bre.co.uk> wrote (amidst a lot
more):
>--Mind you, balancing 'recognition' would also help spot the "close the comment
>with /*" error (typo city!).
>Personally, I'd like to see syntax checking and comment balancing in the
>editor (or in a plug-in editor - whatever works best).
John (and Karsten), this discussion about automatic balancing of comments -
or, at least, reognition of unbalanced comments - is all very well, but
there is clearly a limit to what any automated system can do in the absence
of a crystal ball or humanoid intelligence - since the programmer's true
intentions may not be clear/unambiguous - regardless of which type of
comments one uses. For example, what human, let alone machine, could be
certain as to the programmer's intention in the following situation:
x1 = y + 5 ;
* if client=Fred, then consider alternative
x2 = y + 5 ;
x3 = z - 6 ;
[ is the absence of a semicolon after 'alternative' intentional or not? ]
x1 = y + 5 ;
/* if client=Fred, then consider alternative
x2 = y + 5 ;
x3 = z - 6 ;
/* accumulate using totalling statement */
total = total + increm ;
*/
t = t + i ;
[ what was the programmer's intention here - there seem to be many
possibilities ]
Regards
John
John
-----------------------------------------------------------
Dr John Whittington, Voice: +44 1296 730225
Mediscience Services Fax: +44 1296 738893
Twyford Manor, Twyford, E-mail: johnw@mag-net.co.uk
Buckingham MK18 4EL, UK CompuServe: 100517,3677
-----------------------------------------------------------
|