News for hackers. Stuff that matters.
Re:What is a magic number, and why is it bad? by dllthomas on Wednesday August 28, 2013 @12:22PM (#6290986)
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.
Re:What is a magic number, and why is it bad? by greenyoda on Wednesday August 28, 2013 @12:50PM (#6291149)
Unix even has "man 5 magic", which describes the format of the magic numbers file that the "file" command uses to determine the type of a file (executable, object code, shell script, etc.) from its first few characters.

My personal favorite magic numbers are the values that debuggers use to fill uninitialized memory, like 0xDEADBEEF, 0xBAADF00D, etc.

Wikipedia has a good article on magic numbers:

https://en.wikipedia.org/wiki/Magic_number_(programming)