{"id":2588,"date":"2026-11-10T08:03:55","date_gmt":"2026-11-10T08:03:55","guid":{"rendered":"https:\/\/wiki.designcorner.co.ke\/?dc_term=magic-number"},"modified":"2026-11-10T08:03:55","modified_gmt":"2026-11-10T08:03:55","slug":"magic-number","status":"publish","type":"dc_term","link":"https:\/\/wiki.designcorner.co.ke\/?dc_term=magic-number","title":{"rendered":"Magic Number"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What it is<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Many file types begin with specific bytes that tell programs what they are, for example PDF files begin with %PDF. In code, an unexplained number is also called a magic number and is bad practice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why it matters for your business<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It helps programs recognise files correctly and warns developers about unclear code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Real-world example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A tool recognises a renamed file as a PDF because of its first bytes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Design Corner tip<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ask developers to replace unexplained numbers in code with named settings.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>A fixed number used in code or at the start of a file to identify its type or purpose.<\/p>\n","protected":false},"featured_media":0,"template":"","dc_letter":[18],"dc_topic":[34],"class_list":["post-2588","dc_term","type-dc_term","status-publish","hentry","dc_letter-m","dc_topic-software-and-development"],"_links":{"self":[{"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=\/wp\/v2\/dc_term\/2588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=\/wp\/v2\/dc_term"}],"about":[{"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=\/wp\/v2\/types\/dc_term"}],"version-history":[{"count":0,"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=\/wp\/v2\/dc_term\/2588\/revisions"}],"wp:attachment":[{"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2588"}],"wp:term":[{"taxonomy":"dc_letter","embeddable":true,"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=%2Fwp%2Fv2%2Fdc_letter&post=2588"},{"taxonomy":"dc_topic","embeddable":true,"href":"https:\/\/wiki.designcorner.co.ke\/index.php?rest_route=%2Fwp%2Fv2%2Fdc_topic&post=2588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}