Note that there are some explanatory texts on larger screens.

plurals
  1. POBeginning variable names with the prefix 'the'
    primarykey
    data
    text
    <p>Okay, this one is pretty hard to google.</p> <p>Occasionally, I stumble upon code in any language that uses a naming convention where variable names start with the prefix 'the' under certain circumstances.</p> <p>I could not figure out, however, what these circumstances are. So my questions are:</p> <ol> <li><p>Is this convention common? Does it have a name?</p></li> <li><p>If 1) is still "ungoogleable": What are the principles behind this convention? What problems does it address? I would like to understand.</p></li> <li><p>If not covered by 1) and 2): Where does the convention come from? What are its origins? Is or was it connected to a specific programming language?</p></li> </ol> <p>Examples:</p> <ul> <li><p>From the Steinberg ASIO SDK 2.3, file asiodrivers.cpp, line 88:</p> <pre><code>extern IASIO* theAsioDriver; </code></pre> <p>where IASIO is an interface definition.</p></li> <li><p><a href="http://hl7api.sourceforge.net/base/apidocs/src-html/ca/uhn/hl7v2/util/StringUtil.html" rel="nofollow noreferrer">http://hl7api.sourceforge.net/base/apidocs/src-html/ca/uhn/hl7v2/util/StringUtil.html</a></p></li> <li><p><a href="http://xml.apache.org/xalan-c/apiDocs/classXStringAllocator.html" rel="nofollow noreferrer">http://xml.apache.org/xalan-c/apiDocs/classXStringAllocator.html</a></p></li> <li><p><a href="http://www.cplusplus.com/forum/beginner/65050/" rel="nofollow noreferrer">http://www.cplusplus.com/forum/beginner/65050/</a></p></li> <li><p><a href="http://www.cise.ufl.edu/~sahni/dsaac/enrich/c20/fold2.htm" rel="nofollow noreferrer">http://www.cise.ufl.edu/~sahni/dsaac/enrich/c20/fold2.htm</a></p></li> </ul> <p>I am hoping for some insight into why people do this. One example might be to tell parameters from members in setter/getter methods, but this choice of prefix seems random to me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload