编程与软件工程plus.google.com
Rob Pike:点文件的起源
Rob Pike: the origin of dotfiles
2012 — 2019,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Rob Pike 在这则帖子中回顾了 Unix 点文件(dotfiles)传统的起源:它并非精心设计,而是源于隐藏 . 和 .. 的实现选择,使得以点开头的文件在列目录时被一并隐藏。评论由此延伸到家目录该不该堆放配置、XDG 规范和“约定优于配置”等话题。
为什么经久不衰:它用一个微小的历史偶然解释了今天无处不在的约定,也让人重新思考家目录与配置文件的边界。
HN 评论精选
建议用 XDG 规范替代家目录里散落的 dotfiles。
与其在用户主目录里放点文件或点目录,不如遵循 XDG Base Directory 规范:http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html 。它容易理解,只需稍微多花一点精力或代码。
keyist查看英文原文
Instead of putting a dotfile or dotdir in the user's home directory, do follow the XDG Base Directory specification: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html . It's easy to understand and requires only a marginal increase in effort/code.
家目录应属于用户,应用不应乱丢配置。
我讨厌 ~/ 里的点文件,就像我讨厌 Windows 的“我的文档”:因为那本应是我自己整理的空间,而不是你的配置文件、品牌文件夹或其他无关垃圾的通用倾倒场。我希望我的空间属于我,把你应用的东西拿出去!
acabal查看英文原文
I hate having dotfiles in ~/ for the same reason why I hate "My Documents" in Windows: because it's supposed to be my space that I organize, not a generic dumping ground for your config files, brand-named folders, or other nonessential garbage. I want my space to be mine. Keep your app's stuff out of there!
点文件虽源于偶然,但已成为被接受的约定。
我认为隐藏点文件是“约定优于配置”的好例子。观点成立:它源于一个懒惰的程序员。但早期的人可能只是喜欢某些文件(点文件)被隐藏的意外结果。就像我们大多数人学 Unix 时都以为这是有意设计。如果早期用户觉得这个后果是障碍,早就修了。这类似 Twitter 的 hashtag 或 @ 寻址先被用户采用,后来成为特性。
rehack查看英文原文
I think the case of hidden dot files is a good example of 'convention over configuration'[1]. Point is accepted, that it came into being due to a lazy programmer. But surely early people might have just liked the unintended consequence of some files (dot files) being hidden. Just like most of us, whenever we learnt unix thought that it is by design. If early users, had found the consequence a handicap, it would have been fixed long back. Its similar to the use of hash-tags on twitter or the @for addressing which got adopted by users first and so became features (although the paths to them being considered features are different). [1] http://en.wikipedia.org/wiki/Convention_over_configuration Edit: Grammar
把 . 和 .. 作为真实目录项返回是后续隐藏规则的根源。
. 和 .. 被分配了真实的目录项,并在读取目录时返回,而不是仅由内核在解析路径名时处理,这看起来像是这里权宜之计留下的原罪。
caf查看英文原文
The fact that "." and ".." were allocated actual directory entries and were returned when reading the directory, rather than just being handled by the kernel when parsing pathnames seems like the original sin of expediency here.
历次讨论
同类还值得读
开源应用架构
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编辑精选