What are magic numbers and why do some consider them bad?

However magic numbers are also sometimes used for in-memory data structures, like ioctl() calls. A quick check of the magic number before processing the file or data structure allows one to signal errors early, rather than schlep all the way through potentially lengthy processing in order to announce that the input was complete balderdash.

Read More