Magic Number (programming)

Magic Number (programming)

In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:

  • A constant numerical or text value used to identify a file format or protocol; for files, see List of file signatures
  • Distinctive unique values that are unlikely to be mistaken for other meanings (e.g., Globally Unique Identifiers)
  • Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants

Read more about Magic Number (programming):  Unnamed Numerical Constants, Magic GUIDs, Magic Debug Values

Famous quotes containing the words magic and/or number:

    “I revere the memory of Mr. F. as an estimable man and most indulgent husband, only necessary to mention Asparagus and it appeared or to hint at any little delicate thing to drink and it came like magic in a pint bottle; it was not ecstasy but it was comfort.”
    —Charles Dickens (1812–1870)

    “While I do not suggest that humanity will ever be able to dispense with its martyrs, I cannot avoid the suspicion that with a little more thought and a little less belief their number may be substantially reduced.”
    —J.B.S. (John Burdon Sanderson)