comp.lang.ada
 help / color / mirror / Atom feed
From: fraser@sinopsis.com
Subject: Re: Printing Enum Variable Re: Linux World
Date: 1999/03/04
Date: 1999-03-04T00:00:00+00:00	[thread overview]
Message-ID: <7bmua7$qg9$1@remarQ.com> (raw)
In-Reply-To: 36DDA9BA.E005E578@aasaa.ofe.org

I nearly cried when dstarner98@aasaa.ofe.org said:

>Actually, it rather annoyed me to find it in all caps. I typed into the
>program with initial caps for a reason.

It's easy to change (generically even).

>> I understand gdb can do something similar, but debuggers are a poor
>> substitute for understanding the code.

>How does this help you understand the code? 

Not enumeration strings in particular, but debuggers in general.  I always
found that most of the 'a-ha' moments while using a debugger were related
coming to a sudden understanding of what the code was trying to do.

If you eliminate the debugger, then you're forced to start with this
understanding.  I think that's profitable.  If I let myself run to gdb
every time something goes wrong, then I'll be forever patching symptoms
instead of causes, and it will probably take longer to sort things
out anyway.

My debugging tools are a trace, Emacs and a nice stout.  Actually, the stout
is optional, but hey, the first one doesn't hurt.  Saying no to the second
hurts a _lot_ though.

First, look the code.  If that doesn't help, follow the trace.  If it still
doesn't help, drink the stout and repeat.

>Yes, if you added a default case at the end of the switch statement. The
>array is a totally different issue - a valid point to complain about.

That's a run-time diagnostic, isn't it?

>If it is just something I toss into a program and don't care how it
>looks or runs, just that it does, that's what I call a quick'n'dirty
>hack. YMMV

I care deeply how it looks -- I want it to look like an enumeration literal.
And it's not just tossed in, it's carefully placed to extract the maximum
information about the state of the process.

Well, in an ideal world, anyway.

>No, it just means that a C enum is not quite the same abstraction as an
>Ada enum. 

It looks like it's not an abstraction at all, just a different way of
denoting an int.  Then again, most things in C are different ways of
denoting an int :)

Fraser.




  parent reply	other threads:[~1999-03-04  0:00 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-02  0:00 Linux World Richard D Riehle
1999-03-02  0:00 ` fraser
1999-03-02  0:00   ` Printing Enum Variable " David Starner
1999-03-03  0:00     ` Fraser Wilson
1999-03-03  0:00       ` David Starner
1999-03-04  0:00         ` Magnus Larsson
1999-03-03  0:00           ` Hans Marqvardsen
1999-03-04  0:00             ` Nick Roberts
1999-03-04  0:00             ` robert_dewar
1999-03-04  0:00               ` Hans Marqvardsen
1999-03-05  0:00                 ` Larry Kilgallen
1999-03-05  0:00                 ` dewar
1999-03-05  0:00                   ` David Botton
1999-03-05  0:00                     ` robert_dewar
1999-03-04  0:00               ` Hans Marqvardsen
1999-03-05  0:00                 ` dewar
1999-03-07  0:00                   ` Hans Marqvardsen
1999-03-03  0:00           ` Printing Enum Variable Re: Linux World (Correction) Hans Marqvardsen
1999-03-04  0:00         ` fraser [this message]
1999-03-05  0:00           ` Printing Enum Variable Re: Linux World Nick Roberts
1999-03-05  0:00             ` fraser
1999-03-04  0:00         ` Richard D Riehle
1999-03-04  0:00         ` robert_dewar
1999-03-04  0:00         ` Richard D Riehle
1999-03-03  0:00     ` Larry Kilgallen
1999-03-03  0:00       ` Nick Roberts
1999-03-03  0:00         ` David Starner
1999-03-03  0:00     ` fraser
1999-03-03  0:00       ` David Starner
1999-03-03  0:00         ` Samuel T. Harris
1999-03-03  0:00         ` fraser
1999-03-04  0:00         ` dennison
1999-03-04  0:00           ` Ehud Lamm
1999-03-04  0:00         ` robert_dewar
1999-03-03  0:00           ` David Starner
1999-03-04  0:00             ` Samuel Mize
1999-03-04  0:00               ` Samuel Mize
1999-03-05  0:00                 ` Robert A Duff
1999-03-05  0:00               ` Robert A Duff
1999-03-07  0:00               ` Florian Weimer
1999-03-07  0:00                 ` Michael Young
1999-03-07  0:00                   ` Matthew Heaney
1999-03-08  0:00                     ` Michael Young
1999-03-08  0:00                       ` Matthew Heaney
1999-03-07  0:00                   ` Larry Kilgallen
1999-03-07  0:00                     ` Michael Young
1999-03-08  0:00                       ` robert_dewar
1999-03-08  0:00                         ` Richard D Riehle
1999-03-09  0:00                           ` Michael Young
1999-03-09  0:00                             ` Larry Kilgallen
1999-03-09  0:00                               ` billy
1999-03-10  0:00                                 ` robert_dewar
1999-03-10  0:00                                   ` Dale Stanbrough
1999-03-10  0:00                                     ` Pascal Obry
1999-03-10  0:00                                     ` Richard D Riehle
1999-03-10  0:00                                     ` dennison
1999-03-10  0:00                                       ` bob
1999-03-10  0:00                                         ` Mike Silva
1999-03-10  0:00                                           ` dennison
1999-03-10  0:00                                           ` Nick Roberts
1999-03-10  0:00                                 ` Pascal Obry
1999-03-09  0:00                               ` Michael Young
1999-03-10  0:00                                 ` Mike Silva
     [not found]                               ` <7 <7c58qa$b6b$1@cf01.edf.fr>
1999-03-10  0:00                                 ` fraser
     [not found]                               ` <7c4ru6$e45$1@remarq.com>
1999-03-10  0:00                                 ` fraser
     [not found]                             ` <1999Mar9.131659. <dale-1003991644340001@r1021c-07.ppp.cs.rmit.edu.au>
1999-03-10  0:00                               ` Larry Kilgallen
1999-03-08  0:00                       ` Larry Kilgallen
1999-03-08  0:00                         ` robert_dewar
1999-03-08  0:00                       ` Florian Weimer
1999-03-04  0:00             ` robert_dewar
1999-03-04  0:00           ` Ehud Lamm
1999-03-05  0:00             ` Richard D Riehle
1999-03-05  0:00               ` Nick Roberts
1999-03-06  0:00                 ` Ehud Lamm
1999-03-06  0:00                   ` robert_dewar
1999-03-06  0:00                     ` Ehud Lamm
1999-03-06  0:00                     ` Larry Kilgallen
1999-03-06  0:00                       ` Dave Taylor
1999-03-06  0:00                         ` Bruce or Tracy
replies disabled

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