字号·· | 护眼
theregister

以人性化的工作复兴拉斯金的软件三定律,其中考虑到开发者的注意义务Revive Raskin's 3 laws of software with humane work that considers a dev's duty of care

点「原文对照」整页切到原文,或双击某段只看那段的原文。

1942年,艾萨克·阿西莫夫提出了机器人三定律。58年后,杰夫·拉斯金则提出了人机界面设计的三条法则。至今仍无人能超越这些法则。关于计算机用户界面设计,确实存在诸多规则乃至定律。即便在Linux问世35年、Unix系统得以普及之后,开源软件界也始终未能真正领会这一点。反观专有软件界,却一直在逐步遗忘曾经掌握的设计规则。

In 1942, Isaac Asimov formulated three laws of robotics. 58 years later, Jef Raskin responded with three laws of human-computer interface design. They haven’t been bettered yet. There are rules, and even laws, about designing computer user interfaces. Even after 35 years of Linux, which has brought Unix to the masses, the FOSS world has not yet really grasped this. In the meantime, the proprietary software world is busily forgetting everything it once knew.

如今这些规则偶尔会被重新提及,每当此时,开源软件开发者们往往会因被指出违反了用户界面设计规范而怒不可遏。马尔钦·维查里最近发表的博文《他们根本没有对用户负有保护责任的意识》便是近期的一个典型例子。(《The Register》的开源软件专栏编辑十分欣赏维查里的文笔,甚至专门购买了他所著的键盘发展史著作《Shift Happens》。)

Sometimes these rules surface today, and the FOSS folks often get very cross when reminded that they’re user-interface scofflaws. Marcin Wichary’s recent blog post, They had no concept of a duty of care to their users, is an excellent recent example. (The Reg FOSS desk much admires Mr Wichary’s writing, to the extent that we bought his history of the keyboard, Shift Happens.)

在这篇最新博文中,维查里提到了CHERI项目的研究者大卫·奇斯纳尔。奇斯纳尔是Vim的长期使用者——人都有各自的缺点嘛——他最近尝试了NeoVim。他一直使用Vim的持久化撤销功能,该功能会将操作记录保存在独立目录中,这样用户就能反复撤销操作,直至回到数周甚至数月前所做的修改。他自行设定了该文件的存储位置;然而当他试用NeoVim时,该程序却直接覆盖了他的Vim撤销记录文件。

In his latest post, Wichary refers to CHERI Project boffin David Chisnall. Chisnall is a long-term Vim user – we all have our failings – and recently recounted trying NeoVim. He uses Vim’s persistent-undo feature, which records changes in a separate directory, so that you can repeatedly undo until you get back to changes you made weeks or months earlier. He’s customized where it’s kept, and when he tried the NeoVim fork, it overwrote his Vim undo file.

在后续更新中,他承认程序确实给出了相关警告,但他原以为该操作是安全的。事实却并非如此:该操作覆盖了他十多年来积累的所有操作记录。正如他所说:“近20年来,Vim始终能在版本升级后维持这一功能正常运行。对此我甚至都习以为常了——这完全符合拉斯金的第一定律:程序不得损害用户数据,也不得因疏忽而导致用户数据受损。”

In a later update to his post, he acknowledges that there was a warning, but he expected it to be safe. It was not safe. It overwrote records of more than a decade’s worth of changes. As he puts it: “Vim has kept this working across major version upgrades over a period of about 20 years. I don’t even think about it, it’s just part of Raskin’s First Law: A program may not harm a user’s data or, through inaction, allow a user’s data to come to harm. If vim or the computer crash, or if I close a file and come back to it six months later, my undo history is still there.”

“即便Vim或电脑出现崩溃,又或者我关闭文件后六个月才重新打开,我的撤销历史记录依然会保留。”Wichary在引用Chisnall提到的拉斯金三大法则时,补充了全部三条内容。不过,考虑到可能有人并不熟悉“科幻黄金时代”的作品,这里稍作背景说明:阿西莫夫于1942年5月在《惊奇科幻杂志》上发表了一篇名为《绕圈圈》的短篇故事,并在其中提出了三条机器人法则。

Wichary expands Chisnall’s citation of Raskin’s first law by giving all three, but just in case you’re not a follower of “Golden Age” science fiction, a little context. Asimov introduced his three laws in a short story called “Runaround”, in Astounding Science Fiction magazine* in May 1942. (The story was later collected in the anthology I, Robot – which is nothing like the terrible 2004 film.)

(该故事后来被收录进《我,机器人》这部短篇集——请注意,它和2004年那部糟糕透顶的同名电影毫无关系。)第一条:机器人不得伤害人类,也不得以不作为的方式任由人类受到伤害。第二条:机器人必须服从人类的命令,除非这些命令与第一条法则相冲突。第三条:只要不违背第一或第二条法则,机器人必须尽力保护自身的存在。

A robot may not injure a human being or, through inaction, allow a human being to come to harm. A robot must obey the orders given it by human beings except where such orders would conflict with the First Law. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law. Asimov’s idea was that by setting these rules, he could end the terrible genre of killer-robot stories that was already tired and stale by 1942.

阿西莫夫提出这些规则的初衷,就是希望借此终结当时已然陈腐不堪的“杀人机器人”类故事。作为苹果第一代Macintosh项目的首席设计师,杰夫·拉斯金也试图为软件用户界面确立类似的明确准则。他的三条法则如下:第一,计算机不得妨碍你的工作,也不得以不作为的方式导致你的工作受损;第二,计算机不得浪费你的时间,也不得要求你完成超出必要范围的工作;第三,一个界面若能顺应人类需求并体谅人类的弱点,便可称得上是人性化的界面。

Jef Raskin, the lead designer of Apple’s original Macintosh project, attempted to bring similar clarity to software UI. Raskin’s three laws are: A computer shall not harm your work or, through inaction, allow your work to come to harm. A computer shall not waste your time or require you to do more work than is strictly necessary. An interface is humane if it is responsive to human needs and considerate of human frailties.

这些法则均出自他2000年出版的《人性化界面》一书,如今该书仍可购买,也能从互联网档案馆借阅。遗憾的是,拉斯金于2005年离世,但我们曾多次撰文介绍他的贡献与影响力。他确实为初代Macintosh的设计定下了一些方向:史蒂夫·乔布斯被调离Lisa项目后接手了Macintosh的开发工作——这一经过在《Canon Cat与被乔布斯毁掉的Mac》一文中有详细记述。

He defined them in his 2000 book The Humane Interface, which you can still buy, or borrow from the Internet Archive. Sadly, Raskin died in 2005, but we have written about his work and his influence several times. He did set some of the direction of the original Macintosh. After Steve Jobs was booted off the Lisa, he took over the Macintosh – as described in The Canon Cat and the Mac that Steve Jobs killed.

拉斯金则选择辞职,转而设计了我们几年前介绍过的极具特色的Canon Cat设备。我们猜测,拉斯金大概并不喜欢Vim的前身——Vi编辑器。

Raskin quit, and instead designed the remarkable Canon Cat, as we described a couple of years ago. We suspect Raskin was not a fan of Vi, the forerunner of Vim.

我们也不确定,正因如此我们才选用了本文标题中的年份——那是比尔·乔伊编写出vi编辑器的年份。拉斯金曾批评过那些需要用户付出额外脑力才能操作的模态式软件;另一位用户界面领域的先驱、已故的拉里·特斯勒也持相同观点,正是他发明了剪切/复制/粘贴这组命令。特斯勒有一句名言:“别让我进入模态模式!”

We aren’t either, which is why we chose the year in the headline of this story: it’s the year Bill Joy wrote vi. Raskin criticized modal software, which requires extra mental effort from the user. So did another UI pioneer, the late great Larry Tesler, who invented the cut/copy/paste trio of commands. Tesler was known for his dictum “Don’t mode me in!” and even had a car license plate reading “NOMODES.”

他甚至还在自己的车牌上写着“NOMODES”。奇斯纳尔博士向来容易惹恼Unix爱好者——我们之前也提到过他的一篇论文:2018年时他撰文指出“C语言并非低级语言:你的电脑可不是运行速度飞快的PDP-11”。这篇言论可把Unix爱好者们气坏了。此前就有人指责他胆敢批评C语言,甚至扬言要他“去死”。(真希望我们是在开玩笑,但事实并非如此。)

Dr Chisnall has some history of upsetting Unix fans – we’ve referred to one of his papers before: in 2018, he wrote C Is Not a Low-level Language: Your computer is not a fast PDP-11. Unix fans really didn’t like this. This vulture has been told to kill himself for daring to criticize C before now. (We wish we were joking, but no.)

虽然他后来更新了自己在Mastodon上的帖子,但NeoVim的粉丝们依然不满。事实上,有人在Bluesky上痛斥这位博主擅自转发了维奇里的帖子。值得注意的是,Omarchy系统推荐使用的编辑器正是NeoVim;直到最近,NeoVim的开发者们还在项目官网上引用了DHH发布的一条推文。经过一场激烈的争论后,那段引文就在奇斯纳尔和维奇里发帖前后被删除了。

Although he has now updated his Mastodon post, the NeoVim fans are not happy. Indeed, one has lambasted this vulture on Bluesky for sharing Wichary’s post. It is interesting to note that NeoVim is the recommended editor in Omarchy, and until recently, the NeoVim developers cited a tweet from DHH on the project website. After an acromonious debate, the pull-quote was removed right around the time of Chisnall’s and Wichary’s posts.

在广阔的软件设计领域,我们并不指望那些偏右翼倾向的从业者能在提升软件易用性方面有所创新。从某种程度上说,Unix与C语言正是那种崇尚“硬汉风格”的软件设计理念的典型代表:即鼓励用户去掌握那些使用起来颇为复杂的工具。不过,世上还有其他类型的软件。我们最近读到一篇很有意思的文章:有人仅用一块售价仅0.60英镑的芯片就成功模拟出了初代Macintosh电脑的运行效果。

In the wide world of software design, we don’t expect the right-wing edge of that community to innovate much in ease of use. In a way, Unix and C embody a machismo infused school of software design: that of enjoying the process of mastering things which are hard to use. However, there are other types of software. We recently enjoyed reading about emulating an original Macintosh on a £0.60 chip.

换算成美元就是0.80美元,那块芯片自然就是树莓派——不过甚至都不是Pi Zero型号,而是微控制器Pi Pico。我们依然抱有希望:世界终能重新出现那些小巧、简单、以用户为中心的软件——这类软件的首要目标是友好易用,其次才是功能丰富。当然,这类软件理应由人工手写编写,绝不该借助机器人的协助。

That’s $0.80 and of course the computer is a Raspberry Pi – but not even a Pi Zero: it’s a Pi Pico, a microcontroller. There is still some hope that the world can rediscover tiny, simple, user-centric software, built to be friendly first, and for rich functionality second. And, it almost goes without saying, hand-coded without bot assistance.

附注:* 《Astounding》杂志于1960年更名为《Analog》,至今仍在发行。我们强烈推荐这本杂志。如果你还没读过阿西莫夫原作的《Runaround》,该期《Astounding》的内容也可以在互联网档案馆上找到。®

Bootnote * Astounding magazine changed its name to Analog in 1960, and it’s still around. We recommend it. If you haven’t read Asimov’s original “Runaround”, that issue of Astounding is on the Internet Archive too. ®