enum's are very nice, they make organizing and indexing into complicated arrays painless, and they make the code a little more logical for other readers.
but what im curious about is: what would any of you say would be considered using too many enumerators?
Normally it is the case of not enough enums and too many #defines. I've actually run out of space for #defines on two projects: one on RMX and one on Windows but I've never run out of space on enums yet. Mind you - they were fairly big projects in the late-80s early-90s when 4Mb was a lot of memory.
ive started a project in which i already have three enums that average 12 symbols. its so much easier with them, but you know what they say about too much of a good thing.
but the latter has benefits - you know it is Dirn or Posn. I always have a Max so I can use it in loops and arrays. I always find enums better than #defines because I can see what they are in the debugger. Problem is getting too comfortable with enums and then having to go to a language like Java which doesn't have them (doesn't have #defines either). You have to think really hard about how to code something.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.