comp.lang.ada
 help / color / mirror / Atom feed
* Re: syntax completion - a bad thing?
       [not found]   ` <32fa1450.32791176@news.logica.co.uk>
@ 1997-02-08  0:00     ` Robert Dewar
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1997-02-08  0:00 UTC (permalink / raw)



Steve said

<<Ahh! But the problem occurs with the EDITOR. Apex is a development
environment (editor, config control, &c) - When you are using the
editor, you get syntax completion (unless you turn it off). I have
used Apex (and the earlier Rational 'delta' boxes) and encountered
bugs resulting from erroneous code completion - usually an 'end if' in
the wrong place. The editor seems to look for a blank line sometimes
(presumably when indentation does not help) and puts the end if there.
IMO completion is helpful if you force it after keywords to get a
template IF you are writing a new subprogram. On existing code it is
more trouble than it is worth. My approach was to use vi on existing
code and the Rational editor to create new stuff.>>

Ah, sure, yes the Rational EDITOR does like to molest source as you
enter it. A lot of programmers like this and find it useful, and as
you point out it is an option you can turn off. Personally I hate
editors that do *anything at all* to the text I am entering, I don't
even like the Ada mode in EMACS, and I think that editors that produce
"useful" templates (like the default mode of EPM on OS/2 editing a C
file, or DEC's LSE) are a menace.

But this is a place where tastes differ VERY widely, and the important
thing is that these kind of features should be configurable in your
environment. And indeed using vi seems a quite reassonable "work around".





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: syntax completion - a bad thing?
       [not found] <32F91629.5F9@vsl.com.au>
@ 1997-02-10  0:00 ` Greg Bek
  1997-02-11  0:00   ` Samuel Mize
  1997-02-12  0:00   ` Matthew Daniel
  1997-02-10  0:00 ` Lance Kibblewhite
       [not found] ` <dewar.855234467@merv>
  2 siblings, 2 replies; 6+ messages in thread
From: Greg Bek @ 1997-02-10  0:00 UTC (permalink / raw)



Andrew Kelly wrote:
> 
>...
> 
> This seems, to me, to be more dangerous than it is useful ...
> eg. If you accidentally delete the "end" from a nested "if",
> where does the analyser stuff the "end"?  Indeed, even if it
> gets the placement correct (eg. by inference from the text
> indentation) if code statements have been inadvertantly deleted
> as well, a clearly erroneous file will compile cleanly.
>
The syntax completion algorthim attempts to put closing constructs
close the offending opening construct.  This tends to make the
additions obvious to the user performing the editing.  Similarly
you can force it to break constructs with a well placed semi-colon
when editing.

Certainly there is a risk in the syntax complete creating
eroneous code.  But programming is an intellectual activity,
you don't do it with the brain turned off.  The same risk
applies with a global search and replace, or the very common
cut/paste style of bug where you don't quite fix up all the
bits you should in the newly pasted text.

I wouldn't trade my Apex Ada editor for any other option,
the ability to browse definitions, perform show_usage and
auto formatting and syntax completion, along with 25 levels
of undo make it my editor of choice for Ada.  For me it
is the appropriate tool.  As Jerome D wrote is his response
there are ways to disable the behaviour if you want to.

 
> I believe syntax completion should be available during editting,
> but not automatically employed during compilation.  As far as I
> can discover, it cannot be switched off in Apex either.
> 
> Has anybody had any experiences with syntax completion that may
> confirm or allay my fears?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: syntax completion - a bad thing?
       [not found] <32F91629.5F9@vsl.com.au>
  1997-02-10  0:00 ` syntax completion - a bad thing? Greg Bek
@ 1997-02-10  0:00 ` Lance Kibblewhite
       [not found] ` <dewar.855234467@merv>
  2 siblings, 0 replies; 6+ messages in thread
From: Lance Kibblewhite @ 1997-02-10  0:00 UTC (permalink / raw)



Andrew Kelly <andrewk@vsl.com.au> wrote:

>Looking at Rational's Apex Ada development environment, I am
>worried the inclusion of syntax completion in the "analyser"
>(pre-compilation phase).
>
>It seems to me that syntax completion, as a step during 
>compilation, is not a good thing as it *repairs* errors 
>rather than report them (eg. unpaired begin/ends).  The 
>obvious risk being that incorrect code will quite happily be 
>"repaired" (very possibly, incorrectly) and will compile 
>successfully.
>
>This seems, to me, to be more dangerous than it is useful ...
>eg. If you accidentally delete the "end" from a nested "if", 
>where does the analyser stuff the "end"?  Indeed, even if it 
>gets the placement correct (eg. by inference from the text
>indentation) if code statements have been inadvertantly deleted
>as well, a clearly erroneous file will compile cleanly.
>
>I believe syntax completion should be available during editting, 
>but not automatically employed during compilation.  As far as I
>can discover, it cannot be switched off in Apex either.
>
>Has anybody had any experiences with syntax completion that may
>confirm or allay my fears?

In case nobody else noticed, this question also appeared in the RISKS
DIGEST, edition 18.81.

Prehaps those of you that are able to place in this 'risk' in the
correct perspective could also follow up to that forum.  I have
appended info on this digest below:

> The RISKS Forum is a MODERATED digest.  Its Usenet equivalent is comp.risks.
>=> SUBSCRIPTIONS: PLEASE read RISKS as a newsgroup (comp.risks or equivalent) 
> if possible and convenient for you.  Or use Bitnet LISTSERV.  Alternatively,
> (via majordomo) DIRECT REQUESTS to <risks-request@csl.sri.com> with one-line, 
>   SUBSCRIBE (or UNSUBSCRIBE) [with net address if different from FROM:] or
>   INFO     [for unabridged version of RISKS information]
>=> The INFO file (submissions, default disclaimers, archive sites, .mil/.uk
> subscribers, copyright policy, PRIVACY digests, etc.) is also obtainable from
> http://www.CSL.sri.com/risksinfo.html  ftp://www.CSL.sri.com/pub/risks.info
> The full info file will appear now and then in future issues.  *** All 
> contributors are assumed to have read the full info file for guidelines. ***
>=> SUBMISSIONS: to risks@CSL.sri.com with meaningful SUBJECT: line.
>=> ARCHIVES are available: ftp://ftp.sri.com/risks or
> ftp ftp.sri.com<CR>login anonymous<CR>[YourNetAddress]<CR>cd risks
> or http://catless.ncl.ac.uk/Risks/VL.IS.html      [i.e., VoLume, ISsue].
> The ftp.sri.com site risks directory also contains the most recent 
> PostScript copy of PGN's comprehensive historical summary of one liners:
>   get illustrative.PS


-- Lance.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: syntax completion - a bad thing?
       [not found] ` <dewar.855234467@merv>
       [not found]   ` <32fa1450.32791176@news.logica.co.uk>
@ 1997-02-11  0:00   ` Samuel Mize
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Mize @ 1997-02-11  0:00 UTC (permalink / raw)



In article <dewar.855234467@merv>, Robert Dewar <dewar@merv.cs.nyu.edu> wrote:
>Andrew says
>
>"It seems to me that syntax completion, as a step during
>compilation, is not a good thing as it *repairs* errors
>rather than report them (eg. unpaired begin/ends).  The
>obvious risk being that incorrect code will quite happily be
>"repaired" (very possibly, incorrectly) and will compile
>successfully."
>
>
>This must be a misunderstanding, no Ada compiler can possibly have as
>its standard or only operating mode one in which errors are silently
>ignored. It would be impossible to validate such a compiler, and since
>the Rational compilers are validated (the observations apply equally
>to Ada 83 and Ada 95), you must be misunderstanding ...
>

The editor does syntax completion silently when you save the file.
This appears to the user as if it is happening at compilation.

In addition, you can compile from the editor; this saves the file to
disk so the compiler can get at it.  Since it saves, it does a
syntax completion.

I assume they did the validation suite from existing disk files, so
the editing suite didn't come into the picture.

Another message states how to turn it off (set switch
REJECT_SYNTAX_ERRORS = true for the working view).

Syntax completion can be is nice, but I have written so much code
without it that it's faster and easier, for me, to just type in the
full syntax.  Besides, it doesn't work well during maintenance, when
you are altering existing code structures.

With Apex, it took me almost a full day to locate how the editor had
embugged my code after I accidentally deleted an "end;" and Apex
put it back somewhere else.  Of course, once you realize the editor
might have altered your code behind your back, you start looking for
that a lot sooner.  You also start editing your files with vi or
emacs, and just using Apex as a compiler.

I had to bang on Rational for some time to find out how to turn
syntax completion off.  I'm not sure if they added it after I (and,
I'm sure, others) complained, or if it was there all along but I
never got hold of anyone who knew more than the company line, which
was "but that's a great feature, you certainly want to use it!"

Samuel Mize




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: syntax completion - a bad thing?
  1997-02-10  0:00 ` syntax completion - a bad thing? Greg Bek
@ 1997-02-11  0:00   ` Samuel Mize
  1997-02-12  0:00   ` Matthew Daniel
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Mize @ 1997-02-11  0:00 UTC (permalink / raw)



In article <32FF06AE.190F@rational.com>, Greg Bek  <gab2@rational.com> wrote:
>Andrew Kelly wrote:
>> 
>>...
>> 
>> This seems, to me, to be more dangerous than it is useful ...
>> eg. If you accidentally delete the "end" from a nested "if",
>> where does the analyser stuff the "end"?  Indeed, even if it
>> gets the placement correct (eg. by inference from the text
>> indentation) if code statements have been inadvertantly deleted
>> as well, a clearly erroneous file will compile cleanly.
>>
>The syntax completion algorthim attempts to put closing constructs
>close the offending opening construct.  This tends to make the
>additions obvious to the user performing the editing.

If it happens while you are editing in that location, or if it
alters the indentation level someplace obvious.


>Similarly
>you can force it to break constructs with a well placed semi-colon
>when editing.
>
>Certainly there is a risk in the syntax complete creating
>eroneous code.  But programming is an intellectual activity,
>you don't do it with the brain turned off.

Well, he did say he wants it while editing (doing the intellectual
activity).  He just doesn't want it done behind his back when he's
not looking.  I can assure you that syntax completion is not AT ALL
obvious tothe user when it happens silently on closing the file, or
in a part of the file you don't happen to look at in that editing
session.


>I wouldn't trade my Apex Ada editor for any other option,...

Yes, it is a nice editor.  It would simply be nicer if the syntax
completion only happened under explicit user control.  As I recall
from some months ago, you could turn it off to keep it from
working behind your back, but then you couldn't invoke it manually.

Samuel Mize




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: syntax completion - a bad thing?
  1997-02-10  0:00 ` syntax completion - a bad thing? Greg Bek
  1997-02-11  0:00   ` Samuel Mize
@ 1997-02-12  0:00   ` Matthew Daniel
  1 sibling, 0 replies; 6+ messages in thread
From: Matthew Daniel @ 1997-02-12  0:00 UTC (permalink / raw)



Greg Bek wrote:
> 
> Andrew Kelly wrote:
> >
> >...
blah blah
> 
> I wouldn't trade my Apex Ada editor for any other option,
> the ability to browse definitions, perform show_usage and
> auto formatting and syntax completion, along with 25 levels
> of undo make it my editor of choice for Ada.  For me it
> is the appropriate tool.  As Jerome D wrote is his response
> there are ways to disable the behaviour if you want to.
> 

Xemacs with Adamode compiling with GNAT (which is a validated compiler),
you just about covered it all and not at $25K a seat. You do not loose
the ability to edit code whilst doing a semantize on other packages, it
does not use 5 meg of mem per server (directory, editor, etc .. 6) per
person.

I thought the R1000's were great (we only had 7 users at a time on each
machine), RXI as an interface was quick.

Matt

with Disclaimer; use Disclaimer




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1997-02-12  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <32F91629.5F9@vsl.com.au>
1997-02-10  0:00 ` syntax completion - a bad thing? Greg Bek
1997-02-11  0:00   ` Samuel Mize
1997-02-12  0:00   ` Matthew Daniel
1997-02-10  0:00 ` Lance Kibblewhite
     [not found] ` <dewar.855234467@merv>
     [not found]   ` <32fa1450.32791176@news.logica.co.uk>
1997-02-08  0:00     ` Robert Dewar
1997-02-11  0:00   ` Samuel Mize

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox