I just have a Numbers class I import into all my projects:<p>public final static int ZERO = 0;
public final static int ONE = 1;
public final static int TWO = 2;
public final static int THREE = 3;
public final static int FOUR = 4;
....<p>(jk)
The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant.<p>This also simplifies modifying the program, should the value of pi change.<p>-- Early FORTRAN manual for Xerox Computers
No one seems to be mentioning another use of the phrase "magic number" which isn't bad at all - numbers put in files to mark the file type. 0xCAFEBABE in java class files, for instance.
I'd have personally thought the number used in the fast inverse square root (<a href="http://en.wikipedia.org/wiki/Fast_inverse_square_root" rel="nofollow">http://en.wikipedia.org/wiki/Fast_inverse_square_root</a>) would qualify as a 'magic number', everything else is just a hardcoded value.
I find these a lot with CSS - banishing them seem to be a major goal of LESS, SASS etc.<p>They also seem to crop up too often in JS / JQuery, particularly the manipulation of CSS.. where do you folks tend to find them?
Also, it can be a good idea to yank out all of those into a separate config file. Although, it destroys locality, so it depends on the use case I guess.