Programming Feature? 
Author Message
 Programming Feature?

 As a beginning programmer I have used Borland Builder 4 C++ and
Microfocus/Merant Net Express 3.0 (Cobol) to write programs. I can write
them, compile, and execute. Naturally there are errors to correct
sometimes.
 I was just wondering, in this techy age, when a program is written in the
above languages that contains errors, why doesn't it show you in a window
what the correction should be??? Makes sense to me to have this feature
even if the individual is well accomplished as a programmer.
 I have a professor that makes errors^ I've corrected some of his...
it seems that it would save time, and in a business- money...

J

------------------  Posted via CNET Help.com  ------------------
                      http://www.*-*-*.com/



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:

>  As a beginning programmer I have used Borland Builder 4 C++ and
> Microfocus/Merant Net Express 3.0 (Cobol) to write programs. I can write
> them, compile, and execute. Naturally there are errors to correct
> sometimes.
>  I was just wondering, in this techy age, when a program is written in the
> above languages that contains errors, why doesn't it show you in a window
> what the correction should be??? Makes sense to me to have this feature
> even if the individual is well accomplished as a programmer.
>  I have a professor that makes errors^ I've corrected some of his...
> it seems that it would save time, and in a business- money...

> J

Besause that is not as simple as you think.
eg.

  int  iNr;
  int  iNum;

I declare two variables, now I use
an undeclared variable.

  if( iNo == 0 )

what should be the suggestion from the compiler?
There is no other choice as to say: Undeclared variable.
Even a most likely search for a variable would come up
with anything usefull because it depends on the context
which Variable (iNr or iNum) would do the right thing.

I once saw novice programmers adding casts to their C-programm and
wondering that the program doesn't work. After studying the source
a few minutes, I came to the conclusion that they were completely
wrong. I asked them why they did this. The answer was: The compiler
told us he cant assign a pointer to struct a to a pointer to struct b,
so we added a cast to satisfy the compiler. Needless to say that
the assignment was the nonsense in the first place.

Last, but not least: Actually there are two types of errors:
* syntactical errors
* semantical errors

The first can be catched by the compiler. Normaly this isn't a big
problem, you walk through your code and correct them. Usually the
error message from the compiler gives a big hint what exactly is wrong.
(in terms of language rules)

The second are the real {*filter*}es. It is YOUR logic that is flawed and
creates the wrong answers. No program can ever check another program for
logcal flaws just by looking at it. Computers aren't intelligent (whatever
intelligent realy means), they are just very good and precise workers.
You tell them - they do. If you tell them the wrong thing - they do the
wrong thing.

-----------------------------------------------------------
Karl Heinz Buchegger



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:
> As a beginning programmer I have used Borland Builder 4 C++ and
> Microfocus/Merant Net Express 3.0 (Cobol) to write programs. I can write
> them, compile, and execute. Naturally there are errors to correct
> sometimes.
>  I was just wondering, in this techy age, when a program is written in the
> above languages that contains errors, why doesn't it show you in a window
> what the correction should be???

Because the compiler doesn't have the slighest clue what this correction
should be. All it knows is that the syntax you put in is not correct and
that it can't be compiled to an executable. The error messages the compiler
gives should give you a clue where your error is hiding, but in most cases
you are on your own. Nothing much to do about it.

Floris

PS. There are programs available that give you a more detailed discription
of your error, including memory leaks. Try PC Lint.



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:

>  I was just wondering, in this techy age, when a program is written in the
> above languages that contains errors, why doesn't it show you in a window
> what the correction should be??? Makes sense to me to have this feature
> even if the individual is well accomplished as a programmer.

There's nothing more infuriating than "error correction" software that
thinks it knows what you've done wrong and puts it right. This sort of thing
seems to be attached to word processors these days and its's maddening.
It takes more time to undo what the machine has wrongly put in than it
would take to put in what you really want in the first place.

A program that automatically corrected compiler errors would be dangerous
because it would encourage complacency in the user. If instead of actually
looking to see what was wrong the user just trusted the machine had put it
right, it could introduce some very dangerous errors into code.

Matthew Huntbach



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?


Quote:

>>  I was just wondering, in this techy age, when a program is written in the
>> above languages that contains errors, why doesn't it show you in a window
>> what the correction should be??? Makes sense to me to have this feature
>> even if the individual is well accomplished as a programmer.

>There's nothing more infuriating than "error correction" software that
>thinks it knows what you've done wrong and puts it right.

I don't think he's suggesting that, merely that the software offer
suggested corrections.  Like spell-check software that offers a menu of
words in its dictionary that are similar, but you still have to select the
word before it goes on.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?


Quote:


>>  As a beginning programmer I have used Borland Builder 4 C++ and
>> Microfocus/Merant Net Express 3.0 (Cobol) to write programs. I can write
>> them, compile, and execute. Naturally there are errors to correct
>> sometimes.
>>  I was just wondering, in this techy age, when a program is written in the
>> above languages that contains errors, why doesn't it show you in a window
>> what the correction should be??? Makes sense to me to have this feature
>> even if the individual is well accomplished as a programmer.
>>  I have a professor that makes errors^ I've corrected some of his...
>> it seems that it would save time, and in a business- money...

>> J

>Besause that is not as simple as you think.
>eg.

>  int  iNr;
>  int  iNum;

>I declare two variables, now I use
>an undeclared variable.

>  if( iNo == 0 )

>what should be the suggestion from the compiler?
>There is no other choice as to say: Undeclared variable.
>Even a most likely search for a variable would come up
>with anything usefull because it depends on the context
>which Variable (iNr or iNum) would do the right thing.

It could offer them both as possible corrections.  The user could click on
one of them to use it, or simply retype the statement manually.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:

>It could offer them both as possible corrections.
>The user could click on one of them to use it, or simply retype
>the statement manually.

But this only works for a very small class of errors, the AI required to
guess the correction for most errors is nigh impossible.
--
Ray Dunn
Montreal



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?
Visual C++ 6 does more of a prevention tactic with it's AutoComplete (which I
may add is a godsend). It basically shows you a list of possible words you
could be typing as you type them (if you hit Ctrl+Enter), and once you get far
enough that the variable you want is highlighted, you can hit Tab (Linux
style) and it'll finish the word.

And it does it for function declarations too, so as soon as I hit the
open-parentheses, if it doesn't pop up, I immediately check to see if that
variable name is declared, because it should have popped up. Maybe this is
more what you are looking for?

--
-------------------
Joe Drago

{Insert cool .sig quote here}



Mon, 25 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:
>I don't think he's suggesting that, merely that the software offer
>suggested corrections.  Like spell-check software that offers a menu of
>words in its dictionary that are similar, but you still have to select the
>word before it goes on.

Nice sugestion but I don't think it's very practical. In large projects it can
take several hours to compile the code. Imagine if the compiler had to find out
what things look similar and use all kinds of heuristics to give suggestions for
corrections. This would be definitely slower than correcting manually.

Besides, syntax errors are corrected very quickly by most programmers. It's not
a big deal to step through the errors and correct typos. The big problem is in
testing and finding out semantic errors (i.e. bugs).

Bart.

--
if( reply == spam )
    cout << "Go away!" << endl;
else
    cout << "bartkowalski" << at << "programmer.net" << endl;



Tue, 26 Mar 2002 03:00:00 GMT  
 Programming Feature?


 >> It could offer them both as possible corrections.  The user could click
 >> on one of them to use it, or simply retype the statement manually.

 Ray> But this only works for a very small class of errors, the AI required
 Ray> to guess the correction for most errors is nigh impossible.  

It depends on how good a typer you are. VisualWorks Smalltalk has this
feature, and it fixes quite a lot of my errors.

--

University of Tampere, Department of Computer Science  
Tampere, Finland                                      http://www.cs.uta.fi/~av/



Tue, 26 Mar 2002 03:00:00 GMT  
 Programming Feature?

Quote:



> >> It could offer them both as possible corrections.  The user could
click
> >> on one of them to use it, or simply retype the statement manually.

>But this only works for a very small class of errors, the AI required
>to guess the correction for most errors is nigh impossible.  

>It depends on how good a typer you are. VisualWorks Smalltalk has this
>feature, and it fixes quite a lot of my errors.

Yes it does, but that is a very small class of the errors generated by
the compiler, as I said.

--
Ray Dunn
Montreal



Tue, 26 Mar 2002 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Academic Programs Featuring M2, O?

2. Walker Art Center Online Program Featuring Virtual Space

3. ILU for VHLL FFI [was: RFD: Programming Language Feature Matrix]

4. RFD: Programming Language Feature Matrix

5. WANTED: Table of Programming Language Features

6. Q: Features of your programming language

7. Special Feature of Hermes: Correct Programs

8. ILU for VHLL FFI [was: RFD: Programming Language Feature Matrix]

9. RFD: Programming Language Feature Matrix

10. JAVA papers [re: oak] [re: features for systems programming languages]

11. Features for systems programming languages

12. Final SRFI 7: Feature-based program configuration language

 

 
Powered by phpBB® Forum Software