{"id":1645,"date":"2026-01-21T02:21:34","date_gmt":"2026-01-21T09:21:34","guid":{"rendered":"https:\/\/jaredrobinson.com\/blog\/?p=1645"},"modified":"2026-01-21T02:22:28","modified_gmt":"2026-01-21T09:22:28","slug":"standardized-naming-data-typing-for-integrated-loosely-coupled-systems","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/standardized-naming-data-typing-for-integrated-loosely-coupled-systems\/","title":{"rendered":"Standardized naming &amp; data typing for integrated &amp; loosely coupled systems"},"content":{"rendered":"\n<p>When working on a project with dozens of engineers (some of whom come and go) over the span of a decade, it becomes apparent that not everyone thinks the same, names variables the same that cross system boundaries, or uses data types consistently.<br><br>Yet converging on a standard is important so that &#8220;downstream&#8221; consumers of the data can interpret the data consistently, accurately, without as much special case code.<br><br>That may sound abstract, so I will give some context and concrete examples. The system may look something like the following, at a high level:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hubs, Cameras &amp; IoT sensors in millions of homes or businesses, reporting in to a centralized set of servers. The devices have software written in Python, C, C++, Rust and bash.<\/li>\n\n\n\n<li>Servers that store the data &amp; provide APIs for Smarphone apps &amp; other business stakeholders &#8212; service tools, inventory control, account management, etc. The database could be a document store without a formal schema or common data types.<\/li>\n\n\n\n<li>The server farm consists of dozens or even hundreds of microservices,, many of which need to understand the data.<\/li>\n\n\n\n<li>A data lake that replicates the data and allows data analysts to do their thing<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s say that we want to report device status &#8212; which could include whether the device is online or offline. What do we name it? Is it a boolean or a multi-state with states of Unknown, Initializing, Offline and Online? Do we allow booleans to be represented as integers? With a variety of different engineers, we could end up all over the place with naming and types &#8212; each device could be arrive with a different set of choices.<\/p>\n\n\n\n<p>If all of the code is &#8220;owned&#8221; by one organization, it is helpful if there&#8217;s consistency &#8212; it helps with understanding, consistent interpretation of the data, maintenance, and less necessity for special casing.<\/p>\n\n\n\n<p>Imagine if an Android app  needs to present a list view of the online status of all devices, and it has to cycle through logic to handle different names for each device type?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Loop over a list of all devices...\nIf device is camera_type_1, retrieve the \"online\" property as a boolean\nelse if the device is camera_device_2, retrieve the \"offline\" tri-state integer\nelse if the device is a thermostat, retrieve the \"node_online\" property as an integer that is essentially a boolean\n<\/code><\/pre>\n\n\n\n<p>And multiply that by many times, across iOS, web apps, many micro service and data analysts.<\/p>\n\n\n\n<p>I hope that it&#8217;s clear that engineering standards can ease the cost for downstream consumers of the data.<\/p>\n\n\n\n<p>But what if we have engineering standards, and no one reads them? There&#8217;s already enough other mandates, requirements and complexity for new-hires and even seasoned software developers.<\/p>\n\n\n\n<p>That&#8217;s where <strong>tools can help.<\/strong> Like running linters or build servers that do checking, we can implement our own tools that do the checking for us, so that we don&#8217;t have to know or remember every standard.<\/p>\n\n\n\n<p>What if not all of the code is &#8220;owned&#8221; by one organization, and devices must be integrated that use different standards? It can be more of a challenge.<\/p>\n\n\n\n<p>It may be possible for the ingress\/egress interaction points on the servers to <strong>translate<\/strong> to and from consistent naming standards and data representations. It can still be difficult when the data types and representations vary wildly. Sometimes, the desire to standardize results in data loss.<\/p>\n\n\n\n<p>Consider what happens when the servers expect temperature to be represented as Celsius as a integer and a device supports temperature as Fahrenheit as an integer: There&#8217;s going to be rounding errors going back and forth between the two. Other choices could include the server representing temperature as centi-Celsius, milli-Celsius integer, or as a float.<\/p>\n\n\n\n<p>What if the server stores temperature for different devices in Celsius, Centi-Celsius, Fahrenheit and Kelvin? We don&#8217;t want people incorrectly interpreting the data. It&#8217;s helpful to have a standard so that people know the units involved. Choices could include a suffix indicator, or an additional data point that tells the units.<\/p>\n\n\n\n<p>Working with 64 bit integers can be a challenge for web front-ends.  The device, the server and the database may all handle them adeptly, but what happens when we send one to a JavaScript front-end? It will break on large integer values &#8212; because JavaScript is limited to supporting integers of up to 53 bits, minus one (i.e. 2 ** 53 -1). It may be that losing precision is acceptable in some cases, and not in others, or that we want people to store them as a string. An engineering standard can help address this kind of challenge. <\/p>\n\n\n\n<p>What about MAC addresses? Could it be helpful for a standard to specify upper or lower case, and whether to use separators? It makes the job of downstream consumers easier.<\/p>\n\n\n\n<p>What about normalizing data and losing information? If data loss is a problem, could the server store the data in &#8220;raw&#8221; form, as sent by the device, and also support a normalized\/translated version? When translation fails, what value does the normalized\/translated data contain? E.g. a device sends an Ethernet MAC address of &#8220;uninitialized&#8221; or &#8220;driver error&#8221;, what do we do?<\/p>\n\n\n\n<p>Engineering standards can also define&#8230;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>default values. E.g. an uninitialized dBm signal strength&#8230; should it be 0 or negative 100 or negative 128? Many languages initialize variables to 0. A dBm of 0 is an impossibly powerful signal strength for in-home radios like WiFi devices.<\/li>\n\n\n\n<li>allowable ranges for temperature, signal strength, etc.<\/li>\n\n\n\n<li>preferred unit representations. E.g. dBm instead of a percentage.<\/li>\n\n\n\n<li>maximum length of strings, arrays, and maps.<\/li>\n\n\n\n<li>positive naming logic preferred over negative, where applicable. e.g. &#8220;online&#8221; instead of &#8220;offline&#8221;.<\/li>\n\n\n\n<li>and so much more.<\/li>\n<\/ol>\n\n\n\n<p>Thank you for reading. May your code wrangling and engineering standards go well.<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working on a project with dozens of engineers (some of whom come and go) over the span of a decade, it becomes apparent that not everyone thinks the same, names variables the same that cross system boundaries, or uses data types consistently. Yet converging on a standard is important so that &#8220;downstream&#8221; consumers of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/standardized-naming-data-typing-for-integrated-loosely-coupled-systems\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Standardized naming &amp; data typing for integrated &amp; loosely coupled systems&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-1645","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/1645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=1645"}],"version-history":[{"count":3,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/1645\/revisions"}],"predecessor-version":[{"id":1649,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/1645\/revisions\/1649"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=1645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=1645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=1645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}