comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Data_Error and Enumeration_IO
Date: Fri, 13 Jan 2012 09:33:31 +0100
Date: 2012-01-13T09:33:31+01:00	[thread overview]
Message-ID: <p13qmj7235d9$.q65v7ofzoopz.dlg@40tude.net> (raw)
In-Reply-To: jensq1$45b$1@munin.nbi.dk

On Thu, 12 Jan 2012 18:10:37 -0600, Randy Brukardt wrote:

> My recommendation is always to read the input into a string and then process 
> it there (using the string Gets that the language provides). The reason for 
> this is that it always a better error message in the failure case, because 
> you still have the string in hand. That way, you can avoid a generic message 
> that puzzles the user.

Another reason is that you can always return back in the string and
re-parse improperly matched parts of it.
 
> [Aside: For some reason, this reminds me of the first C compiler I used, way 
> back at the University of Wisconsin in 1978. It was a PDP-11 compiler for an 
> early version of Unix, and it essentially had two error messages: "lvalue 
> expected" for any compile-time mistake, and "bus error - core dumped" for 
> any run-time mistake. Debugging programs using that compiler were almost 
> completely trial-and-error - you would guess what the error might have been, 
> and try something else to see if it fixed it. The compiler, and the fact 
> that early PC compilers were very much like it, had a lot to do with our 
> creating Janus/Ada a couple of years later. And that is why we always had 
> runtime trace backs and verbose runtime messages from the very beginning...]

Early Turbo Parscal compilers had only one to say "error in expression." 

But it is still sometimes a problem in C++ that the error message
incomprehensible. Then I would use the same technique I did 25 years ago:
comment everything out until it compiles and then uncomment line by line
compiling it each time.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-01-13  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 22:41 Data_Error and Enumeration_IO John McCormick
2012-01-12 23:02 ` Jeffrey Carter
2012-01-12 23:28 ` Georg Bauhaus
2012-01-13  0:10 ` Randy Brukardt
2012-01-13  8:33   ` Dmitry A. Kazakov [this message]
2012-01-13 21:30   ` John McCormick
2012-01-13 22:00     ` Jeffrey Carter
2012-01-14  0:09       ` Randy Brukardt
2012-01-14  9:51         ` Dmitry A. Kazakov
2012-01-14 12:25         ` Niklas Holsti
replies disabled

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