编程语言与软件工程2014bowdoin.edu
保险杠贴纸计算机科学(1985)
Bumper Sticker Computer Science (1985)
入门 · 约 15 分钟读完前置知识:基本编程经验、软件工程常识
导读
这篇 1985 年的《Bumper Sticker Computer Science》以“保险杠贴纸”式的短句和格言,汇编计算机编程与软件工程中的经验法则,讨论开发者反复遇到的错误与实践原则。它并非提出新理论,而是把“一个过程应能放在一页纸上”“越早开始写代码,程序耗时越长”“不要对计算机撒谎”等教训集中呈现,因而常被当作对开发者长期有效的提醒。
HN 关注点:是因为这些 30 多年前的格言今天仍适用;讨论焦点从重复填表、输入格式等用户体验问题,延伸到 GIGO、调试可复现性和编程文化变迁。
HN 评论精选
这几条评论里:支持 1 质疑 1 补充 2
支持30 多年后这些格言仍适用;系统不应让用户重复提供已知信息,也不应强迫用户适配机器格式。
33 年后,这些格言几乎仍然适用,而且几乎仍然是人们不断犯的错误。让我印象深刻的几条:80% 的输入表单会问不该问的问题;一个过程应该能放在一页纸上;尤其是:不要让用户提供系统已经知道的信息。这在电商中经常发生,纸质表单更甚。比如每次看新医生都要填 15 张表,15 次写下姓名、地址、SSN、保险号;诊所明明知道这些,为什么不预填?还有,我们构建很多表单要求人用电脑能直接读取的格式提供数据。电脑应该为用户服务,而不是反过来。FCC 的 Do Not Call 网站提示电话号码只能输数字,不能有横线括号;网站为何不直接剥掉非数字字符?很基础,但常见。
reaperducer查看英文原文
It's amazing that 33 years later, nearly all of these still apply. And nearly all are mistakes that are still being made. Theses gems stuck out for me: Eighty percent of all input forms ask questions they have no business asking. A procedure should fit on a page. And especially: Don’t make the user provide information that the system already knows. This happens all the time, especially in e-commerce. And even moreso in paper form. For example, every time I go to a new doctor, I have to fill out 15 forms and 15 times I have to write down my name, address, SSN, insurance id, etc... Why can't the doctor's office, which already knows all of that, just print out 15 forms with all of that pre-populated? Somewhat related: We build so many input forms demanding people provide data to the computer in a form that the computer can immediately read. The computer should work for the user, not the other way around. Example: The FCC's Do Not Call web site has notes on its input fields that phone numbers have to be entered as numbers only. No dashes, parentheses, etc... How about the web site take whatever is input and strip out anything that's not a number? So basic, but I see this all the time.
质疑现实里计算机往往不会纠正错误输入,反而放大它;人们常盲目相信输出。
书里说“如果你对电脑撒谎,它会抓住你。”按我在工作中的观察,我会改成:“如果你对电脑撒谎,它会纵容你。”很多人把电脑输出当成金科玉律,从来不懂垃圾进垃圾出(GIGO)。
pasbesoin查看英文原文
From TFPDF: "If you lie to the computer, it will get you." From my observation at work, I'd change this to: "If you lie to the computer, it will let you." Lots of people who take computer output as gospel. They never get, GIGO.
补充与当代资料对比,旧文更重视优化、更理解编程的非电子语境,或反映出版文化差异。
我仔细过了一遍每条格言,并给自己的 fortune 克隆/数据库补了一些缺失条目,注意到与现代来源相比两点:(1) 对优化相关问题的重视似乎比今天更高;(2) 对编程的非电子语境的理解似乎比今天更高。我认为这可能是有效的文化反映,部分可归因于论文出版(经过编辑、时间跨度)与电子出版的性质差异。
contingencies查看英文原文
I went through each quote carefully while adding some missing ones to my fortune clone/database at https://github.com/globalcitizen/taoup and noticed two things versus modern sources: (1) The weight lent to optimization related concerns seems higher than today. (2) Comprehension of the non-electronic context of programming seems higher than today. I think these are probably valid cultural reflections, potentially ascribable in part to the (edited, time-lapse) nature of paper-publishing versus electronic.
补充调试的关键第一步是让故障可复现。
结合今天另一条帖子里的 Linux 内核 bug……“修复坏程序的第一步,是让它能可重复地失败。”——Tom Duff / 贝尔实验室
51Cards查看英文原文
With regards to the Linux kernel bug in another thread today... "The first step in fixing a broken program is getting it to fail repeatably" - Tom Duff / Bell Labs
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2014Hacker News 讨论帖81 分 · 18 评
- 2018Hacker News 讨论帖231 分 · 49 评
同领域还值得读
Google 的软件工程(2017)
Software Engineering at Google (2017)
介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…
编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选Peter Naur:编程作为理论构建 (1985)
Peter Naur – Programming as Theory Building (1985)
Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…
编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选SciPy 1.0:Python 科学计算的基础算法
SciPy 1.0: fundamental algorithms for scientific computing in Python
这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社…
编程语言与软件工程2020 · 387 分 · 98 评入门 · 约 45 分钟编辑精选Lisp 的历史(1979)
History of Lisp (1979)
这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…
编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选使用 NumPy 进行数组编程
Array Programming with NumPy
这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。
编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选