In terms of coding practice, in what contexts are global constants preferred to enumeration and vice versa?
For example, let's say I needed a way to express a variety of tile sprites at a global scope. I could do...
const int TILE_RED = 0;
const int TILE_GREEN = 1;
const int TILE_BLUE = 2;
const int TILE_CENTER = 3;
const int TILE_TOP = 4;
const int TILE_TOPRIGHT = 5;
const int TILE_RIGHT = 6;
const int TILE_BOTTOMRIGHT = 7;
const int TILE_BOTTOM = 8;
const int TILE_BOTTOMLEFT = 9;
const int TILE_LEFT = 10;
const int TILE_TOPLEFT = 11;
or
enum Tile { TILE_RED, TILE_GREEN, TILE_BLUE, TILE_CENTER, TILE_TOP, TILE_TOPRIGHT
TILE_RIGHT, TILE_BOTTOMRIGHT, TILE_BOTTOM, TILE_BOTTOMLEFT, TILE_LEFT, TILE_TOPLEFT };
Obviously we prefer constants and enums to macros, but what about when it comes down to constants and enums? What situations prefer what? I read here that constant objects pose a small risk of making your program slower, but I'd like to hear others' thoughts.
I used this example in particular because it's a large set of related objects - the cat's pajamas for enumeration.