1880s: The Keyboard

As computer users, we likely spent most of our time interacting with a small, limited subset of all the buttons available to us. Telling a user that they have to memorize 100+ keyboard combinations is typically considered to be “bad design,” so it’s common to simplify as much as possible. This could involve providing virtual buttons for the users to click: clicking with the mouse if the user is on macOS, using the “left click” mouse button if the user is on Windows, or handling a “click” event if the user is using an iPhone/Android device.

As developers, we need to know how some of the details: and yes there do exist cases where you legitimately may be asked to memorize 100 combinations of keyboard clicks. Quick! What does ^ Ctrl + ⇧ Shift + V do in Microsoft Windows?1

This means we need to start with a Shared Language for what to call these things. How do you pronounce: `? What about ~? How about |? If you’re reading this online or have a keyboard nearby: take a minute to locate these three.

In principle: this book is aimed at teaching programming. In reality: we plan to teach you a small (but powerful) subset of English needed to interact with computers and technically-minded humans—if we also happen to teach you Python along the way, that will be a tremendous bonus.

A Finite Alphabet of Symbols

Let’s start with the lower register of the standard English QWERTY keyboard.2 We will skip the bottom rows since they are almost certainly manufacturer-dependant.

` 1 2 3 4 5 6 7 8 9 0 - = ← Backspace

Tab ↹ q w e r t y u i o p [ ] \

⇪ Caps Lock a s d f g h j k l ; ↵ Enter

⇧ Shift z x c v b n m , . / ⇧ Shift

Now the upper register, almost always activated using one of the ⇧ Shift keys.

~ ! @ # $ % ^ & * ( ) _ + ← Backspace

Tab ↹ Q W E R T Y U I O P { } |

⇪ Caps Lock A S D F G H J K L : ↵ Enter

⇧ Shift Z X C V B N M < > ? ⇧ Shift

Getting Acclimated

We assume some knowledge of typing, and from our experience teaching this course in the past: most students surveyed took a typing class in middle school or high school.

This experience informed us that people tend to be comfortable with the 26 keys representing the English alphabet. That is: a, b, c up through z and their upper-register counterparts. People’s experience falls off exponentially outside of these.

We think this is a natural side-effect of how written communication is taught. An estimated 99.9% (that we just made up) of all written communication in English can be done with just those 26 keys, ⇧ Shift, Space, ., ,, ?, :, and !. If you’ve done narrative writing, you hopefully met the two quotation marks: and . If you’re a total nerd for English orthography, you might be familiar with the semicolon ; and have a shortcut memorized for converting hyphens - into an em dash (—). If it had not been for social media sites adopting the symbols and breathing new meaning into them, it’s entirely possible that the at sign @ and pound sign # would have been absentmindedly pitched into the wastebin of stenographic history.

The remaining symbols tend to be there for historical reasons. Early programmers gave meaning to the symbols they had at their fingertips, and we’re still using them!

What you should get from this is an awareness that if we are working with code, we will likely encounter keyboard characters we are not very familiar with. These characters may have a different meaning from how you might more commonly use them in English, and they may even differ in use and meaning between programming languages. For example, we say the backtick ` symbol listed below is a LaTeX left quote. It is also how you create a template literal (or a formatting string) in JavaScript.

SymbolNameExample UsageOther Notes
`backtickLaTeX left quote, command substitutionThe backtick is sometimes used as a composition key for accented characters, like the accent grave in French.
!exclamation marknot
@at signDecorator
#pound sign, hashtagInline comment, markdown header
$dollar signsubshell, regex end-of-line
%percent signliteral substitution, modulo
^caretregex not
&ampersandboolean and
*asteriskmultiplication, glob, Kleene star, markdown emphasis
-hyphensubtraction, UNIX parameter flagFrequently called a “dash”
_underscoreprevious expression, ignored variable, match wildcard, separator character, private scoping, name mangler, dunder
+plus signaddition, Kleene plus
=equal signvariable assignment, equality check
()parentheses
[]brackets, “square brackets”
{}braces, “curly braces”
\backslash
/slash, forward slash
|pipeSTDOUT-STDIN redirection / “pipeline”
'quote, single quotestring type
"double quotestring type
:colon
;semicolon
,comma
.period, dot
<less-than sign
>greater-than signSTDOUT redirection
?question markternary operator

Footnotes

1

This is kind of a trick question. The combination ^ Ctrl + ⇧ Shift + V is usually called “paste without formatting.” The default ^ Ctrl + Vpaste” operation can include hidden characters that are not obvious to the user, but may include hidden characters that are not visible to the end user (for example: italics or boldface font). The “paste without formatting” operation aims to clear this out and instead paste information as plain text. However, shortcuts depend on the program you’re running. In Visual Studio Code, ^ Ctrl + ⇧ Shift + V runs the “Markdown: Open Preview” command by default.

2

If your machine was not produced in the United States, or if your operating system is configured for a language other than English (e.g. if you’re using a Chinese/Pinyin/Korean/other keyboard), then you may need to adjust some settings. (TODO: Can you give us some advice on what does or does not work? Alexander only knows English)