HackerURLs

一次又一次被重新发现的经典。

同一个链接,相隔一年以上,一次又一次被人重新发现、再次冲上 Hacker News 首页。能经受住这种时间检验的,大多是值得一读再读的文章。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从名人堂开始
  • 4,700+篇经过时间检验的经典

Hall of fame

名人堂

在经典库里看全部精选

上首页次数最多、而且有中文导读的 30 篇。时间轴上每个黑点是一次上首页,空心点是一次没冲上去的投稿。

  1. 正在载入经典…

Archive

经典库

按第一次上首页的年份分布,点柱子筛选。

排序

    About

    这些经典是怎么挑出来的

    1. 01

      合并同一个链接

      读取 Hacker News 自 2006 年以来的全部链接投稿,把 http/https、www、跟踪参数等写法不同的同一篇文章合并成一条。

    2. 02

      只留经得起时间的

      同一链接至少两次拿到 50 分以上(约等于上首页),而且两次相隔一年以上;再由 AI 剔除状态页、产品首页和新闻事件。

    3. 03

      写导读、译评论

      上首页次数最多的 2,000 篇配上中文导读、"为什么经久不衰",并精选翻译 HN 高赞评论。导读由 AI 生成,可能有误。

    编程与软件工程gamasutra.com

    电子游戏生产中的肮脏编程技巧

    Dirty Coding tricks used in Production Video Games

    2次上首页
    6年跨度
    634累计得分
    133条评论

    2009 — 2015,它一次次回到首页

    黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。

    导读

    这篇 Gamasutra 文章收集了游戏开发者为了按时交付、在内存和硬件限制下采用的“脏”编码取巧与幕后故事。它既有临时补丁式的 hack,也反映商业游戏开发中资源、工期与质量的现实取舍。

    为什么经久不衰:这些一线故事真实又荒诞,把游戏工业在极限约束下的工程妥协讲得生动,所以多年后仍能引起开发者共鸣。

    关键词 游戏开发技术债内存管理业内轶事

    HN 评论精选

    老手提前埋下 2MB 备用内存,在临近上限时一键释放救场。

    这简直是神来之笔。我们当时还超出内存限制 1.5 MB!这时团队里最有经验的程序员之一——经历过“美好旧时光”多年开发的人——决定亲自处理。他把我叫进办公室,我本以为又要开始一轮耗人的释放内存工作。结果他打开一个源文件,指着这行:static char buffer[1024 * 1024 * 2]; “看到这个了吗?”他说。然后一键删掉。搞定!他大概看到了我眼里的惊恐,就解释说,他在开发早期就预留了这两兆内存。他凭经验知道,把内容削减到内存预算内从来都很难,很多项目因此差点失败。所以现在他养成习惯:总是预留一大块内存,真到需要时再释放出来。

    Retric查看英文原文

    Ok, this is just golden. We were still 1.5 MB over the memory limit! At this point one of the most experienced programmers in the team, one who had survived many years of development in the "good old days," decided to take matters into his own hands. He called me into his office, and we set out upon what I imagined would be another exhausting session of freeing up memory. Instead, he brought up a source file and pointed to this line: static char buffer[1024 * 1024 * 2]; "See this?" he said. And then deleted it with a single keystroke. Done! He probably saw the horror in my eyes, so he explained to me that he had put aside those two megabytes of memory early in the development cycle. He knew from experience that it was always impossible to cut content down to memory budgets, and that many projects had come close to failing because of it. So now, as a regular practice, he always put aside a nice block of memory to free up when it's really needed.

    用十六进制改掉退出时报错文本为致谢,掩盖问题赶出货。

    链接到打印版的问题是你看不到原文评论。我最喜欢的故事就在评论里,来自参与《银河飞将》的 Ken Demarest:在《银河飞将1》时,我们退出游戏会触发 EMM386 内存管理器的异常。清屏后会打印一行,类似“EMM386 Memory manager error...”。当时必须尽快出货。于是我直接十六进制编辑内存管理器里的错误信息,改成“Thank you for playing Wing Commander.”

    petercooper查看英文原文

    The problem with linking to the print version is you don't get to see the comments. My favorite story of all was in the comments and comes from Ken Demarest who worked on Wing Commander: Back on Wing Commander 1 we were getting an exception from our EMM386 memory manager when we exited the game. We'd clear the screen and a single line would print out, something like "EMM386 Memory manager error. Blah blah blah." We had to ship ASAP. So I hex edited the error in the memory manager itself to read "Thank you for playing Wing Commander."

    GameCube 某中断未保存/恢复 r19 导致偶发卡死,靠最小复现定位并绕开。

    我最喜欢的战时故事来自一款 GameCube 首发游戏。QA 发现,如果在前端两个菜单间快速来回切换,可能卡死,虽然可能要十分钟才触发。我最终在调试器里复现,现象很怪:一个局部变量被改成奇怪值,但看不到内存损坏,只有寄存器不对,而且它只被赋值一次。无论怎么裁剪测试用例都不崩,反汇编看起来也正常。后来我注意到可疑变量在 r19,按分配策略这很不寻常,通常很少用到。这给了我线索:我写了一个包含所有函数参数和局部变量、但不含原逻辑的测试用例,确保寄存器分配一致。一个 main.c 只给变量赋值一次,然后死循环等它变化——中了!有东西改了这个值,绝不是我们的代码。GameCube 上没有多少 OS,但一定有某个中断没有清理它对 r19 的修改。我把最小复现代码发给任天堂开发者支持工程师,同时改我们的代码,避免那个函数里局部变量太多,问题就解决了。任天堂工程师承认了……

    petewarden查看英文原文

    Here's my favorite war story, from a GameCube launch title. QA discovered that if you rapidly toggled back and forth between two menus in the front end you might get a hang, though it could take 10 minutes. I was eventually able to reproduce it in the debugger, and it was bizarre. A local variable getting corrupted to strange values, but there was no memory corruption visible at all, just the register was incorrect, when it was only ever assigned to once. No matter what test cases I tried to cut the code down into, it didn't crash. Inspecting the disassembly everything seemed fine. Finally, I noticed something strange. The suspect variable was in r19, which thanks to the allocation strategy was very unusual, it was most often unused. That gave me enough of a clue to create a cut-down test case that included all the function arguments and local variables without the code, to make sure I got the same register allocation. I was able to write a single main.c that set the variable once and sat in an infinite loop waiting until it changed. Bingo! _Something_ crept in and changed that value, and it sure wasn't our code. There wasn't much of an OS on the Gamecube, but there must have been some interrupt that wasn't cleaning up its changes to r19 like it should. I sent off the minimal code to a Nintendo developer support engineer, and monkeyed with our code to avoid having so many local variables in that one function, which fixed our problem. The Nintendo engineer fessed up that it must be their issue, but then the report vanished into the Nintendo bunker, never to be seen again... Despite being a nightmare I'm glad I escaped, there were some sheer moments of coding joy in the game industry.

    工作室雇人把最终 3D 线框图 PS 成“原始手绘概念图”供媒体宣传。

    这不是编码技巧,更像是美术上的取巧:我曾在一家大型游戏工作室工作,那里有个人在不同项目间流动,职位是“逆向概念美术师”。解释一下:有些做游戏角色建模的人会跳过概念美术阶段(纸笔草图),直接进入 3D CAD。但那些粗略草图对游戏杂志或网络文章展示美术方向演进很有用。所以这个人的工作就是:把角色的最终 3D 模型以线框模式渲染出来,再在 Photoshop 里修,让它看起来像原始纸绘。效果非常可信,还作为游戏角色最初的美术草图登上了好几本杂志。

    jrbedard查看英文原文

    Not a coding trick but more of an artistic hack: I used to work at a major video game studio where one guy in the building was moving from production to production as a "reverse concept-artist" I explain: Some modelers that design characters for video game sometime skip the concept-art phase (paper pencil drawings) and move directly to 3D CAD. But those rough sketches are really good for gaming magazines or online articles to show the progression of the artistic direction. So that guy's job was to render the final 3D model of the character in wireframe mode and then re-touching it in photoshop to make it look like an original paper drawing. The result was quite convincing and appeared in several magazines as the initial artistic sketches for the game characters.

    历次讨论

    同类还值得读

    1. 开源应用架构

      The Architecture of Open Source Applications

      《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。

      编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选
    2. 编程语言简史:简短、不完整且多半错误

      A Brief, Incomplete, and Mostly Wrong History of Programming Languages

      一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。

      编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.com
    3. SQLite 是如何测试的

      How SQLite is tested

      SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…

      编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选
    4. 高级编程语言(2009)

      Advanced programming languages (2009)

      Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…

      编程与软件工程上首页 8 次 · 2009–2022matt.might.net
    5. 我的 Forth 与栈机器经历

      Yosefk - My history with Forth & stack machines

      作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。

      编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选

    打赏支持

    打赏二维码

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

    WeChat

    关注向阳乔木

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

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

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