Wednesday, December 1, 2010

Magic Numbers

A a magic number is an undocumented number used in a program.

It is better to use a const with a descriptive name, so that it is apparent to maintainers what the number means, and also allows a change in one place to be reflected in several places.

No comments:

Post a Comment