Global Constants vs. Enumeration
<p>In terms of coding practice, in what contexts are global constants preferred to enumeration and vice versa? </p>

<p>For example, let's say I needed a way to express a variety of tile sprites at a global scope. I could do...</p>

<pre><code>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;
</code></pre>

<p>or</p>

<pre><code>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 };
</code></pre>

<p>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 <a href="http://www.embedded.com/story/OEG20011129S0065" rel="nofollow">here</a> that constant objects pose a small risk of making your program slower, but I'd like to hear others' thoughts. </p>

<p>I used this example in particular because it's a large set of related objects - the cat's pajamas for enumeration.</p>
