On 18 September 2015 01:15:43 BST, Bob Weinand <bobw...@hotmail.com> wrote:
>The reason it is not an associative array is that the names are not
>important.
...
>You never should *rely* on the ordinal value of the enum for anything.

I feel like I'm missing something here. In my mind, the only absolute universal 
about all enum implementations is that you refer to values by constant names - 
e.g. Weekdays::SUNDAY. The name 'SUNDAY' is as fundamental and unchanging as 
the name 'Weekdays'.

We rely on names to reference classes and functions all the time, and to 
serialize properties of an object; so what is it about enums that makes having 
an integer accessible so important?

I note that Java does supply an ordinal(), but the docs say you should 
basically never use it.

Regards,
-- 
Rowan Collins
[IMSoP]


Reply via email to