0

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.

Rounin
  • 275
  • 1
  • 10
  • 7
    This is the first time I encountered the ⎋ symbol in my fourty-odd years. Don't assume your audience knows what is means and associates the term "escape" with leaving off a namespace prefix. – Bart van Ingen Schenau May 02 '20 at 15:20
  • Sure thing. You're right. I'm not about to make any assumptions. I will properly explain in the documentation what `⎋` means and how to use it - I just want to be certain before I adopt it that I'm not doing something ignorant and conflating two separate homographs from two different contexts. – Rounin May 02 '20 at 15:24
  • 3
    I would say the escape key (and its context-dependent function) and an escape character in a string literal in a programming language (which has never been associated with the escape key) are distinct concepts. Also, I've never seen your symbol used to represent the escape key in any setting. I would avoid unconventional ideographs unless either they are obvious, or else you can expect your users to invest significant effort in learning and applying them - if you are writing documentation which itself is supposed to be explanatory, do not use unfamiliar ideographs as part of the explanation. – Steve May 02 '20 at 16:13
  • Thanks @Steve - that's thoughtful input. I appreciate it. I'd want to add that when using the CMS it's _not recommended at all_ to drop a namespace prefix. For the longest time it's not even been possible. It occurs to me now there might be very exceptional circumstances when a user may wish to override the default behaviour - and this is what I'm working on here. But I don't want it to be effortless. I want it to be at least a moderate PITA, so that users don't pick up (and worse, teach others) lazy bad habits where they keep dropping namespace prefixes instead of working within namespaces. – Rounin May 02 '20 at 16:25
  • 1
    @Steve Browsing Wikipedia, I don't agree with "never been associated" - the concept of the reserved Escape Character in ASCII (code 27) is very much related to the more general concept of "reserved character to give following character or sequence a special meaning". It's true that the Escape key is now often used for other purposes (exit, show menu, etc), but the name is definitely connected. (I agree with the rest of your comment, but it should be in an answer so it can be improved and upvoted properly.) – IMSoP May 02 '20 at 16:29
  • 1
    @Rounin, if the only purpose of using this ideograph is to try and make your users pay a tax for taking an easy option, then I'd suggest it will probably fail on two fronts. Firstly, the tax is front-loaded (rather than per-use) so it's fully paid once users understand what it does. Secondly, if it genuinely makes some things easier, then the tax is worth paying. Thirdly, the bad attitudes such thinking will engender amongst the users if revealed or inferred will be bad for motivation and compliance - it's like dealing with some running down the corridor by attaching leg irons to everyone. – Steve May 02 '20 at 16:38
  • Hehe. Yes. Food for thought, @Steve. Thanks. I'm regarding this tool as similar to `!important` in CSS. It really shouldn't be used - except in very exceptional circumstances. – Rounin May 02 '20 at 16:48
  • 1
    @IMSoP, the underlying etymology or metaphor is related, but by that logic you could expect to write in the newspaper about prisoners escaping jail as a "prison ⎋" - you know, because of the etymological link. The escape key has never been used to enter an *escape character* - even in Ascii, it was an unprintable control code - and the ideograph ⎋ does not (by any widely-accepted usage) represent the word escape or the key escape. – Steve May 02 '20 at 16:56
  • @Steve I agree that ⎋ is widely unrecognised, so let's leave that aside. However, it's nonsense to say that backslash escapes are no more related to the escape key than they are to the phrase "prison escape". Wikipedia's [escape character](https://en.wikipedia.org/wiki/Escape_character) article covers both printable and non-printable escape characters (or "control codes", if you prefer that term to "non-printable character"), and ends up with a pretty clear definition that covers both. – IMSoP May 02 '20 at 17:05
  • @IMSoP, that's my point, backslash escapes are not and have never been related to the escape key. The escape key has never, at least by any standard, rendered any printable character, let alone a printable escape character. Drawing any analogy between how and why a user enters an escape character on screen, and the technical details of how for example antique hardware like a teleprinter was controlled, is far too remote in my view. – Steve May 02 '20 at 17:37
  • @Steve The escape key did, and continues to, enter an "escape character". It happens to be a non-printable one, used in the context of ASCII-based terminals (or, these days, terminal emulators and terminal-derived software). In other contexts, the backslash key is used to enter an escape character, because those contexts define ASCII (or Unicode) 92 rather than 27 as the prefix for escape sequences. So "backslash escape" and "escape key" are both directly connected to the concept of "escape character"; no "analogy" needed, they're doing exactly the same thing. – IMSoP May 02 '20 at 17:46
  • @IMSoP, I don't deny the connection, I merely insist it is *too remote*. The average user understands entering text and controlling the computer as being fundamentally different operations - as different as speaking on the phone and dialling it. Entering *escape characters* is a way of modifying the meaning of what is written, which the computer translates. You can enter escape characters on paper. Pressing the escape key is not modifying the meaning of what is written, or translating writing - it's not even a form writing *at all*, it is intrinsically connected to controling the computer. – Steve May 02 '20 at 18:29

3 Answers3

2

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.

Martin Maat
  • 18,218
  • 3
  • 30
  • 57
  • Aha. So both uses of _"escape"_ in programming _do_ both have the same original root. Greatly appreciated - thank you. – Rounin May 02 '20 at 16:35
  • 1
    @Rounin Escape just means "to break out" (of anything) and the symbol you mentioned sure expresses that nicely. Unicode however was not even a thought until 1987. The terminal keyboards we talked about and the ASCII character ESC are much older than that. Again, use whatever symbol makes sense and do not try to align with some meaningless "standard" from another era that your users are likely not aware of anyway. – Martin Maat May 02 '20 at 17:19
2

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 ⛝

IMSoP
  • 5,722
  • 1
  • 21
  • 26
  • Brilliant. You answered my question at the top _and_ you identified my underlying issue so well that, taking note of your points, I was encouraged to adopt a completely new (and arguably much better) approach. – Rounin May 02 '20 at 17:21
  • I just wanted to say that "exception to the normal rule" is not a distinct concept, and that it covers both "give a special meaning" and "suppress a special meaning". E.g. (1) in string literals - `"text\n"`: normal rule: interpret n as 'n', exception: interpret as newline; (2) in a regex - `2\+3`: normal rule: + means match prev character one or more times, exception: match the '+' character. – Filip Milovanović May 03 '20 at 16:06
  • @FilipMilovanović All escapes are exceptions to some rule, but not all exceptions to a rule are escapes. – IMSoP May 04 '20 at 08:09
1

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'›
Rounin
  • 275
  • 1
  • 10