告诉HN:我今年学到的一件事是保持工作日志。
我曾看到一个评论建议在这里保持一个工作日志,我想说这是自从弄明白如何以及为什么要编写单元测试以来最好的建议。
每当我需要处理涉及多行代码且跨多个文件的任务时,我会在项目根目录下创建一个名为 JOURNAL 的文本文件,并记录下我计划稍后回顾的所有事项。
所有因修复一个 bug 而产生的副任务,所有我需要弄清楚其作用的稍微晦涩的部分,以及所有缺失的单元测试。然后,在这些事项都被勾选完成或转移到我所使用的 JIRA 系统之前,我不会发布拉取请求(PR)。
这解锁了两个能力——1)我可以随时关闭我的笔记本电脑,无论何时回来,我仍然记得所有未完成的、待检查的、不会破坏构建但显然是错误的事项;2)我可以打开两个各自拥有 JOURNAL 的项目,并在它们之间无痛切换。
保持写前日志以防止记忆丧失不仅适用于文件系统,也适用于思维。这真是个震惊的发现。
查看原文
I once saw a comment suggesting to keep a working journal here and I want to say it's the best thing since figuring out how and why to write unit tests.<p>Whenever I have to do something that involves more than one line in more than one file, I make another text file, called JOURNAL in the root of the project and write down all the things I plan to get back to.<p>All the side quests spawned from fixing that one bug, all the slightly obscure parts that I need to figure out what they were doing, all the missing unit tests. And then I don't publish the PR until all of them are either ticked off or transferred to whatever JIRA-hell I have.<p>I unlocks two capabilities -- 1) I can just close my laptop at any time and whenever I get back I still remember all the half-done, to be checked later, doesnt-break-the-build-but-is-obviously-wrong things. and 2) I can open two probjects each with it's own JOURNAL and switch between them without pain.<p>Keeping the write ahead log to recover from memory loss isn't only for filesystems, it's for minds too. Shocker.