<?xml version="1.0"?>
<?xml-stylesheet href="/transform" type="text/xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bs="http://purl.org/ontology/bibo/status/" xmlns:ci="https://vocab.methodandstructure.com/content-inventory#" xmlns:dct="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" lang="en" prefix="bibo: http://purl.org/ontology/bibo/ bs: http://purl.org/ontology/bibo/status/ ci: https://vocab.methodandstructure.com/content-inventory# dct: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# xhv: http://www.w3.org/1999/xhtml/vocab# xsd: http://www.w3.org/2001/XMLSchema#" vocab="http://www.w3.org/1999/xhtml/vocab#" xml:lang="en">
  <head>
    <title property="dct:title">Hyphen vs. Underscore</title>
    <base href="https://doriantaylor.com/policy/hyphen-vs-underscore"/>
    <link href="../document-stats#E7kAES4QmWvmmwTLH5pbSI" rev="ci:document"/>
    <link href="../elsewhere" rel="alternate bookmark" title="Elsewhere"/>
    <link href="../this-site" rel="alternate index" title="This Site"/>
    <link href="http://purl.org/ontology/bibo/status/published" rel="bibo:status"/>
    <link href="" rel="ci:canonical" title="Hyphen vs. Underscore"/>
    <link href="../lexicon/#EzqXIsriaILFcWjXdS7FbI" rel="dct:audience" title="Software Developer"/>
    <link href="../person/dorian-taylor#me" rel="dct:creator" title="Dorian Taylor"/>
    <link href="other-non-alpha-numeric-characters-in-http-urls" rel="dct:references next" title="Other Non-Alpha-Numeric Characters in HTTP URLs"/>
    <link href="domain-name-recommendations" rel="dct:references prev" title="Domain Name Recommendations"/>
    <link href="uri-syntax-constraints" rel="dct:references up" title="URI Syntax Constraints"/>
    <link href="../lexicon/#EnewYu-MeZVXNc97q_-jAI" rel="dct:subject" title="Web Development"/>
    <link href="../person/dorian-taylor" rel="meta" title="Who I Am"/>
    <link about="../" href="../3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="../" href="../f07f5044-01bc-472d-9079-9b07771b731c" rel="alternate" type="application/atom+xml"/>
    <link about="../" href="../this-site" rel="alternate"/>
    <link about="../" href="../elsewhere" rel="alternate"/>
    <link about="../" href="../e341ca62-0387-4cea-b69a-cdabc7656871" rel="alternate" type="application/atom+xml"/>
    <link about="../verso/" href="../3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="../verso/" href="../this-site" rel="alternate"/>
    <link about="../verso/" href="../elsewhere" rel="alternate"/>
    <meta content="hyphen-vs-underscore" datatype="xsd:token" property="ci:canonical-slug"/>
    <meta content="Hyphens-rule, underscores_drool." name="description" property="dct:abstract"/>
    <meta content="2008-06-15T06:52:34+00:00" datatype="xsd:dateTime" property="dct:created"/>
    <meta content="hyphen-vs-underscore" property="dct:identifier"/>
    <meta content="2008-07-30T23:12:27+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-07-31T00:06:15+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-07-31T02:16:54+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-10-09T02:02:01+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2009-03-04T00:43:00+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T04:18:52+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta about="../person/dorian-taylor#me" content="Dorian Taylor" name="author" property="foaf:name"/>
    <meta content="summary" name="twitter:card"/>
    <meta content="@doriantaylor" name="twitter:site"/>
    <meta content="Hyphen vs. Underscore" name="twitter:title"/>
    <meta content="Hyphens-rule, underscores_drool." name="twitter:description"/>
    <object>
      <nav>
        <ul>
          <li>
            <a href="domain-name-recommendations" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">Domain Name Recommendations</span>
            </a>
          </li>
          <li>
            <a href="other-non-alpha-numeric-characters-in-http-urls" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">Other Non-Alpha-Numeric Characters in HTTP URLs</span>
            </a>
          </li>
          <li>
            <a href="tongue-twisters-and-vocabulary-gaps-in-uris" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">Tongue-Twisters and Vocabulary Gaps in URIs</span>
            </a>
          </li>
          <li>
            <a href="uri-syntax-constraints" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">URI Syntax Constraints</span>
            </a>
          </li>
          <li>
            <a href="../document-stats#E7kAES4QmWvmmwTLH5pbSI" rev="ci:document" typeof="qb:Observation">
              <span>urn:uuid:ee40044b-8426-45af-89a6-c132c7e696d2</span>
            </a>
          </li>
        </ul>
      </nav>
    </object>
  </head>
  <body about="" id="EqQp5WFCk8IYorUYvEE4SL" typeof="bibo:Report">
    <p>The <a href="http://en.wikipedia.org/wiki/Underscore" title="Wikipedia &#x2014; Underscore" rel="dct:references">underscore</a> character <kbd>_</kbd> is another example of a technical work-around being carried forward long after the particular implementation constraint it was meant to circumvent has gone away. The underscore character was a key on typewriters used to write underlines over typed text &#x2014; the only available way to emphasize text at the time. When computers arrived on the scene, the character was quickly appropriated for use as a word <q>separator</q> for when one needed to increase the legibility of <em>identifiers</em> in computer programs without actually breaking the word into two. Indeed, the underscore is often treated as part of the the set of characters on computers considered <em>letters</em>, when the hyphen is not.</p>
    <p>Aside from being laborious both to <em title="hold down Shift and STRETCH!">type</em> and to <em title="Underline? Underscore? What is that thing called anyway?">say</em>, <span title="Baby Boomers">anyone not a touch typist and/or requisite of bifocals</span> is going to have trouble identifying the underscore character on the keyboard. On the opposite end of the computer expertise spectrum, <em>kill-word</em> key combinations like <kbd title="Bourne Shell">Control+W</kbd>, <kbd title="Windows">Control+Backspace</kbd> and <kbd title="Macintosh">Option+Backspace</kbd> often don't behave consistently <span title="or ever.">when underscores are involved</span>.</p>
    <p>The solution here is to <strong>eradicate the underscore</strong> from all customer-facing <em>identifiers</em>. This includes <a href="../lexicon/uniform-resource-identifier" title="Uniform Resource Identifier" rel="dct:references">URI</a>s and e-mail addresses and may well extend to <acronym title="Application Programming Interface">API</acronym> verbs, <acronym title="Extensible Markup Language">XML</acronym> element and attribute names, <acronym title="Cascading Style Sheets">CSS</acronym> class names, et cetera. By extension, I recommend the complete ban of underscores from all text within a given organization that is not part of a programming language for which the use of underscores is a requirement of syntax or a well-established element of style, like <em>C</em> and its derivatives. The other exception, once again for programming and markup languages, would be in prefixing identifiers that would otherwise begin with a number and thus produce a syntax error.</p>
    <p>In <a href="../lexicon/uniform-resource-identifier" title="Uniform Resource Identifier" rel="dct:references">URI</a>s, the underscore character is <span title="despite this often being ignored">already illegal</span> in domain names, and for <acronym title="Hypertext Transfer Protocol">HTTP</acronym> <acronym title="Uniform Resource Locator">URL</acronym>s it is a trivial task to coerce typed underscores to hyphens by <em>redirecting</em> requests.</p>
  </body>
</html>
