Back to tree

🔓 开源软件:把菜谱贴上社区墙🔓 Open Source: the Recipe on the Community Wall

上一片里,💻小电脑的成绩单小程序通过了体检。现在它做了个大胆的决定:把源码公开。源码就是程序的“菜谱”。贴出去,别人能随便用吗?这一片讲开源。 Last leaf, 💻 Little Computer’s score app passed its checkup. Now it makes a bold move: publishing the source code. Source code is a program’s “recipe”. Once it’s posted, can anyone do anything they like with it? This leaf is about open source.

第 1 步:菜谱贴上社区墙Step 1: The recipe goes on the community wall

先看开源长什么样——源码就是菜谱,公开贴出来。First, what open source looks like — the code is the recipe, posted for everyone.

公开的菜谱:看、改、分享
源码,就是程序的菜谱:每一步怎么做,全写在里面。闭源软件只卖做好的菜,菜谱锁在厨房里。开源把菜谱贴上社区墙:谁都能看、能改、能提建议。改好的菜谱,大家一起用。 Source code is a program’s recipe: every step is written in it. Closed-source software sells only the finished dish; the recipe stays locked in the kitchen. Open source pins the recipe on the community wall: anyone can read it, change it and suggest fixes. And the improved recipe is shared by everyone.

谁都能拿菜谱,那岂不是想怎么用就怎么用?If anyone can take the recipe, can they do whatever they like with it?

第 2 步:公开 ≠ 没规矩Step 2: Open ≠ no rules

许可证:MIT 保留署名,GPL 改版也公开
不是。开源不等于没规矩,每份菜谱都挂着许可证。许可证写明:能怎么用,要守什么约定。MIT 很宽松:能用能改能卖,只要留下作者署名和许可证。GPL 讲究传下去:改版要发布,就得一起公开源码。只贴代码不挂许可证,不算开源:版权默认归作者。 No. Open doesn’t mean lawless — every open recipe carries a license. The license spells out how you may use it and what you must promise. MIT is relaxed: use it, change it, even sell it — just keep the author’s name and the license text. GPL says pass it on: release a changed version, and you must release its source too. Code posted with no license isn’t open source — copyright stays with the author by default.

陌生人改好了菜谱,怎么交回给作者?When a stranger improves the recipe, how does it get back to the author?

第 3 步:全世界一起写Step 3: The whole world writes together

复刻、修改、提交 PR、合并
在 GitHub 上,先复刻(fork)一份到自己名下,在副本上改。改好了,提交一个 PR:请作者把你的改动合并进去。维护者先审一审:测试过了、规矩守了,就合并。有问题,就退回去改。Linux、火狐浏览器、安卓系统的核心,都是开源的。你每天用的手机和网站,背后几乎都有开源代码。 On GitHub, you first fork a copy into your own account and edit the copy. When it’s ready, you open a PR (pull request): asking the author to merge your change in. The maintainer reviews it first: tests pass and rules are kept? Merge. Problems? Send it back for fixes. Linux, the Firefox browser and the core of Android are all open source. Almost every phone and website you use runs on open-source code.

🎮 你来当维护者(30 秒)🎮 Your turn: be the maintainer (30 seconds)

道理讲完了。小电脑的项目收到 4 个 PR:看清改了什么,决定合并还是退回。Theory done. Little Computer’s project got 4 PRs: check what changed, then merge it or send it back.

一句话记住它:开源 = 把源码这份菜谱公开,谁都能看、能改、能分享,但要守许可证的规矩。 Remember it in one line: open source means publishing the recipe — the source code — so anyone can read, change and share it, as long as they follow its license.
源码是程序的菜谱:开源把它公开,闭源把它锁起来Source code is the program’s recipe: open source shares it, closed source locks it away 公开 ≠ 没规矩:MIT 要留署名,GPL 改版也要公开Open ≠ no rules: MIT keeps the credit, GPL passes the openness on 复刻 → 修改 → PR → 审核合并,全世界一起写Fork → edit → PR → review and merge: the whole world writes together
内容参考 OpenStax 等公开教材,多来源核对 · AI 生成、人工审核 · 发现错误欢迎指正,帮这片叶子长得更好。 Based on OpenStax and other open textbooks, cross-checked across sources · AI-generated, human-reviewed · Spotted a mistake? Tell us — help this leaf grow.