enums

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Jul 29 17:32:36 AEST 1988


In article <31416 at cca.CCA.COM> alex at CCA.CCA.COM (Alexis Layton) writes:
>To jump into this fray, I think I'd have to agree with Henry.  Enums are
>completely superfluous if they do not provide both type-checking and better
>storage control.

No; they can materially aid in debugging.  This was impressed on me
earlier this week when I ran "dmdebug" in my terminal to track down
an obsucre problem I was having with "sam"'s terminal part.  Rob had
written "sam" using enums where most of us would have used #defined
manifest constant symbols.  Because this tied a name to the numeric
value, the debugger was able to show the symbolic names of the
constants.  That was very helpful..



More information about the Comp.lang.c mailing list