[Issue 9924] Handy enum accessors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 11 19:47:45 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9924



--- Comment #5 from Walter Bright <bugzilla at digitalmars.com> 2013-04-11 19:47:44 PDT ---
For similar reasons, I don't see a compelling case for nextMember or
prevMember, either. I expect that an algorithm needing the next or previous
member would be looping over EnumMembers!E[i] anyway.

Such functions do not make code clearer, they obfuscate it behind trivia. The
user wastes time wondering "should I use first(), or [0]? Why are there both?
Is there a difference?" The documentation fills up with this pointless
ephemera.

A well designed interface should have a *minimum* of concepts and methods. They
should ideally all be orthogonal, with zero overlap.

I don't know Ada, but I suspect it has these methods because it does not have
the [i] way of getting at enum members.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list