From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0d68c502c0ae6 X-Google-Attributes: gid103376,public From: fraser@sinopsis.com Subject: Re: Printing Enum Variable Re: Linux World Date: 1999/03/04 Message-ID: <7bmua7$qg9$1@remarQ.com>#1/1 X-Deja-AN: 451302271 References: <7bfc2n$jl9@dfw-ixnews5.ix.netcom.com> <36DCAC1F.430E2C5E@aasaa.ofe.org> <7bk5c2$8ge$1@remarQ.com> <36DDA9BA.E005E578@aasaa.ofe.org> X-Complaints-To: newsabuse@remarQ.com X-Trace: 920583303 KZBGBQC4S164892E1C usenet76.supernews.com Organization: Vegetarian Ada Programmers Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-03-04T00:00:00+00:00 List-Id: 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.