Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The following C# code defines an enumeration.

enum MyEnum
        {
            alpha,
            beta,
            gamma,
            delta
        }

As a whole it is called an enumeration. What do you call each item? For example, what do you call the object that is beta?

share|improve this question
5  
You called it an element in your question. –  compman Mar 11 '11 at 19:20

5 Answers 5

up vote 11 down vote accepted

In computer programming, an enumerated type (also called enumeration or enum) is a data type consisting of a set of named values called elements, members or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value.

http://en.wikipedia.org/wiki/Enumerated_type

share|improve this answer

A member or element of MyEnum.

share|improve this answer
    
+1 I call it an element, which I believe is the "official" term for them, at least in C#. –  CodexArcanum Mar 11 '11 at 16:31

I simply call it a value of the enum, probably not very scientifically accurate but everyone understands it.

share|improve this answer

I would call it a constructor since enums basically are algebraic data types, although all constructors are nilladic in C# (as opposed to F# for example).

share|improve this answer
    
Hmmm... I know FP, but that doesn't sit right with me. An ADT can act as an enum, but I don't think it goes the other way. An enum is really a shorthand for a series of constants: you don't construct anything but they often have a directly mapped value underlying them. I don't find it wrong enough to warrant a -1 (it's an interesting thought at least) but I don't think it's very accurate. –  CodexArcanum Mar 11 '11 at 16:34

Item Just seems to come naturally.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.