不要什么都用TODO了

TODOs

Consider this:

考虑到这一点。

You’re writing code and decide to add a feature in the future.

你在写代码,决定在未来增加一个功能。

TODO.

TODO.

You’re writing code and there’s a bug.

你在写代码,有一个错误。

TODO. 

TODO.

You’re writing code and there’s something that needs to be reviewed, or refactored, or noted.

你在写代码,有一些东西需要审查,或重构,或注意。

TODO. TODO. TODO.

TODO.TODO.TODO.

It’s not that “comments are bad,” or that “you should just use an issue tracker instead.” It’s that there’s some handy, significantly more descriptive alternatives:

这并不是说 "评论不好",或者 "你应该用问题跟踪器来代替"。而是有一些方便的、描述性更强的替代品。

Term Indicates...
FIXME: something is broken
HACK/OPTIMIZE: the code is suboptimal and should be refactored
BUG: there is a bug in the code
CHECKME/REVIEW: the code needs to be reviewed
DOCME: the code needs to be documented (either in codebase or external documentation)
TESTME: the specified code needs to be tested or that tests need to be written for that selection of code
术语 表明...
修复。 某些东西坏了
HACK/OPTIMIZE: 代码是次优的,应该被重构。
BUG。 代码中存在一个错误
checkme/review: 该代码需要被审查
DOCME。 代码需要被记录下来(无论是在代码库中还是在外部文档中)。
TESTME: 指定的代码需要被测试,或者需要为该代码的选择编写测试。

But wait! All of these notes are still TODOs, but under a different name!

但是等等!所有这些笔记仍然是TODO,只是用了不同的名字而已!

Technically, yes. But the value of using a broader selection of terms is that you (and therefore all the other programmers you’re collaborating with), are able to be more descriptive about what it is precisely that you need “to do.”

从技术上讲,是的。但是,使用更广泛的术语选择的价值在于,你(以及因此与你合作的所有其他程序员),能够对你需要 "做 "的确切内容进行更多描述。

You can now filter by these more specific notes. You can even pritoritze changes based on the type of note. You can also use awesome VSCode plugins like TODO Highlight or TODO Tree to automatically highlight all of these notes.

你现在可以通过这些更具体的笔记进行过滤。你甚至可以根据笔记的类型来预测变化。你还可以使用很棒的VSCode插件,如TODO HighlightTODO Tree来自动突出所有这些笔记。

If you can’t tell, this isn’t a super serious post. You can easily describe what you want to do in myriad ways using the classic TODO and beyond.

如果你看不出来,这并不是一个超级严肃的帖子。你可以用经典的TODO及其他方式轻松地描述你想做...

开通本站会员,查看完整译文。

Accueil - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.1. UTC+08:00, 2024-11-15 12:32
浙ICP备14020137号-1 $Carte des visiteurs$