HackerPapers

HN 二十年,最值得读的论文。

从 Hacker News 2006 年以来的全部投稿里,挑出链接本身就是论文的帖子:arXiv、期刊、会议论文、技术报告。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从必读开始
  • 8,000+篇被 HN 讨论过的论文

Essential

必读 30 篇

在论文库里看全部精选

编辑精选里 HN 讨论最热的 30 篇,每篇都有中文导读。不知道从哪读起,就从这里开始。

  1. 正在载入论文…

Archive

论文库

点柱子按年份筛选。注:源数据里 2023 年的帖子分数记录不全,2026 年尚未过完,这两年收录偏少。

难度
排序

    About

    这些论文是怎么挑出来的

    1. 01

      全量扫一遍

      读取 Hacker News 自 2006 年以来的全部 446 万条链接投稿,找出指向 arXiv、期刊、会议、技术报告和学术 PDF 的帖子。

    2. 02

      只留论文本身

      由 AI 逐条判断,剔除介绍论文的新闻、博客和幻灯片,同一篇论文的多次投稿合并计算,并统计它在评论区被引用的次数。

    3. 03

      写导读、译评论

      讨论最热的 1,500 篇配上中文导读,并精选、翻译 HN 高赞评论。导读由 AI 生成,可能有误,请以原文为准。

    编程语言与软件工程2013two-sdg.demon.co.uk

    极简主义:少写代码的实用指南

    Minimalism: Practical Guide to Writing Less Code (2002)

    入门 · 约 30 分钟读完前置知识:基本编程经验、常见面向对象语言(Java/C++)基础

    读论文 HN 讨论
    242HN 得分
    119条评论
    2次投稿

    导读

    这是一篇 2002 年的论文《Minimalism: Practical Guide to Writing Less Code》,探讨如何通过“少写代码”来提升软件质量。文中给出了一系列实用建议,例如只包含真正需要的内容(避免过度设计)、将重复代码视为错误、谨慎使用 return/continue/break 等控制流语句等。

    HN 关注点:这些 20 年前的“极简主义”编程建议在今天是否仍然适用,以及其中哪些观点(如单一返回点、过早 DRY)与现代实践相冲突。

    关键词 极简主义DRY过度设计代码质量

    HN 评论精选

    这几条评论里:支持 1 质疑 2 补充 2

    质疑过早 DRY 是万恶之源,应遵循三次法则

    “把重复代码视为错误”——我部分不同意。我见过一些最糟糕的代码,正是为了消除重复而写出来的。尤其是在 UI 代码中,很容易误判重复,过早地构建 DRY 方案。过早 DRY 是万恶之源。我遵循“三次法则”,即使如此,也比年轻时谨慎得多。

    christophilus查看英文原文

    > Consider duplicate code to be a mistake I partially disagree. Some of the worst code I’ve seen was an attempt to reduce duplication. It’s easy, especially in UI code, to mistakenly identify duplicate code, and prematurely build a DRY “solution”. Premature DRY is the root of much evil. I try to follow the rule of three before trying to identify duplication. Even then, I’ve become much more cautious than in my younger days.

    质疑反对单一返回点,支持尽早返回

    我强烈反对“函数应少用 return、应节制使用”的说法。我认为尽早返回的代码才是最好的,单一返回点是非常过时的观念。我更担心的是看到毫无理由的十层缩进。对 continue 和 break 的建议同样很糟糕。其他建议倒还不错。

    Kaveren查看英文原文

    I vehemently disagree with the idea that returning from a function often is bad and that it should be used "sparingly". I find that code that returns as early as possible is the best. The idea of a nearly mandatory single return point is a very antiquated notion. I'm much more concerned when I see ten levels of indentation for no good reason. Likewise with continue and break. I think this advice is very bad. All the other recommendations seemed fine.

    补充如何在不完全理解问题的情况下避免过度设计?

    建议 2“只包含你需要的”引用了控制反转原则,但还可以扩展到更多方面。我想讨论的是:如何避免对尚未完全理解的问题过度设计?除非你在 NASA 工作,否则不到需要时你不会真正知道自己需要什么。这里的程序员们是如何应对意外情况的?

    Dowwie查看英文原文

    "Recommendation 2: Include Only What You Need" The slide refers to the inversion of control principle but can easily include other important aspects of including only what is needed. I would like to expand on this for discussion. Consider the challenges of not over-engineering solutions to problems you and others don't fully understand, yet. Unless you work for NASA, you won't fully know what you need until you need it. How do programmers here account for the unexpected?

    支持只写解决当前问题所需的代码

    少写代码的主要法则:只写解决当前实际问题所需的代码。为未来的问题写代码没问题,但过于追求通用性往往会撑大代码库并引入 bug。

    taeric查看英文原文

    Main rule for writing less code: only write the code you need to solve the actual problem you have. It is fine to write towards future problems, but all to often trying to be generic explodes the codebase and leads to bugs.

    补充2002 年的指南针对的是冗长的 Java/C++,世界该向前走了

    有点讽刺的是,这份 2002 年的极简主义指南,从用词看显然是针对 Java 或 C++ 这类以冗长著称的语言。我更希望看到关于 Clojure 的无锁并发、Go 强制组合优于继承等新语言特性的讨论。看一份处理上世纪九十年代末问题的 2002 年演示文稿固然有趣,但世界该向前走了。

    martinced查看英文原文

    It's kinda ironic that a guide to minimalism, written in 2002, obviously has in mind a language like Java or C++ (the vocabulary used makes it crystal clear)... Languages which are not exactly known for their lack of verboseness ; ) I know that for many here Java/C++/C# + ORM + XML + SQL is "The one true way of life"... But I moved on: I do really believe pg's point about "Beating the average" and trying to "think outside the (Java/C# ORM XML SQL) box"... For example, I'd personally much rather see posted and upvoted recent writings about languages offering, say, lockless concurrency (Clojure) or specifically preventing "type inheritance" (hence forcing you to use composition instead of inheritance) (Go), etc. I mean, it's cute to see a 2002 presentation about ways to deal with late nineties issues but honestly I think the world should start to move on. I don't doubt there are a lot of older codebase around that would benefit from this but what about people would start to use HN to try to move the world forward?

    相关资源

    从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。

    代码

    历次讨论

    同领域还值得读

    1. Google 的软件工程(2017)

      Software Engineering at Google (2017)

      介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…

      编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选
    2. Peter Naur:编程作为理论构建 (1985)

      Peter Naur – Programming as Theory Building (1985)

      Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…

      编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选
    3. SciPy 1.0:Python 科学计算的基础算法

      SciPy 1.0: fundamental algorithms for scientific computing in Python

      这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社…

      编程语言与软件工程2020 · 387 分 · 98 评入门 · 约 45 分钟编辑精选
    4. Lisp 的历史(1979)

      History of Lisp (1979)

      这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…

      编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选
    5. 使用 NumPy 进行数组编程

      Array Programming with NumPy

      这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。

      编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。