{"id":12,"date":"2005-08-17T20:11:47","date_gmt":"2005-08-17T14:41:47","guid":{"rendered":"http:\/\/jrtwine.com\/blog\/?p=12"},"modified":"2006-01-19T11:37:46","modified_gmt":"2006-01-19T15:37:46","slug":"null-nul","status":"publish","type":"post","link":"https:\/\/jrtwine.com\/blog\/null-nul\/","title":{"rendered":"NULL != NUL"},"content":{"rendered":"<p>I continue to find it rather amusing that even (so-called) <em>experienced<\/em> developers will use fundamentally different concepts interchangeably, even after doing this for so long.<br \/>\n<br \/>\nFor example, I have seen documentation by developers that mention <code><strong>nul<\/strong><\/code> values in a database table, or worse yet, <code><strong>NULL<\/strong><\/code>-terminated strings, and <code><strong>NUL<\/strong><\/code> pointers.<br \/>\n<br \/>\nNow, some that simply <i>miss the point<\/i> will be saying something like: &#8220;In C++, <code><strong>NULL<\/strong><\/code> is zero, and the <code><strong>NUL<\/strong><\/code> ASCII code has a value of zero, so they are the <u>same thing<\/u>!&#8221;<br \/>\n<br \/>\n<b>Wrong.<\/b><br \/>\n<!--more-->&nbsp; The <i>values<\/i> of the two identifiers may be the same, but not their meanings, and thus, it is <b>inappropriate<\/b> to use them interchangeably.&nbsp; Here is an example.&nbsp; In the VC++ environment, the following identifiers are present:<\/p>\n<pre><strong>    NULL = 0\r\n    COLOR_SCROLLBAR = 0\r\n    MB_DEFBUTTON1 = 0\r\n    TRUE = 1\r\n    MB_OKCANCEL = 1\r\n    IDOK = 1\r\n    COLOR_BACKGROUND = 1<\/strong><\/pre>\n<p>But just because some of them have the <i>same value <\/i>does not mean that it is correct to do something like this:<\/p>\n<pre>    int iRet = <b>COLOR_SCROLLBAR<\/b>                                 \/\/ Initialize iRet To <i><strong>What<\/strong><\/i> Value?\r\n\r\n    iRet = ::MessageBox( \r\n        \"Please press [OK] to continue or [Cancel] to cancel the delete operation.\", \r\n        \"Please Confirm Delete\", <b>COLOR_BACKGROUND | NULL<\/b> );&nbsp;&nbsp;&nbsp; \/\/ <i><strong>What<\/strong><\/i> Kind Of MessageBox?\r\n    if( iRet == <b>TRUE<\/b> )                                         \/\/ <i><strong>What<\/strong><\/i> Button Are We Looking For?\r\n    {\r\n        \/\/ Do Delete Operation\r\n    }<\/pre>\n<p>According to the <i><strong>if the identifiers have the same value they mean the same thing<\/strong><\/i> argument, the code above is perfectly fine.&nbsp; Of course, as demonstrated above, that is a bullshit argument.&nbsp; After all, what would you think if you saw code written like that?  It would likely end up on <a href=\"http:\/\/www.thedailywtf.com\">The Daily WTF<\/a>.<br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-developing"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"James R. Twine\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/jrtwine.com\/blog\/null-nul\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"James R Twine Blog -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"NULL != NUL - James R Twine Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/jrtwine.com\/blog\/null-nul\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2005-08-17T14:41:47+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2006-01-19T15:37:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"NULL != NUL - James R Twine Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#blogposting\",\"name\":\"NULL != NUL - James R Twine Blog\",\"headline\":\"NULL != NUL\",\"author\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/author\\\/jtwine\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#organization\"},\"datePublished\":\"2005-08-17T20:11:47+00:00\",\"dateModified\":\"2006-01-19T11:37:46+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#webpage\"},\"articleSection\":\"Developing\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/category\\\/developing\\\/#listItem\",\"name\":\"Developing\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/category\\\/developing\\\/#listItem\",\"position\":2,\"name\":\"Developing\",\"item\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/category\\\/developing\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#listItem\",\"name\":\"NULL != NUL\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#listItem\",\"position\":3,\"name\":\"NULL != NUL\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/category\\\/developing\\\/#listItem\",\"name\":\"Developing\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#organization\",\"name\":\"James R Twine Blog\",\"url\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/author\\\/jtwine\\\/#author\",\"url\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/author\\\/jtwine\\\/\",\"name\":\"James R. Twine\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/77d36362e353ec1c88adc48b48055faee96497898a208d3a6a05897d4902e552?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"James R. Twine\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#webpage\",\"url\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/\",\"name\":\"NULL != NUL - James R Twine Blog\",\"description\":\"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/null-nul\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/author\\\/jtwine\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/author\\\/jtwine\\\/#author\"},\"datePublished\":\"2005-08-17T20:11:47+00:00\",\"dateModified\":\"2006-01-19T11:37:46+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/\",\"name\":\"James R Twine Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/jrtwine.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"NULL != NUL - James R Twine Blog","description":"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the","canonical_url":"https:\/\/jrtwine.com\/blog\/null-nul\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#blogposting","name":"NULL != NUL - James R Twine Blog","headline":"NULL != NUL","author":{"@id":"https:\/\/jrtwine.com\/blog\/author\/jtwine\/#author"},"publisher":{"@id":"https:\/\/jrtwine.com\/blog\/#organization"},"datePublished":"2005-08-17T20:11:47+00:00","dateModified":"2006-01-19T11:37:46+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#webpage"},"isPartOf":{"@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#webpage"},"articleSection":"Developing"},{"@type":"BreadcrumbList","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/jrtwine.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/category\/developing\/#listItem","name":"Developing"}},{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/category\/developing\/#listItem","position":2,"name":"Developing","item":"https:\/\/jrtwine.com\/blog\/category\/developing\/","nextItem":{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#listItem","name":"NULL != NUL"},"previousItem":{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#listItem","position":3,"name":"NULL != NUL","previousItem":{"@type":"ListItem","@id":"https:\/\/jrtwine.com\/blog\/category\/developing\/#listItem","name":"Developing"}}]},{"@type":"Organization","@id":"https:\/\/jrtwine.com\/blog\/#organization","name":"James R Twine Blog","url":"https:\/\/jrtwine.com\/blog\/"},{"@type":"Person","@id":"https:\/\/jrtwine.com\/blog\/author\/jtwine\/#author","url":"https:\/\/jrtwine.com\/blog\/author\/jtwine\/","name":"James R. Twine","image":{"@type":"ImageObject","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/77d36362e353ec1c88adc48b48055faee96497898a208d3a6a05897d4902e552?s=96&d=mm&r=g","width":96,"height":96,"caption":"James R. Twine"}},{"@type":"WebPage","@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#webpage","url":"https:\/\/jrtwine.com\/blog\/null-nul\/","name":"NULL != NUL - James R Twine Blog","description":"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/jrtwine.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/jrtwine.com\/blog\/null-nul\/#breadcrumblist"},"author":{"@id":"https:\/\/jrtwine.com\/blog\/author\/jtwine\/#author"},"creator":{"@id":"https:\/\/jrtwine.com\/blog\/author\/jtwine\/#author"},"datePublished":"2005-08-17T20:11:47+00:00","dateModified":"2006-01-19T11:37:46+00:00"},{"@type":"WebSite","@id":"https:\/\/jrtwine.com\/blog\/#website","url":"https:\/\/jrtwine.com\/blog\/","name":"James R Twine Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/jrtwine.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"James R Twine Blog -","og:type":"article","og:title":"NULL != NUL - James R Twine Blog","og:description":"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the","og:url":"https:\/\/jrtwine.com\/blog\/null-nul\/","article:published_time":"2005-08-17T14:41:47+00:00","article:modified_time":"2006-01-19T15:37:46+00:00","twitter:card":"summary_large_image","twitter:title":"NULL != NUL - James R Twine Blog","twitter:description":"I continue to find it rather amusing that even (so-called) experienced developers will use fundamentally different concepts interchangeably, even after doing this for so long. For example, I have seen documentation by developers that mention nul values in a database table, or worse yet, NULL-terminated strings, and NUL pointers. Now, some that simply miss the"},"aioseo_meta_data":{"post_id":"12","title":null,"description":null,"keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-09-17 06:42:52","updated":"2026-09-17 06:42:52"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/jrtwine.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/jrtwine.com\/blog\/category\/developing\/\" title=\"Developing\">Developing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tNULL != NUL\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/jrtwine.com\/blog\/"},{"label":"Developing","link":"https:\/\/jrtwine.com\/blog\/category\/developing\/"},{"label":"NULL != NUL","link":"https:\/\/jrtwine.com\/blog\/null-nul\/"}],"_links":{"self":[{"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jrtwine.com\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}