There are a few naming conventions that handle mostly the syntactic part of structure names, e.g. Google's JSON style guide is great, with a few references to semantics [1]. Dart's style guide adds a few more guideline for half-semantics, e.g. how to handle abbreviations [2].<p><pre><code> [1] https://google.github.io/styleguide/jsoncstyleguide.xml#Property_Name_Format
[2] https://www.dartlang.org/guides/language/effective-dart/style
</code></pre>
Are there guides that target the semantic naming of fields?<p>For example, I'm running a web scraper, and I extract some information out of it. I have about 90% content that I keep as-is, and 10% that I further parse and classify. I have two examples:<p>First, let's say it is some kind of a type (or class, or kind, or category). How would you name (a) the raw/orignal text (that is on the downloaded HTML page), and how would you name the (b) parsed identifier (which is internal to the parser application). E.g. raw text may be "Computer- and IT-Accessories", and your parsed identifier is "computer-accessories". Some alternatives:<p><pre><code> (a): type, rawType, typeRaw, typeOriginal, sourceType, ...
(b): type, parsedType, typeParsed, typeCode, ...
</code></pre>
Another example is an address line. The (a) original text content could be a single string that has the parts in any order (e.g. city, street, country), while the (b) parsed address should be a structure that has something like {"city": "...", "countryCode": "...", "street": "...", ...}.<p><pre><code> (a): address, rawAddress, addressRaw, sourceAddress, ...
(b): address, parsedAddress, addressParsed, ...
</code></pre>
Which combination would you choose and why?