Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why code completion and early error checking are needed

Reply
Thread Tools

Why code completion and early error checking are needed

 
 
Steven T. Hatton
Guest
Posts: n/a
 
      06-05-2004
Some people have suggested the desire for code completion and refined
edit-time error detection are an indication of incompetence on the part of
the programmer who wants such features. Unfortunately these ad hominem
rhetorts are frequently introduced into purely technical discussions on the
feasibility of supporting such functionality in C++. That usually serves
to divert the discussion from the technical subject to a discussion of the
character of the proponent of the new technology. This recently happened in
this newsgroup, and I have to confess, I took the bait and defended my
character instead of ignoring the irrelevant comments.

Since I still believe the features I listed are important to C++ I am making
an effort to return that discussion to the relevant technical matters. The
list is not intended to be exhaustive, and any item on it is subject to
refinement or even removal. It is only intended as a starting point for
further development of the ideas. Here is the list again:
//-----------------------------------------------------------**
Will the IDE add the required headers and using declarations to your source
automatically?**

Will it give an indication of the exceptions thrown by a function call?**

Will it display all the overloaded function signture with an indication of
the type of parameter it takes?**

Does it filter according to context?**That*is,*does*it*only*show*the
identifiers visible in the current scope when it provides code completion
(unless you ask for more)?

When it shows error indicators in the edit buffer, is that a result of
compiler output, or is the code evaluated as you input it?

Can you add virtually any SDK such as the Xerces C++ to the available
resources and have the code completion and checking work at the same level
as it does for the Standard Libraray and the implementation's API(s)?
//-----------------------------------------------------------

Since there is some question as to whether such functionality would be
advantageous to C++, I will briefly address the matter. I have been
working with a project that has grown from something I could download and
build in a matter of minutes on 1997 computing technology (sparc 5, and P2
intel platforms), to a world class desktop user interface environment with
more than 40,000 lines of code. The collective libraries for all the
components of the KDE is huge. It is unreasonable to expect a programmer
to be aware of every feature of every class and function in these
libraries. And that fails to take into account the number of different
supporting libraries employed, or potentially employed by the developer.

The feature I have listed above have proven useful to developers working on
large-scale projects using a different programming language. The provide a
way for the programmer to leaverage the available resources more
efficiently and effectively.

It has been suggested that an effort to support such functionality by
ensuring the C++ implementation provides the necessary interface to the
development environment would somehow encumber C++ and make it
significantly less useful. Since, so far as I know, the requirements for
providing this interface have not been established, I find it difficult to
believe the impact on the language has been evaluated. Can anybody provide
a reasoned, objective rationale for why the proposed support would
significantly and negatively impact C++?


--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
 
 
 
=?ISO-8859-15?Q?Juli=E1n?= Albo
Guest
Posts: n/a
 
      06-05-2004
Steven T. Hatton wrote:

> believe the impact on the language has been evaluated. Can anybody
> provide a reasoned, objective rationale for why the proposed support would
> significantly and negatively impact C++?


I think the standarization process does not work that way. You must prove
that the proposal will significantly and positively impact C++.

--
Salu2
 
Reply With Quote
 
 
 
 
Steven T. Hatton
Guest
Posts: n/a
 
      06-05-2004
Julián Albo wrote:

> Steven T. Hatton wrote:
>
>> believe the impact on the language has been evaluated. Can anybody
>> provide a reasoned, objective rationale for why the proposed support
>> would significantly and negatively impact C++?

>
> I think the standarization process does not work that way. You must prove
> that the proposal will significantly and positively impact C++.
>

My question was not about the standardization process.
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
Petec
Guest
Posts: n/a
 
      06-05-2004
Steven T. Hatton wrote:
> Some people have suggested the desire for code completion and refined
> edit-time error detection are an indication of incompetence on the
> part of the programmer who wants such features. Unfortunately these
> ad hominem rhetorts are frequently introduced into purely technical
> discussions on the feasibility of supporting such functionality in
> C++. That usually serves to divert the discussion from the technical
> subject to a discussion of the character of the proponent of the new
> technology. This recently happened in this newsgroup, and I have to
> confess, I took the bait and defended my character instead of
> ignoring the irrelevant comments.
>
> Since I still believe the features I listed are important to C++ I am
> making an effort to return that discussion to the relevant technical
> matters. The list is not intended to be exhaustive, and any item on
> it is subject to refinement or even removal. It is only intended as
> a starting point for further development of the ideas. Here is the
> list again:
> //-----------------------------------------------------------
> Will the IDE add the required headers and using declarations to your
> source automatically?
>
> Will it give an indication of the exceptions thrown by a function
> call?
>
> Will it display all the overloaded function signture with an
> indication of the type of parameter it takes?
>
> Does it filter according to context? That is, does it only show the
> identifiers visible in the current scope when it provides code
> completion (unless you ask for more)?
>
> When it shows error indicators in the edit buffer, is that a result of
> compiler output, or is the code evaluated as you input it?
>
> Can you add virtually any SDK such as the Xerces C++ to the available
> resources and have the code completion and checking work at the same
> level as it does for the Standard Libraray and the implementation's
> API(s)? //-----------------------------------------------------------
>
> Since there is some question as to whether such functionality would be
> advantageous to C++, I will briefly address the matter. I have been
> working with a project that has grown from something I could download
> and build in a matter of minutes on 1997 computing technology (sparc
> 5, and P2 intel platforms), to a world class desktop user interface
> environment with more than 40,000 lines of code. The collective
> libraries for all the components of the KDE is huge. It is
> unreasonable to expect a programmer to be aware of every feature of
> every class and function in these libraries. And that fails to take
> into account the number of different supporting libraries employed,
> or potentially employed by the developer.
>
> The feature I have listed above have proven useful to developers
> working on large-scale projects using a different programming
> language. The provide a way for the programmer to leaverage the
> available resources more efficiently and effectively.
>
> It has been suggested that an effort to support such functionality by
> ensuring the C++ implementation provides the necessary interface to
> the development environment would somehow encumber C++ and make it
> significantly less useful. Since, so far as I know, the requirements
> for providing this interface have not been established, I find it
> difficult to believe the impact on the language has been evaluated.
> Can anybody provide a reasoned, objective rationale for why the
> proposed support would significantly and negatively impact C++?


Again, C++ already provides such functionality in its declarations. It's up
to the IDEs to use that info, and the /language/ standards should not
specify IDE features.

- Pete


 
Reply With Quote
 
Steven T. Hatton
Guest
Posts: n/a
 
      06-05-2004
Petec wrote:

> Steven T. Hatton wrote:


>> Since I still believe the features I listed are important to C++ I am
>> making an effort to return that discussion to the relevant technical
>> matters. The list is not intended to be exhaustive, and any item on
>> it is subject to refinement or even removal. It is only intended as
>> a starting point for further development of the ideas. Here is the
>> list again:
>> //-----------------------------------------------------------
>> Will the IDE add the required headers and using declarations to your
>> source automatically?
>>
>> Will it give an indication of the exceptions thrown by a function
>> call?
>>
>> Will it display all the overloaded function signture with an
>> indication of the type of parameter it takes?
>>
>> Does it filter according to context? That is, does it only show the
>> identifiers visible in the current scope when it provides code
>> completion (unless you ask for more)?
>>
>> When it shows error indicators in the edit buffer, is that a result of
>> compiler output, or is the code evaluated as you input it?
>>
>> Can you add virtually any SDK such as the Xerces C++ to the available
>> resources and have the code completion and checking work at the same
>> level as it does for the Standard Libraray and the implementation's
>> API(s)? //-----------------------------------------------------------


>
> Again, C++ already provides such functionality in its declarations.


I don't believe the Standard acutally requires the presence of these
declarations as such. As long as the implementation producese the compiled
result "as if" they were present it is considered to conform to the
Standard.

> It's
> up to the IDEs to use that info, and the /language/ standards should not
> specify IDE features.


It's been proposed that IDE support be included as a formal consideration in
future versions of the Standard. The way I see it, the traditional view of
source code written in programming languages is that it has two primary
audiences, programmers, and computers. I believe a third 'audience' should
be considered, the IDE. I am not proposing the specification of the
language place requierments on IDEs. It does seem reasonable to consider
placing requirements on the implementation to provide a standard means of
extracting information from the available resources intended for use as
development libraries. That includes the Standard Library.

It may turn out that the Standard itself does not need to be modified, and
that this can all be accomplished by the implementation.
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
Petec
Guest
Posts: n/a
 
      06-05-2004
Steven T. Hatton wrote:
> Petec wrote:

<snip>
>
>>
>> Again, C++ already provides such functionality in its declarations.

>
> I don't believe the Standard acutally requires the presence of these
> declarations as such. As long as the implementation producese the
> compiled result "as if" they were present it is considered to conform
> to the Standard.


For the standard library, yes, that is true, but implemetations are
perfectly capable of knowing how they store their own std lib.
For any other librarys, and components of user programs, declarations and
definitions work fine.

>
>> It's
>> up to the IDEs to use that info, and the /language/ standards should
>> not specify IDE features.

>
> It's been proposed that IDE support be included as a formal
> consideration in future versions of the Standard. The way I see it,
> the traditional view of source code written in programming languages
> is that it has two primary audiences, programmers, and computers. I
> believe a third 'audience' should be considered, the IDE. I am not
> proposing the specification of the language place requierments on
> IDEs. It does seem reasonable to consider placing requirements on
> the implementation to provide a standard means of extracting
> information from the available resources intended for use as
> development libraries. That includes the Standard Library.
>
> It may turn out that the Standard itself does not need to be
> modified, and that this can all be accomplished by the implementation.


VC++ has already proved that that is so. Your operating system of choice's
tools have not, but that does not mean that superior OSs' tools do not.

- Pete


 
Reply With Quote
 
Carl Ribbegaardh
Guest
Posts: n/a
 
      06-05-2004

"Petec" <(E-Mail Removed)> wrote in message
news:ALlwc.2324$(E-Mail Removed) nk.net...
> Steven T. Hatton wrote:
> > Petec wrote:

> <snip>
> >
> >>
> >> Again, C++ already provides such functionality in its declarations.

> >
> > I don't believe the Standard acutally requires the presence of these
> > declarations as such. As long as the implementation producese the
> > compiled result "as if" they were present it is considered to conform
> > to the Standard.

>
> For the standard library, yes, that is true, but implemetations are
> perfectly capable of knowing how they store their own std lib.
> For any other librarys, and components of user programs, declarations and
> definitions work fine.
>
> >
> >> It's
> >> up to the IDEs to use that info, and the /language/ standards should
> >> not specify IDE features.

> >
> > It's been proposed that IDE support be included as a formal
> > consideration in future versions of the Standard. The way I see it,
> > the traditional view of source code written in programming languages
> > is that it has two primary audiences, programmers, and computers. I
> > believe a third 'audience' should be considered, the IDE. I am not
> > proposing the specification of the language place requierments on
> > IDEs. It does seem reasonable to consider placing requirements on
> > the implementation to provide a standard means of extracting
> > information from the available resources intended for use as
> > development libraries. That includes the Standard Library.
> >
> > It may turn out that the Standard itself does not need to be
> > modified, and that this can all be accomplished by the implementation.

>
> VC++ has already proved that that is so. Your operating system of choice's
> tools have not, but that does not mean that superior OSs' tools do not.
>
> - Pete
>


You might also want to take a look at Eclipse and CDT.



 
Reply With Quote
 
Petec
Guest
Posts: n/a
 
      06-05-2004
Carl Ribbegaardh wrote:
<snip>
>>
>> VC++ has already proved that that is so. Your operating system of
>> choice's tools have not, but that does not mean that superior OSs'
>> tools do not.
>>
>> - Pete
>>

>
> You might also want to take a look at Eclipse and CDT.
>


Yes, I meant to put "Your operating system of choice's tools *may* have
not...".
I haven't used Linux except for one month, after which I promptly discarded
it in favor of Windows, due to the fact that I like neither the open-source
philosophy or the style of tools.

- Pete


 
Reply With Quote
 
Ivan Vecerina
Guest
Posts: n/a
 
      06-05-2004
"Steven T. Hatton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Some people have suggested the desire for code completion and refined
> edit-time error detection are an indication of incompetence on the part of
> the programmer who wants such features.

.....
> Since I still believe the features I listed are important to C++ I am

making
> an effort to return that discussion to the relevant technical matters.

The
> list is not intended to be exhaustive, and any item on it is subject to
> refinement or even removal. It is only intended as a starting point for
> further development of the ideas. Here is the list again:
> //-----------------------------------------------------------
> Will the IDE add the required headers and using declarations to your

source
> automatically?


I guess that this could be achieved by specifying, in the IDE, a list
of "consider for auto-include" headers. I'm not sure how practical this
would be in large projects with many libraries and overloads (this could
require quite some AI in the end), but basic support would be reasonable.

> Will it give an indication of the exceptions thrown by a function call?

Well, this could be displayed based on throw-specifications (although
these have a different purpose and side-effects).

> Will it display all the overloaded function signture with an indication of
> the type of parameter it takes?

Existing IDEs (notably M$'s) do this already.

> Does it filter according to context? That is, does it only show the
> identifiers visible in the current scope when it provides code completion
> (unless you ask for more)?

This feature conflicts somewhat with the first one (auto-include),
but does not seem unreasonable.

> When it shows error indicators in the edit buffer, is that a result of
> compiler output, or is the code evaluated as you input it?

Some existing platforms (Apple's X-Code for MacOS X, IIRC) perform
continuous 'background compilation', and could rely on the compiler's
output for this.

> Can you add virtually any SDK such as the Xerces C++ to the available
> resources and have the code completion and checking work at the same level
> as it does for the Standard Libraray and the implementation's API(s)?

You can if you rely on parsing standard code only, or publish a standard
way to annotate source code. The documentation system used by doxygen
(which in turn is similar to javadoc and other tools) is something I
would pick as a de factor standard (with maybe some formalization).

> //-----------------------------------------------------------
>
> Since there is some question as to whether such functionality would be
> advantageous to C++, I will briefly address the matter.

....
> The feature I have listed above have proven useful to developers working

on
> large-scale projects using a different programming language. The provide

a
> way for the programmer to leaverage the available resources more
> efficiently and effectively.
>
> It has been suggested that an effort to support such functionality by
> ensuring the C++ implementation provides the necessary interface to the
> development environment would somehow encumber C++ and make it
> significantly less useful. Since, so far as I know, the requirements for
> providing this interface have not been established, I find it difficult to
> believe the impact on the language has been evaluated. Can anybody

provide
> a reasoned, objective rationale for why the proposed support would
> significantly and negatively impact C++?

Most of the features above can be implemented using the existing language.
The only extension would eventually be to standardize or recommend a code
annotation technique (e.g. doxygen).


The core problem is that parsing C++ is really complex, and this does
not facilitate the development of add-ons and utilities.
What might help is to have a public *reference implementation* of a C++
parser, with a standardized interface.
Existing tools tend to either rely on a modified GCC compiler, or
a home-made annotation system. But some, like doxygen, are rather
good at parsing and analyzing code structure, including overloads
and templates.

Actually, the output of a tool like doxygen could be used to implement
most of the features above...



my 2 cents,
Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- e-mail contact form


 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      06-05-2004
Steven T. Hatton wrote:

> Some people have suggested the desire for code completion and refined
> edit-time error detection are an indication of incompetence on the part of
> the programmer who wants such features.


Absolutely. So is pair programming, test-driven development, requirements
analysis, keyboards, refactoring, etc. These are all crutches. Only
imbeciles would need them.

> Unfortunately these ad hominem
> rhetorts are frequently introduced into purely technical discussions on

the
> feasibility of supporting such functionality in C++. That usually serves
> to divert the discussion from the technical subject to a discussion of the
> character of the proponent of the new technology. This recently happened

in
> this newsgroup, and I have to confess, I took the bait and defended my
> character instead of ignoring the irrelevant comments.


Well, this forum is the epitome of decorum. It's just us and
news:sci.math...

> Since I still believe the features I listed are important to C++ I am

making
> an effort to return that discussion to the relevant technical matters.

The
> list is not intended to be exhaustive, and any item on it is subject to
> refinement or even removal. It is only intended as a starting point for
> further development of the ideas. Here is the list again:
> //-----------------------------------------------------------
> Will the IDE add the required headers and using declarations to your

source
> automatically?


Are you coming from Eclipse? Languages without C++ legacy implementation
architectures are very easy to parse, and languages with static typing are
easy to analyze for module dependencies.

C++ is not. But I'm more interested in a refactoring browser that _removes_
unneeded headers.

> Will it give an indication of the exceptions thrown by a function call?


C++'s exception specification system, in Bjarne Stroustrup's opinion, is
broken. If you neglect a throw specifier, if that type throws the program
aborts. Static code analysis can't catch this risk, and refactoring can
easily move a new function under another one.

> Will it display all the overloaded function signture with an indication of
> the type of parameter it takes?


That would be easy. However, read my thread "The TEST_() macro". Visual
Studio's editor has a broken C++ parser, and it thinks my macro
instantiations are overloaded calls to a mysterious TEST_() function! Of
course the actual compiler interprets #define macros correctly, but the
editor would be as slow as the compiler to get its source browser right.

> Does it filter according to context? That is, does it only show the
> identifiers visible in the current scope when it provides code completion
> (unless you ask for more)?


The next problem with code completion is it's a crutch that encourages
programmers to write instead of think. (I know I know - they said that about
trains, cars, phones, teledildonics, etc.)

You also need to ask for a "refactoring browser". In Eclipse, the Extract
Method command will not only convert selected statements into a call to a
new method, with the correct arguments and return type, but it will also
sweep nearby code looking for the same statements, and merge them too.
Refactoring allows designs to accomodate more features than all that can fit
in programmer's memory.

> When it shows error indicators in the edit buffer, is that a result of
> compiler output, or is the code evaluated as you input it?


The most ambitious research in Test-Driven Development focuses on editors
that chronically run tests, at every relevant juncture, providing Zero
Button Testing. An editor might, for example, draw pink lines under failing
Test Cases, and under the Production Code they target, much the same way
word processors mark words not in their dictionaries.

> Can you add virtually any SDK such as the Xerces C++ to the available
> resources and have the code completion and checking work at the same level
> as it does for the Standard Libraray and the implementation's API(s)?


But - that would defeat the purpose of Vendor Lockin! Only your editor's
vendor, and its vassal companies, may add a library!

> Since there is some question as to whether such functionality would be
> advantageous to C++, I will briefly address the matter. I have been
> working with a project that has grown from something I could download and
> build in a matter of minutes on 1997 computing technology (sparc 5, and P2
> intel platforms), to a world class desktop user interface environment with
> more than 40,000 lines of code. The collective libraries for all the
> components of the KDE is huge. It is unreasonable to expect a programmer
> to be aware of every feature of every class and function in these
> libraries. And that fails to take into account the number of different
> supporting libraries employed, or potentially employed by the developer.


This reminds me of my experiences on Linux, attempting to download and
compile the f---er.

> The feature I have listed above have proven useful to developers working

on
> large-scale projects using a different programming language. The provide

a
> way for the programmer to leaverage the available resources more
> efficiently and effectively.


There are ways to keep a code-base from growing large, and from appearing
large. Primarily, write many unit tests for all the features. They
self-document. An editor that flipped from a method to its test code would
be great.

> It has been suggested that an effort to support such functionality by
> ensuring the C++ implementation provides the necessary interface to the
> development environment would somehow encumber C++ and make it
> significantly less useful. Since, so far as I know, the requirements for
> providing this interface have not been established, I find it difficult to
> believe the impact on the language has been evaluated. Can anybody

provide
> a reasoned, objective rationale for why the proposed support would
> significantly and negatively impact C++?


#define macros differ based on /D arguments to the compiler.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
code completion not working in code-behind file jason ASP .Net 4 06-02-2005 04:18 PM
Spelling Completion or Code completion in ASP? ziggs ASP General 2 04-21-2004 02:02 PM
Python and Code Completion Madiba Python 1 08-11-2003 10:47 PM



Advertisments