Please log in.
Before you can vote, you need to register. Please log in or create an account.
Computer: Programming
Meaningful compiler error messages   (+4, -1)  [vote for, against]
Just for a change, your compiler tells you whats actually wrong with your program

Maybe I'm being a little naive here, but wouldn't it be great to have a compiler that actually told you what was wrong.

Posible messages should include: you've put that bit in the wrong place, it should go there, you've forgotten to do that, etc
-- imagooAJ, Oct 21 2000

(?) "Funny" error messages
To stem the tide. [egnor, Oct 21 2000, last modified Oct 04 2004]

Parentheses tracker http://www.halfbake...rentheses_20tracker
An idea for Nobody. [juuitchan3, Jun 29 2002, last modified Oct 04 2004]

I used to be consulted daily on Fortran problems in a large engineering firm. I was reminded of Robert Pirsig's comments on paying attention and thinking about what you are doing when you are doing it.

A typical exchange:

"I can't figure out why my program crashed."

I look at the printout. "ERROR: YOU HAVE DIVIDED BY ZERO IN LINE 420."

"Have you considered the possibility that you have divided by zero in line 420?" I ask politely.

"No. I better check..."

I kid you not.
-- boris, Oct 21 2000

To report the kind of error message you want, the compiler has to somehow know what you meant so that it can tell how what you wrote down is different.

If we could make compilers which were able to intuit your meaning from buggy code you wrote, well...

The best we can really hope to do is provide enough information about what the compiler was doing when it encountered the error, and why the error occurred, that the programmer can match this against their mental model and track down the problem.
-- egnor, Oct 21 2000

My devtool of choice, Delphi, has the decency to give me plenty of hints where it sees I've left loose ends in my code. That's a start, I suppose.

It would be really cool if the compiler could go a step further, work out what the mistyped variable name should have been (hey, its toted up the symbols already!), and perhaps working out where the missing END; should go.
-- MonTemplar, Oct 21 2000

I am reminded of a story (web urban legend?) where some version of a C compiler went out the door with some of the developer's "test" error messages still in place. It was not too long before they got a call asking what the following compiler error meant:

Error 3040: Klingons off the starboard bow
-- blahginger, Oct 21 2000

A number of compilers do attempt "error recovery", e.g. "working out where the missing END; should go". Many such compilers will even tell you exactly what they're doing: "inserting END; before line 135".

It sucks. They guess wrong, and you just get a whole pile of "snowball" errors.
-- egnor, Oct 21 2000

Or, alternatively: Compilers that swear at you if get something wrong:

eg: "You ****ing idiot, you missed out a ;", or "Everbody knows you dont do that you cretin".
-- imagooAJ, Oct 23 2000

Error 1500: Better software that does the same task already exists as off-the-shelf.

Error 1501: Your user-model is lousy and no one but a code-head will be able to figure out the UI.

Error 1502: I could have written this using 2110 fewer lines of code.

Error 1503: Lines 13900-14560 violate 3 current software patents.

Error 1504: It's obvious this was written without the benefit of a proper Software Requirements Specification.

and so on . . .
-- bristolz, Oct 29 2000

Imho, it would be good if we moved away from C-style syntax. If, instead, you have to write something like

do i=1,10 call doSomething() enddo

you'll be less likely to make mistakes like this:

for(i = 1; i <= 10; i++); doSomething();
-- nobody, May 05 2001

Hey nobody. Get yourself some Delphi:

for i := 1 to 10 do
Something else;

Or even VB
-- globaltourniquet, May 05 2001

Or even lisp.

My lisp interpreter deals with runtime errors as follows:

Error: Can't evaluate <some expression> Evaluate instead: <read expression> Replace?(t/nil): <value that would have been returned if evaluate instead expression were where some expression was>

In the event that <some expression> is a list, it puts a <exp>-><value> entry for each element between Error: and Evaluate instead. This makes obvious situations where I've used an inappropriate number of arguments or inappropriate argument type, without maintaining a collection of error messages.
-- LoriZ, Sep 27 2001

Debugging Java from (Sun) compiler errors is dead easy 99% of the time.
-- jabbers, Sep 27 2001

This is not a compiler error but a command line error on my terminal that keeps me amused when things are slow...

<enter command> God
<error message> 'God' does not exist.
-- DrBob, Sep 27 2001

See link, before anyone posts more...
-- egnor, Sep 27 2001

Nobody: I have a similar idea.
-- juuitchan3, Jun 29 2002

Halfbaked enough to have an acronym: DWIMNWIS.
-- bookworm, Jun 29 2002

<error message> 'God' does not exist. - DrBob,

What would he have done if it had worked....
-- random_patenter_syndrome_victim, Nov 21 2009

Semicolon added.
-- pashute, Feb 02 2016

random, halfbakery