Keyboards & Command Line Interfaces: Crash Course Computer Science #22
Summary
TLDRCrashCourse计算机科学系列视频探讨了计算机的输入输出设备,这些设备提供了人与计算机之间的接口。视频回顾了早期机械和电子计算机使用物理控制如齿轮、旋钮和开关进行输入输出的历史。20世纪50年代,纸带和磁带的出现使得机械输入变得过时,而纸打印机和指示灯则用于输出和实时反馈。早期计算机的输入设计简单而强大,但对用户的易用性考虑较少。随着计算机变得更便宜且功能更强大,键盘成为了主要的输入设备,其设计基于打字机,尤其是1868年由Christopher Latham Sholes发明的现代打字机。尽管存在多种键盘布局,QWERTY布局因其商业成功而成为主流。视频还介绍了电传打字机(teletype machine)和命令行界面(CLI),这些在20世纪60年代和70年代是主要的计算机交互方式。尽管后来出现了基于屏幕的终端,命令行界面因其强大功能和编程的书面特性,至今仍被程序员广泛使用。此外,文本冒险游戏如Zork展示了即使在文本交互中,程序员也能创造出有趣的体验,这些游戏是现代多人在线角色扮演游戏的前身。
Takeaways
- 💻 计算机科学系列课程中讨论了输入输出,但主要是计算机内部不同部分之间的数据传输,如RAM到CPU的指令输入。
- 🖥️ 人机交互(HCI)是研究如何通过各种输入输出设备来实现人与计算机之间通信的领域。
- ⌨️ 早期计算机使用物理控制如齿轮、旋钮和开关进行输入输出,而程序和数据的输入通常是通过打孔卡片和磁带完成。
- 📝 在20世纪50年代之前,计算机的设计重点在于简单和鲁棒性,用户易用性是次要考虑因素。
- 🔍 打孔带是为了计算机易于读取而设计的,但这种设计并不适应人类的思维方式。
- 📐 20世纪50年代末,随着计算机规模的缩小和成本的降低,开始出现了人机交互的需求。
- 🔑 键盘成为了计算机的主要输入设备,其设计源自于打字机,尤其是1868年由Christopher Latham Sholes发明的现代打字机。
- 🌐 QWERTY键盘布局尽管存在多种变体,但因为学习成本和习惯问题,至今仍然被广泛使用。
- 📐 打字机的引入主要是为了提高文档的可读性和标准化,而不是为了提高速度。
- 🚀 通过十指打字法和不看键盘的触摸打字技术,打字速度得到了极大的提升。
- 📠 早期计算机使用电传打字机(teletype machine)作为输入输出设备,允许用户通过命令行界面与计算机交互。
- 📊 20世纪70年代,随着电视的大规模生产和处理器及内存技术的提升,屏幕开始取代电传打字机成为新的计算界面。
- 🎮 即使在只有文本交互的早期,程序员也开发了如Zork这样的交互式文本游戏,为后来的图形化多人在线角色扮演游戏(MMORPG)奠定了基础。
- 🔄 命令行界面虽然简单,但功能强大,至今仍然是编程和远程访问服务器的常用方式。
Q & A
计算机科学系列课程中,关于人类输入和计算机输出的讨论主要集中在哪些方面?
-在计算机科学系列课程中,关于人类输入和计算机输出的讨论主要集中在计算机不同部分之间的数据传输,如从RAM输出数据或向CPU输入指令,而关于来自人类的输入和计算机向人类提供信息的方式讨论较少。
人机交互(HCI)是什么?
-人机交互(HCI)是研究如何让计算机用户通过输入输出设备与计算机进行交流的领域。这些设备提供了人与计算机之间的接口,对于用户体验至关重要。
早期的机械和机电计算设备通常使用哪些物理控制进行输入和输出?
-早期的机械和机电计算设备通常使用齿轮、旋钮和开关等物理控制进行输入和输出,这几乎是人机交互的全部。
为什么在20世纪50年代之前,计算机输入被设计得尽可能简单和健壮?
-在20世纪50年代之前,计算机输入被设计得尽可能简单和健壮,是因为计算机的性能有限,需要优先考虑计算机的处理能力,而用户的便捷性和理解性则是次要的。
打孔带是如何帮助早期计算机编码指令和数据的?
-打孔带通过其连续性质易于机械处理,且其上的孔可以被机械或光学系统可靠地检测到,从而帮助早期计算机编码指令和数据。
为什么早期计算机通常不与人类进行交互式响应?
-早期计算机通常不与人类进行交互式响应,因为这些机器非常昂贵,通常不会等待人类输入命令或数据。一旦程序开始运行,它通常会一直运行直到结束。
20世纪50年代末,计算机输入方式发生了什么变化?
-20世纪50年代末,小型计算机开始变得足够便宜,使得人机交互成为可能,即人与计算机之间的双向交流。同时,大型计算机变得足够快速和复杂,能够支持多任务和多用户同时使用。
为什么键盘成为了计算机的主要输入设备?
-键盘成为了计算机的主要输入设备,因为它们是当时普遍使用的数据输入机制。打字机已经被使用了数百年,而克里斯托弗·拉瑟姆·肖尔斯在1868年发明了现代打字机,其设计被后续的竞争对手公司所模仿。
QWERTY键盘布局是如何普及的?
-QWERTY键盘布局因其商业成功而普及。尽管有许多替代的键盘布局被提出,但由于人们已经投入时间学习了QWERTY布局,他们不愿意学习新的东西,这就是经济学家所说的转换障碍或转换成本。
为什么早期计算机使用电传打字机(teletype machine)作为输入设备?
-早期计算机使用电传打字机作为输入设备,因为它们可以发送和接收文本,并且已经具有电子接口,容易被适配用于计算机。电传打字机允许用户通过打字来与计算机进行交互,这是一种简单直观的交互方式。
命令行界面(CLI)在20世纪80年代之前为何如此流行?
-命令行界面(CLI)在20世纪80年代之前之所以流行,是因为它们允许用户通过文本命令与计算机进行交互,这种方式简单、直接且功能强大。尽管只有文本交互,但程序员能够通过命令行界面完成各种复杂的任务。
为什么即使在今天,许多程序员仍然使用命令行界面?
-即使在今天,许多程序员仍然使用命令行界面,因为计算机编程很大程度上仍然是一个书面任务,命令行是一个自然且强大的界面。此外,命令行也是远程访问服务器等远端计算机的最常见方式。
Outlines
💻 计算机输入输出设备与人机交互
Carrie Anne在CrashCourse计算机科学系列中介绍了计算机的输入输出设备,以及它们如何作为人与计算机之间的接口。早期的机械和电子计算机主要通过物理控制如齿轮、旋钮和开关来实现输入输出,而数据输出通常打印到纸张上。20世纪50年代,机械输入被穿孔卡片和磁带等媒介上的程序和数据存储所取代。早期计算机对人类输入的概念非常简单,程序一旦启动就会运行直至结束,不与人类进行交互。然而,到了20世纪50年代末,计算机开始支持人机交互,键盘成为了主要的数据输入机制。QWERTY键盘布局因其商业成功而被广泛采用,尽管存在许多替代的键盘布局,但由于学习成本,人们更倾向于继续使用QWERTY布局。
🔠 打字机与计算机命令行界面的发展
随着打字机的普及,打字速度的提升成为了可能。Elizabeth Longley推广了十指打字法,而Frank Edward McGurrin通过自学掌握了不看键盘的触摸打字技术。这些进步极大提高了打字速度,使得专业打字员能够达到每分钟超过100字的速度。早期计算机采用了一种特殊的打字机——电传打字机,它可以通过电报线发送和接收文本。这些机器后来很容易地被适应为计算机使用,成为1960年代和1970年代常见的计算机接口。用户通过命令行界面与计算机进行交互,输入命令后计算机会以文本形式回复。命令行界面在1980年代之前一直是主要的人机交互形式。尽管计算机屏幕在1950年代就已经出现,但由于成本高昂和分辨率低,直到1970年代才经济可行地用屏幕替代了电传打字机。屏幕的引入使得文本交互更加快速和灵活。此外,早期的交互式文本电脑游戏,如1977年创建的Zork,要求玩家发挥想象力来可视化虚构世界。
🖥️ 现代操作系统中的命令行界面
即使在Windows、macOS或Linux等现代操作系统中,命令行界面仍然存在,可能是一些用户从未使用过的。用户可以通过在Windows搜索栏中输入'cmd'或在Mac上搜索Terminal来访问命令行界面。Zork等早期的文本冒险游戏后来发展成为多人游戏,称为MUD(多用户地下城),它们是今天图形化的MMORPG(大型多人在线角色扮演游戏)的前身。命令行界面虽然简单,但功能强大,计算机编程很大程度上仍然是书面任务,因此命令行是自然的选择。即使在今天,大多数程序员在工作中仍然使用命令行界面,它也是远程访问计算机(如不同国家的服务器)的常见方式。
Mindmap
Keywords
💡输入输出设备
💡人机交互
💡机械计算机
💡穿孔纸带
💡键盘
💡QWERTY布局
💡电传打字机
💡命令行界面
💡终端
💡文本冒险游戏
💡命令行
Highlights
计算机科学系列课程中讨论了输入输出,但主要关注计算机内部不同部件之间的数据传输,如RAM输出数据或CPU输入指令。
人机交互领域研究了如何通过各种输入输出设备实现人与计算机之间的通信。
早期机械和机电计算机使用物理控制进行输入输出,如齿轮、旋钮和开关。
第一台电子计算机,如巨人(Colossus)和ENIAC,使用大量机械控制面板和接线来配置。
穿孔卡片和磁带的出现使得机械输入过时,纸带打印机仍用于最终输出。
计算机输入的设计以简单和健壮为主,用户易用性是次要考虑。
打孔带设计易于计算机读取,但对人类来说并不直观。
20世纪50年代前,计算机对人类输入的概念非常简单,程序一旦启动就运行直到结束。
20世纪50年代末,小型计算机变得足够便宜,可以实现人机交互。
大型计算机变得足够快和复杂,可以支持多任务和分时系统。
计算机借用了当时普遍的数据输入机制——键盘。
克里斯托弗·拉瑟姆·肖尔斯在1868年发明了现代打字机,并采用了QWERTY键盘布局。
QWERTY键盘布局的商业成功导致了竞争对手公司复制其设计。
打字机的主要目的是为了提高文档的清晰度和标准化,而不是速度。
1880年左右,伊丽莎白·朗利推广了十指打字法,极大提高了打字速度。
早期计算机采用了一种特殊的打字机——电传打字机,用于电报。
命令行界面在20世纪60年代和70年代非常普遍,用户通过打字与计算机交互。
1970年代末,由于电视的大规模生产和处理器及内存的改进,屏幕成为了标准。
即使只有文本交互,程序员也找到了让事情变得有趣的方法,如早期的交互式文本游戏Zork。
命令行界面虽然简单,但非常强大,大多数程序员仍然使用命令行作为工作的一部分。
即使在今天,早期的进步仍然对计算产生影响,比如QWERTY键盘。
Transcripts
Hi, I’m Carrie Anne, and welcome to CrashCourse Computer Science!
We’ve talked a lot about inputs and outputs in this series, but they’ve mostly been
between different parts of a computer – like outputting data from RAM or inputting instructions
to a CPU.
We haven’t discussed much about inputs coming from humans.
We also haven’t learned how people get information out of a computer, other than by printing
or punching it onto paper.
Of course, there’s a wide variety of input and output devices that allow us users to
communicate with computers.
They provide an interface between human and computer.
And today, there’s a whole field of study called Human-Computer Interaction.
These interfaces are so fundamental to the user experience that they’re the focus of
the next few episodes.
INTRO
As we discussed at the very beginning of the series, the earliest mechanical and electro-mechanical
computing devices used physical controls for inputs and outputs, like gears, knobs and
switches, and this was pretty much the extent of the human interface.
Even the first electronic computers, like Colossus and ENIAC, were configured using
huge panels of mechanical controls and patch wires.
It could take weeks to enter in a single program, let alone run it, and to get data out after
running a program, results were most often printed to paper.
Paper printers were so useful that even Babbage designed one for his Difference Engine, and
that was in the 1820s!
However, by the 1950s, mechanical inputs were rendered obsolete by programs and data stored
entirely on mediums like punch cards and magnetic tape.
Paper printouts were still used for the final output, and huge banks of indicator lights
were developed to provide real time feedback while the program was in progress.
It’s important to recognize that computer input of this era was designed to be as simple
and robust as possible for computers.
Ease and understanding for users was a secondary concern.
Punch tape is a great example – this was explicitly designed to be easy for computers
to read.
The continuous nature of tape made it easy to handle mechanically, and the holes could
be reliably detected with a mechanical or optical system, which encoded instructions
and data.
But of course, humans don’t think in terms of little punched holes on strips of paper.
So, the burden was on programmers.
They had to spend the extra time and effort to convert their ideas and programs into a
language and a format that was easy for computers of the era to understand – often with the
help of additional staff and auxiliary devices.
It’s also important to note that early computers, basically pre-1950, had an extremely simple
notion of human input.
Yes, humans input programs and data into computers, but these machines generally didn’t respond
interactively to humans.
Once a program was started, it typically ran until it was finished.
That’s because these machines were way too expensive to be waiting around for humans
to type a command or enter data.
Any input needed for a computation was fed in at the same time as the program.
This started to change in the late 1950s.
On one hand, smaller-scale computers started to become cheap enough that it was feasible
to have a human-in-the loop; that is, a back and forth between human and computer.
And on the other hand, big fancy computers became fast and sophisticated enough to support
many programs and users at once, what were called multitasking and time-sharing systems.
But these computers needed a way to get input from users.
For this, computers borrowed the ubiquitous data entry mechanism of the era: keyboards.
At this point, typing machines had already been in use for a few centuries, but it was
Christopher Latham Sholes, who invented the modern typewriter in 1868.
It took until 1874 to refine the design and manufacture it, but it went on to be a commercial
success.
Sholes’ typewriter adopted an unusual keyboard layout that you know well – QWERTY – named
for the top-left row of letter keys.
There has been a lot of speculation as to why this design was used.
The most prevalent theory is that it put common letter pairings in English far apart to reduce
the likelihood of typebars jamming when entered in sequence.
It’s a convenient explanation, but it’s also probably false, or at least not the full
story.
In fact, QWERTY puts many common letter pairs together, like “TH” and “ER”.
And we know that Sholes and his team went through many iterations before arriving at
this iconic arrangement.
Regardless of the reason, the commercial success of Sholes’ typewriter meant the competitor
companies that soon followed duplicated his design.
Many alternative keyboard layouts have been proposed over the last century, claiming various
benefits.
But, once people had invested the time to learn QWERTY, they just didn't want to learn
something new.
This is what economists would call a switching barrier or switching cost.
And it’s for this very basic human reason that we still use QWERTY keyboards almost
a century and a half later!
I should mention that QWERTY isn’t universal.
There are many international variants, like the French AZERTY layout, or the QWERTZ layout
common in central Europe.
Interestingly, Sholes didn’t envision that typing would ever be faster than handwriting,
which is around 20 words per minute.
Typewriters were introduced chiefly for legibility and standardization of documents, not speed.
However, as they became standard equipment in offices, the desire for speedy typing grew,
and there were two big advances that unlocked typing’s true potential.
Around 1880, Elizabeth Longley, a teacher at the Cincinnati Shorthand and Type-Writer
Institute, started to promote ten-finger typing.
This required much less finger movement than hunt-and-peck, so it offered enhanced typing
speeds.
Then, a few years later, Frank Edward McGurrin, a federal court clerk in Salt Lake City, taught
himself to touch-type; as in, he didn’t need to look at the keys while typing.
In 1888, McGurrin won a highly publicized typing-speed contest, after which ten-finger,
touch-typing began to catch on.
Professional typists were soon able to achieve speeds upwards of 100 words per minute, much
faster than handwriting!
And nice and neat too!
So, humans are pretty good with typewriters, but we can’t just plunk down a typewriter
in front of a computer and have it type – they have no fingers!
Instead, early computers adapted a special type of typewriter that was used for telegraphs,
called a teletype machine.
These were electromechanically-augmented typewriters that could send and receive text over telegraph
lines.
Pressing a letter on one teletype keyboard would cause a signal to be sent, over telegraph
wires, to a teletype machine on the other end, which would then electromechanically
type that letter.
This allowed two humans to type to one another over long distances... basically a steampunk
version of a chat room.
Since these teletype machines already had an electronic interface, they were easily
adapted for computer use, and teletype computer interfaces were common in the 1960s and 70s.
Interaction was pretty straightforward.
Users would type a command, hit enter, and then the computer would type back.
This text “conversation” between a user and a computer went back and forth.
These were called command line interfaces, and they remained the most prevalent form
of human-computer interaction up until around the 1980s.
Command Line interaction on a teletype machine looks something like this.
A user can type any number of possible commands.
Let’s check out a few, beginning with seeing all of the files in the current directory
we’re in.
For this, we would type the command, “ls”, which is short for list, and the computer
replies with a list of the files in our current directory.
If we want to see what’s in our “secret StarTrek Discovery Cast dot t-x-t file”,
we use yet another command to display the contents.
In unix, we can call “cat” - short for concatenate.
We need to specify which file to display, so we include that after the command, called
an argument.
If you’re connected to a network with other users, you can use a primitive version of
a Find My Friends app to get more info on them with the command “finger”.
Electromechanical teletype machines were the primary computing interface for most users
up until around the 1970s.
Although computer screens first emerged in the 1950s, and were used for graphics they
were too expensive and low resolution for everyday use.
However, mass production of televisions for the consumer market, and general improvements
in processors and memory, meant that by 1970, it was economically viable to replace electromechanical
teletype machines with screen-based equivalents.
But, rather than build a whole new standard to interface computers with these screens,
engineers simply recycled the existing text-only, teletype protocol.
These machines used a screen, which simulated endless paper.
It was text in and text out, nothing more.
The protocol was identical, so computers couldn’t even tell if it was paper or a screen.
These virtual teletype or glass teletype machines became known as terminals.
By 1971, it was estimated, in the United States, there was something on the order of 70,000
electro-mechanical teletype machines and 70,000 screen-based terminals in use.
Screens were so much better, faster and more flexible, though.
Like, you could delete a mistake and it would disappear.
So, by the end of the 1970s, screens were standard.
You might think that command line interfaces are way too primitive to do anything interesting.
But even when the only interaction was through text, programmers found a way to make it fun.
Early interactive, text-based computer games include famous titles like Zork, created in
1977.
Players of these sorts of early games were expected to engage their limitless imaginations
as they visualized the fictional world around them, like what terrifying monster confronted
them when it was pitch black and you were likely to be eaten by a grue.
Let’s go back to our command line, now on a fancy screen-based terminal, and play!
Just like before, we can see what’s in our current directory with the “ls” command.
Then, let’s go into our games directory by using the “cd” command, for “change
directory”.
Now, we can use our “ls” command again to see what games are installed on our computer.
Sweet, we have Adventure!
All we have to do to run this program is type its name.
Until this application halts, or we quit it, it takes over the command line.
What you’re seeing here is actual interaction from “Colossal Cave Adventure”, first
developed by Will Crowther in 1976.
In the game, players can type in one- or two-word commands to move around, interact with objects,
pickup items and so on.
The program acts as the narrator, describing locations, possible actions, and the results
of those actions.
Certain ones resulted in death!
The original version only had 66 locations to explore, but it’s widely considered to
be the first example of interactive fiction.
These text adventure games later became multiplayer, called MUDs or Multi-User Dungeons.
And they’re the great-forbearers of the awesome graphical MMORPG’s (massive, multiplayer
online role playing games) we enjoy today.
And if you want to know more about the history of these and other games we’ve got a whole
series on it hosted by Andre Meadows!
Command line interfaces, while simple, are very powerful.
Computer programming is still very much a written task, and as such, command lines are
a natural interface.
For this reason, even today, most programmers use command line interfaces as part of their
work.
And they’re also the most common way to access computers that are far away, like a
server in a different country.
If you’re running Windows, macOS or Linux, your computer has a command line interface
– one you may have never used.
Check it out by typing “cmd” in your Windows search bar, or search for Terminal on Mac.
Then install a copy of Zork and play on!
So, you can see how these early advancements still have an impact on computing today.
Just imagine if your phone didn’t have a good ol’ fashioned QWERTY keyboard.
It could take forever to type your Instagram captions.
But, there’s still something missing from our discussion.
All the sweet sweet graphics!
That’s our topic for next week.
See you soon.
Ver Más Videos Relacionados
Operating Systems: Crash Course Computer Science #18
Screens & 2D Graphics: Crash Course Computer Science #23
Natural Language Processing: Crash Course Computer Science #36
Graphical User Interfaces: Crash Course Computer Science #26
Electronic Computing: Crash Course Computer Science #2
The Cold War and Consumerism: Crash Course Computer Science #24
5.0 / 5 (0 votes)