In computer programming, deep magic refers to techniques that are not widely known, and may be deliberately kept secret. The number of such techniques has arguably decreased in recent years, especially in the field of cryptography, many aspects of which are now open to public scrutiny. The Jargon File makes a distinction between deep magic, which refers to (code based on) esoteric theoretical knowledge; black magic, which refers to (code based on) techniques that appear to work but which lack a theoretical explanation' and heavy wizardry, which refers to (code based on) obscure or undocumented intricacies of particular hardware or software. All three terms can appear in source code comments of the form:
- Deep magic begins here...
One example where deep magic is somewhat infamous is Microsoft's Windows operating system and associated Microsoft programs, which are known for frequently using undocumented APIs (even inside the operating system, as seen in source from the leaked Windows 2000 source code) in order to gain a speed boost. In fiction, the term comes from The Lion, the Witch and the Wardrobe, the first book in C.S. Lewis's The Chronicles of Narnia, which describes ancient laws and codes as "deep magic from the beginning of time." It is also the name of an e-zine based on high fantasy and science fiction inspired by Lewis's work. Many programmers have been influenced by the writings of Arthur C. Clarke, who said, "Any sufficiently advanced technology is indistinguishable from magic." Such technology may be termed "Advanced Magic". See: Clarke's three laws.


