Question

I know that:

and I also know that:

But are we using the same word "escape" in these two distinct contexts?

Or are "escape" (in escape character) and "escape" (in escape key) simply homographs with no meaningful connection apart from coincidental orthography?


Why am I asking this question?

I am writing some functionality (and some documentation) for a custom CMS and I would like to use the

symbol as a shorthand notation (within a namespace context where namespace prefixes are normally automatically applied) to mean:

don't use the namespace prefix here

That seems to correlate, approximately, with the definition of "escape" when we're talking about escape characters in HTML & CSS and the backslash escape character in Javascript.

But I'm less keen to use the:

character (conventionally used to denote the [ESC] key) for this purpose, if these two uses of the word escape are simply coincidental and don't have the same root.

Was it helpful?

Solution

The name of the escape key and the phrase "escape character" are certainly linked, but I think you are stretching the definition to cover your use case.

The "escape" key on keyboards is so called because it sent a reserved "escape character" to the connected terminal (if using ASCII, this would be character 27). That "escaped" from the normal input mode and gave special meaning to the following keypress or sequence.

Similarly, graphical "escape characters" within a markup language give a special meaning to (or, in some cases, suppress a special meaning from) the following character or sequence.

In your case, you seem to be using "escape" more broadly to mean "exception to the normal rule"; you're not giving the following character or sequence a special meaning, just marking a particular category of uses. I wouldn't associate that kind of exception with the word "escape" particularly.

On the other hand, I wouldn't associate the symbol ⎋ with the word "escape" either; if there are keyboards out there which use this symbol, I've never seen one. So if I saw it in your documentation, I'd just treat it as any other "dingbat" with no pre-conception of its meaning, and would rely on a meaning being prominently visible (e.g. in a footer on each page).

My only concern at that point would be that it's clearly legible - and clearly distinguishable from any text around it - in the typeface and size your documentation will be viewed with. I'd personally be inclined to pick something less "fiddly" - maybe something with a feeling of "crossed out", like ⧄ or ⛝

OTHER TIPS

A keyboard provides symbols. It is up to the software running on the computer to interpret them and respond with an action.

The original intent of the Escape key is basically the same as the purpose of escape characters like the \ in strings. It goes back to the days of the terminal when you entered characters directly into a process and sometimes needed to switch/redirect the stream to some other process or assign a different meaning to it. It was also used for printers telling that the next character was going to be a control character rather than a character to be printed. But none of that should matter to you, you should look at the symbolism of the key and ask whether it fits your purpose. The point is that the use of the key makes sense to the user of your application in a particular context.

Re-thinking my approach (included for the sake of completeness):

After reflecting on @Bart van Ingen Schenau's comment:

This is the first time I encountered the ⎋ symbol in my forty-odd years.

and on @IMSoP's thoughts:

  • I wouldn't associate the symbol ⎋ with the word "escape"
  • if I saw it in your documentation, I'd just treat it as any other "dingbat"
  • I'd [...] rely on a meaning being prominently visible
  • My [...] concern [...] would be that it's clearly legible
  • clearly distinguishable from any text around it

I've decided that:

is too obscure for adoption.

Not, least, because, as @IMSoP also points out:

In your case, you seem to be using "escape" more broadly to mean "exception to the normal rule"; you're not giving the following character or sequence a special meaning, just marking a particular category of uses. I wouldn't associate that kind of exception with the word "escape" particularly.

I think this nails the nagging doubts I was having. Not only is a little-known symbol, but the concept it denotes - possibly tangentially - might not even be the concept I'm looking for in this situation.

So, I've resolved to ditch my attempt to find a symbol which denotes the concept of "escape" and instead of looking for something which connotes negation (as in "don't use the namespace prefix here") I've opted for something that indicates a positive category:

{«GLOBAL»}

which indicates... [this query] references the Global Namespace.


Added (several weeks later):

I continued to work on the above as I realised that I would need something that would not only enable:

  • escaping from the current namespace to the global namespace

but also:

  • replacing the current namespace with another namespace

This eventually led me to put together something that looks more like a function, which uses Single Guillemets as unambiguous delimiters and has two parameters, the first indicating the replacement namespace and the second indicating the CSS selector to be escaped:

Example of escaping to the global namespace:

‹'«GLOBAL»', 'footer address p'›

Example of replacing current namespace with another namespace:

‹'«Scotia_Beauty:::SB_Translations::EN»', 'li strong'›
Licensed under: CC-BY-SA with attribution
scroll top