编程与软件工程vidarholen.net
Linux 内核源码里的脏话随年代变化
Occurences of swearing in the Linux kernel source code over time
2009 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Vidar Holen 的 wordcount 页面,统计 Linux 内核源码中若干脏话及粗俗词汇(fuck、shit、damn、idiot、retard、crap 等)随时间的变化曲线。页面基于不同内核版本的源码做词频检索,用图表展示这些词在千万行级代码库中的出现趋势。
为什么经久不衰:用一个简单、可复现又略带恶趣味的统计视角,揭开巨型开源项目的人性一面;讨论里对数据口径的拆解也让这类“脏话计数”变得更有意思,多年后仍值得一看。
HN 评论精选
统计被单词子串匹配严重虚高,真实脏话密度极低。
值得注意这些数字的尺度:Linux 约有 1663 万行代码,图上脏话大概 370 处(不算 penguin),不到三十万分之一。我在 3.8.0 源码树上核对过,数字偏高是因为允许脏话作为其他单词的一部分被匹配:比如 "shit" 出现在 121 行,但带空格的 " shit " 只有 10 行;"crap" 出现 161 次,其中 20 次是 "scrap" 的一部分;"bastard" 17 次里有 6 次是 lazybastard.org 之类的邮箱地址;"penguin" 出现 99 次,其中两处是玩笑。
gizmo686查看英文原文
Its worth looking at the scale of the swear count. Linux has about 16629976 lines of code, and I'd estimate from the graph that it has about 370* swear words (excluding penguin). If you look at the second graph, that is less then 1 swear in 300000 lines. I checked this on the source tree for 3.8.0. The numbers appear to be inflated by allowing the swear words to be part of other words. For example, "shit" appears in 121 lines, but " shit " only appears in 10 lines. Looking at the offending lines, there is only one swearword that is missed by excluding spaces. "fuck" appears 29 times, all of which are some conjugation of the verb (and some lines have duplicates I'm not counting). "crap" appears 161 times, 20 of which are part of "scrap" "bastard" appears 17 times, 6 of which go to email addressed hosted at "lazybastard.org" and "you-bastards.com" "penguin" appears 99 times, two of which are jokes.
脏话注释常被用来警示脆弱的代码段,未必代表敌意。
我很好奇写脏话注释的动机。我偶尔会写“除非你搞懂 x、y、z,否则别他妈碰这段”,来保护脆弱的代码不被粗心的同事改坏,因为几乎同样但不带脏话的注释似乎没什么效果。日常对话里脏话常带暴力暗示,多用于威慑,我也常见它被用来制造笑点。但愿这些计数并不说明内核里代码越来越脆弱、分歧越来越激烈。有内核经验的人能说说常见的脏话用途吗?
DarMontou查看英文原文
I'm curious about the motivations for coding profanity. I've occasionally included comments like "don't f* with this unless you understand x, y, and z" in an attempt to protect fragile sections of code from careless collaborators. Nearly identical comments without profanity seemed ineffective. Within common conversations I know that profanity often carries an implication of violence, usually for the purpose of intimidation. I also find that profanity is frequently used for comedic relief. Hopefully these counts don't indicate increasing fragility or violent disagreements within the kernel. Does anyone with kernel experience have any insight into common purposes for kernel profanity?
质疑为何把吉祥物相关的 penguin 也纳入统计。
有人能解释为什么把 "penguin" 也算进去吗?我知道 Tux 是吉祥物,但这是某种内部玩笑式的“脏话”吗?
shaggyfrog查看英文原文
Can anyone explain the inclusion of "penguin"? I know Tux is the mascot and all, but is it some kind of inside-joke-swear-thing?
推荐 jwz 关于 Mozilla 源码脏话的经典文章作对照。
我喜欢 jwz 那篇关于 Mozilla 中脏话的经典文章:http://www.jwz.org/doc/censorzilla.html
foobarbazqux查看英文原文
I like jwz's classic post about swear words in Mozilla: http://www.jwz.org/doc/censorzilla.html
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选