你如何标记代码以便以后可以回来并进行处理?

时间:2022-08-25 23:02:03

In C# I use the #warning and #error directives,

在C#中我使用了#warning和#error指令,

#warning This is dirty code...
#error Fix this before everything explodes!

This way, the compiler will let me know that I still have work to do. What technique do you use to mark code so you won't forget about it?

这样,编译器会让我知道我还有工作要做。您使用什么技术来标记代码,这样您就不会忘记它?

21 个解决方案

#1


80  

Mark them with // TODO, // HACK or other comment tokens that will show up in the task pane in Visual Studio.

使用// TODO,// HACK或其他注释标记标记它们,这些标记将显示在Visual Studio的任务窗格中。

See Using the Task List.

请参阅使用任务列表。

#2


26  

Todo comment as well.

Todo评论也是如此。

We've also added a special keyword NOCHECKIN, we've added a commit-hook to our source control system (very easy to do with at least cvs or svn) where it scans all files and refuses to check in the file if it finds the text NOCHECKIN anywhere.

我们还添加了一个特殊的关键字NOCHECKIN,我们在源代码控制系统中添加了一个commit-hook(很容易用至少cvs或svn),它会扫描所有文件并拒绝检查文件是否找到NOCHECKIN的文字随处可见。

This is very useful if you just want to test something out and be certain that it doesn't accidentaly gets checked in (passed the watchful eyes during the diff of everything thats commited to source control).

如果您只想测试一些内容并确保它不会被意外地检入(在提交源控制的所有内容的差异期间通过注意的眼睛),这非常有用。

#3


14  

I use a combination of //TODO: //HACK: and throw new NotImplementedException(); on my methods to denote work that was not done. Also, I add bookmarks in Visual Studio on lines that are incomplete.

我使用// TODO:// HACK的组合:并抛出新的NotImplementedException();在我的方法上表示没有完成的工作。此外,我在Visual Studio中添加不完整的书签。

#4


10  

//TODO: Person's name - please fix this.

// TODO:人的名字 - 请解决这个问题。

This is in Java, you can then look at tasks in Eclipse which will locate all references to this tag, and can group them by person so that you can assign a TODO to someone else, or only look at your own.

这是在Java中,您可以查看Eclipse中的任务,它将找到对此标记的所有引用,并可以按人员对它们进行分组,以便您可以将TODO分配给其他人,或者只查看您自己的TODO。

#5


6  

'To do' comments are great in theory, but not so good in practice, at least in my experience. If you are going to be pulled away for long enough to need them, then they tend to get forgotten.

“要做”的评论在理论上是很好的,但在实践中并不是那么好,至少在我的经验中。如果你要被拉开足够长的时间来需要它们,那么它们往往会被遗忘。

I favor Jon T's general strategy, but I usually do it by just plain breaking the code temporarily - I often insert a deliberately undefined method reference and let the compiler remind me about what I need to get back to:

我赞成Jon T的一般策略,但我通常只是暂时破坏代码 - 我经常插入一个故意未定义的方法引用,让编译器提醒我需要回到的地方:

PutTheUpdateCodeHere();

#6


6  

If I've got to drop everything in the middle of a change, then

如果我必须在改变中放弃一切,那么

#error finish this

If it's something I should do later, it goes into my bug tracker (which is used for all tasks).

如果这是我以后应该做的事情,它会进入我的bug跟踪器(用于所有任务)。

#7


5  

Add a test in a disabled state. They show up in all the build reports.

在禁用状态下添加测试。它们出现在所有构建报告中。

If that doesn't work, I file a bug.

如果这不起作用,我提交一个错误。

In particular, I haven't seen TODO comments ever decrease in quantity in any meaningful way. If I didn't have time to do it when I wrote the comment, I don't know why I'd have time later.

特别是,我没有看到TODO评论的数量有任何有意义的减少。如果我在撰写评论时没有时间这样做,我不知道为什么我以后会有时间。

#8


5  

An approach that I've really liked is "Hack Bombing", as demonstrated by Oren Eini here.

我非常喜欢的一种方法是“黑客爆炸”,正如奥伦·艾尼在这里所展示的那样。

try
{
   //do stuff
   return true;
}
catch // no idea how to prevent an exception here at the moment, this make it work for now...
{
  if (DateTime.Today > new DateTime(2007, 2, 7))
    throw new InvalidOperationException("fix me already!! no catching exceptions like this!");
  return false;
}

#9


4  

//TODO: Finish this

If you use VS you can setup your own Task Tags under Tools>Options>Environment>Task List

如果使用VS,则可以在工具>选项>环境>任务列表下设置自己的任务标签

#10


3  

gvim highlights both "// XXX" and "// TODO" in yellow, which amazed me the first time I marked some code that way to remind myself to come back to it.

gvim以黄色突出显示“// XXX”和“// TODO”,这让我第一次在标记某些代码时提醒自己回复它,这让我很惊讶。

#11


2  

I use // TODO: or // HACK: as a reminder that something is unfinished with a note explaining why. I often (read 'rarely') go back and finish those things due to time constraints. However, when I'm looking over the code I have a record of what was left uncompleted and more importantly WHY.

我使用// TODO:或// HACK:提醒一些事情未完成,并附有解释原因的说明。由于时间的限制,我经常(很少读)回去完成那些事情。但是,当我查看代码时,我会记录未完成的内容,更重要的是为什么。

One more comment I use often at the end of the day or week:

我在一天或一周结束时经常使用的另一条评论:

// START HERE CHRIS

//从这里开始CHRIS

^^^^^^^^^^^^^^^^^^^^ Tells me where I left off so I can minimize my bootstrap time on Monday morning.

^^^^^^^^^^^^^^^^^^^^告诉我我离开的地方所以我可以在周一早上最小化我的自助时间。

#12


2  

It's not a perfect world, and we don't always have infinite time to refactor or ponder the code.

这不是一个完美的世界,我们并不总是有无限的时间来重构或思考代码。

I sometimes put //REVIEW in the code if it's something I want to come back to later. i.e. code is working, but perhaps not convinced it's the best way.

我有时会在代码中添加// REVIEW,如果这是我想要稍后回来的话。即代码正在运行,但也许不相信这是最好的方法。

// REVIEW - RP - Is this the best way to achieve x? Could we use algorithm y?

Same goes for //REFACTOR

// REFACTOR也是如此

// REFACTOR - should pull this method up and remove near-dupe code in XYZ.cs

#13


1  

Todo Comment.

#14


1  

// TODO: <explanation>

if it's something that I haven't gotten around to implementing, and don't want to forget.

如果这是我没有实现的东西,并且不想忘记。

// FIXME: <explanation>

if it's something that I don't think works right, and want to come back later or have other eyes look at it.

如果这是我认为不正常的事情,并希望稍后回来或让其他人看一眼。

Never thought of the #error/#warning options. Those could come in handy too.

从未想过#error /#警告选项。这些也可以派上用场。

#15


1  

I use //FIXME: xxx for broken code, and //CHGME: xxx for code that needs attention but works (perhaps only in a limited context).

我使用// FIXME:xxx表示损坏的代码,// CHGME:xxx表示需要注意但可以工作的代码(可能只在有限的上下文中)。

#16


1  

These are the three different ways I have found helpful to flag something that needs to be addressed.

这些是我发现有助于标记需要解决的问题的三种不同方式。

  1. Place a comment flag next to the code that needs to be looked at. Most compilers can recognize common flags and display them in an organized fashion. Usually your IDE has a watch window specifically designed for these flags. The most common comment flag is: //TODO This how you would use it:

    在需要查看的代码旁边放置一个注释标记。大多数编译器可以识别常见标志并以有组织的方式显示它们。通常,您的IDE具有专门为这些标志设计的监视窗口。最常见的注释标志是:// TODO这将如何使用它:

    //TODO: Fix this before it is released. This causes an access violation because it is using memory that isn't created yet.

    // TODO:在发布之前解决此问题。这会导致访问冲突,因为它正在使用尚未创建的内存。

  2. One way to flag something that needs to be addressed before release would be to create a useless variable. Most compilers will warn you if you have a variable that isn't used. Here is how you could use this technique:

    标记在发布之前需要解决的事情的一种方法是创建无用的变量。如果您有一个未使用的变量,大多数编译器会发出警告。以下是您可以使用此技术的方法:

    int This_Is_An_Access_Violation = 0;

    int This_Is_An_Access_Violation = 0;

  3. IDE Bookmarks. Most products will come with a way to place a bookmark in your code for future reference. This is a good idea, except that it can only be seen by you. When you share your code most IDE's won't share your bookmarks. You can check the help file system of your IDE to see how to use it's bookmarking features.

    IDE书签。大多数产品都会提供一种在您的代码中放置书签以供将来参考的方法。这是一个好主意,除了它只能由你看到。当您共享代码时,大多数IDE都不会共享您的书签。您可以查看IDE的帮助文件系统,了解如何使用它的书签功能。

#17


1  

If it's some long term technical debt, you can comment like:

如果这是一些长期技术债务,你可以评论如下:

// TODO: This code loan causes an annual interest rate of 7.5% developer/hour. Upfront fee as stated by the current implementation. This contract is subject of prior authorization from the DCB (Developer's Code Bank), and tariff may change without warning.

// TODO:此代码贷款导致7.5%开发人员/小时的年利率。当前实施所述的前期费​​用。本合同受DCB(开发商代码库)的事先授权,关税可能会在没有任何警告的情况下发生变化。

... err. I guess a TODO will do it, as long as you don't simply ignore them.

... 呃。我想TODO会做到这一点,只要你不要简单地忽略它们。

#18


1  

I'm a C++ programmer, but I imagine my technique could be easily implemented in C# or any other language for that matter:

我是一名C ++程序员,但我想我的技术很容易用C#或任何其他语言实现:

I have a ToDo(msg) macro that expands into constructing a static object at local scope whose constructor outputs a log message. That way, the first time I execute unfinished code, I get a reminder in my log output that tells me that I can defer the task no longer.

我有一个ToDo(msg)宏,它扩展为在本地范围构造一个静态对象,其构造函数输出一条日志消息。这样,我第一次执行未完成的代码时,我在日志输出中收到提醒,告诉我我不能再推迟任务了。

It looks like this:

它看起来像这样:

class ToDo_helper
{
  public:
     ToDo_helper(const std::string& msg, const char* file, int line)
     {
       std::string header(79, '*');
       Log(LOG_WARNING) << header << '\n'
                        << "  TO DO:\n"
                        << "    Task:  " << msg << '\n'
                        << "    File:  " << file << '\n'
                        << "    Line:  " << line << '\n'
                        << header;
     }
};

#define TODO_HELPER_2(X, file, line) \
  static Error::ToDo_helper tdh##line(X, file, line)

#define TODO_HELPER_1(X, file, line) TODO_HELPER_2(X, file, line)
#define ToDo(X) TODO_HELPER_1(X, __FILE__, __LINE__)

... and you use it like this:

......你这样使用它:

 void some_unfinished_business() {
   ToDo("Take care of unfinished business");
 }

#19


0  

I also use TODO: comments. I understand the criticism that they rarely actually get fixed, and that they'd be better off reported as bugs. However, I think that misses a couple points:

我也使用TODO:评论。我理解他们很少得到修复的批评,并且他们会更好地报告为错误。但是,我认为错过了几点:

  • I use them most during heavy development, when I'm constantly refactoring and redesigning things. So I'm looking at them all the time. In situations like that, most of them actually do get addressed. Plus it's easy to do a search for TODO: to make sure I didn't miss anything.

    在重度开发期间,当我不断地重构和重新设计时,我最常使用它们。所以我一直在看他们。在这样的情况下,他们中的大多数确实得到解决。此外,它很容易搜索TODO:确保我没有错过任何东西。

  • It can be very helpful for people reading your code, to know the spots that you think were poorly written or hacked together. If I'm reading unfamiliar code, I tend to look for organizational patterns, naming conventions, consistent logic, etc.. If that consistency had to be violated one or two times for expediency, I'd rather see a note to that effect. That way I don't waste time trying to find logic where there is none.

    对于阅读代码的人来说,了解您认为写得不好或被黑客攻击的地点非常有用。如果我正在阅读不熟悉的代码,我倾向于寻找组织模式,命名约定,一致的逻辑等。如果为了权宜之计必须违反一次或两次一致性,我宁愿看到这种效果的注释。这样我就不会浪费时间去寻找没有的逻辑。

#20


0  

As most programmers seem to do here, I use TODO comments. Additionally, I use Eclipse's task interface Mylyn. When a task is active, Mylyn remembers all resources I have opened. This way I can track

正如大多数程序员似乎在这里做的那样,我使用了TODO评论。另外,我使用Eclipse的任务接口Mylyn。当任务处于活动状态时,Mylyn会记住我打开的所有资源。这样我就可以跟踪

  1. where in a file I have to do something (and what),
  2. 在文件中我必须做什么(以及什么),

  3. in which files I have to do it, and
  4. 我必须在哪些文件中执行此操作

  5. to what task they are related.
  6. 他们与什么相关的任务。

#21


0  

Besides keying off the "TODO:" comment, many IDE's also key off the "TASK:" comment. Some IDE's even let you configure your own special identifier.

除了剔除“TODO:”评论之外,许多IDE还关注“任务:”评论。有些IDE甚至允许您配置自己的特殊标识符。

#1


80  

Mark them with // TODO, // HACK or other comment tokens that will show up in the task pane in Visual Studio.

使用// TODO,// HACK或其他注释标记标记它们,这些标记将显示在Visual Studio的任务窗格中。

See Using the Task List.

请参阅使用任务列表。

#2


26  

Todo comment as well.

Todo评论也是如此。

We've also added a special keyword NOCHECKIN, we've added a commit-hook to our source control system (very easy to do with at least cvs or svn) where it scans all files and refuses to check in the file if it finds the text NOCHECKIN anywhere.

我们还添加了一个特殊的关键字NOCHECKIN,我们在源代码控制系统中添加了一个commit-hook(很容易用至少cvs或svn),它会扫描所有文件并拒绝检查文件是否找到NOCHECKIN的文字随处可见。

This is very useful if you just want to test something out and be certain that it doesn't accidentaly gets checked in (passed the watchful eyes during the diff of everything thats commited to source control).

如果您只想测试一些内容并确保它不会被意外地检入(在提交源控制的所有内容的差异期间通过注意的眼睛),这非常有用。

#3


14  

I use a combination of //TODO: //HACK: and throw new NotImplementedException(); on my methods to denote work that was not done. Also, I add bookmarks in Visual Studio on lines that are incomplete.

我使用// TODO:// HACK的组合:并抛出新的NotImplementedException();在我的方法上表示没有完成的工作。此外,我在Visual Studio中添加不完整的书签。

#4


10  

//TODO: Person's name - please fix this.

// TODO:人的名字 - 请解决这个问题。

This is in Java, you can then look at tasks in Eclipse which will locate all references to this tag, and can group them by person so that you can assign a TODO to someone else, or only look at your own.

这是在Java中,您可以查看Eclipse中的任务,它将找到对此标记的所有引用,并可以按人员对它们进行分组,以便您可以将TODO分配给其他人,或者只查看您自己的TODO。

#5


6  

'To do' comments are great in theory, but not so good in practice, at least in my experience. If you are going to be pulled away for long enough to need them, then they tend to get forgotten.

“要做”的评论在理论上是很好的,但在实践中并不是那么好,至少在我的经验中。如果你要被拉开足够长的时间来需要它们,那么它们往往会被遗忘。

I favor Jon T's general strategy, but I usually do it by just plain breaking the code temporarily - I often insert a deliberately undefined method reference and let the compiler remind me about what I need to get back to:

我赞成Jon T的一般策略,但我通常只是暂时破坏代码 - 我经常插入一个故意未定义的方法引用,让编译器提醒我需要回到的地方:

PutTheUpdateCodeHere();

#6


6  

If I've got to drop everything in the middle of a change, then

如果我必须在改变中放弃一切,那么

#error finish this

If it's something I should do later, it goes into my bug tracker (which is used for all tasks).

如果这是我以后应该做的事情,它会进入我的bug跟踪器(用于所有任务)。

#7


5  

Add a test in a disabled state. They show up in all the build reports.

在禁用状态下添加测试。它们出现在所有构建报告中。

If that doesn't work, I file a bug.

如果这不起作用,我提交一个错误。

In particular, I haven't seen TODO comments ever decrease in quantity in any meaningful way. If I didn't have time to do it when I wrote the comment, I don't know why I'd have time later.

特别是,我没有看到TODO评论的数量有任何有意义的减少。如果我在撰写评论时没有时间这样做,我不知道为什么我以后会有时间。

#8


5  

An approach that I've really liked is "Hack Bombing", as demonstrated by Oren Eini here.

我非常喜欢的一种方法是“黑客爆炸”,正如奥伦·艾尼在这里所展示的那样。

try
{
   //do stuff
   return true;
}
catch // no idea how to prevent an exception here at the moment, this make it work for now...
{
  if (DateTime.Today > new DateTime(2007, 2, 7))
    throw new InvalidOperationException("fix me already!! no catching exceptions like this!");
  return false;
}

#9


4  

//TODO: Finish this

If you use VS you can setup your own Task Tags under Tools>Options>Environment>Task List

如果使用VS,则可以在工具>选项>环境>任务列表下设置自己的任务标签

#10


3  

gvim highlights both "// XXX" and "// TODO" in yellow, which amazed me the first time I marked some code that way to remind myself to come back to it.

gvim以黄色突出显示“// XXX”和“// TODO”,这让我第一次在标记某些代码时提醒自己回复它,这让我很惊讶。

#11


2  

I use // TODO: or // HACK: as a reminder that something is unfinished with a note explaining why. I often (read 'rarely') go back and finish those things due to time constraints. However, when I'm looking over the code I have a record of what was left uncompleted and more importantly WHY.

我使用// TODO:或// HACK:提醒一些事情未完成,并附有解释原因的说明。由于时间的限制,我经常(很少读)回去完成那些事情。但是,当我查看代码时,我会记录未完成的内容,更重要的是为什么。

One more comment I use often at the end of the day or week:

我在一天或一周结束时经常使用的另一条评论:

// START HERE CHRIS

//从这里开始CHRIS

^^^^^^^^^^^^^^^^^^^^ Tells me where I left off so I can minimize my bootstrap time on Monday morning.

^^^^^^^^^^^^^^^^^^^^告诉我我离开的地方所以我可以在周一早上最小化我的自助时间。

#12


2  

It's not a perfect world, and we don't always have infinite time to refactor or ponder the code.

这不是一个完美的世界,我们并不总是有无限的时间来重构或思考代码。

I sometimes put //REVIEW in the code if it's something I want to come back to later. i.e. code is working, but perhaps not convinced it's the best way.

我有时会在代码中添加// REVIEW,如果这是我想要稍后回来的话。即代码正在运行,但也许不相信这是最好的方法。

// REVIEW - RP - Is this the best way to achieve x? Could we use algorithm y?

Same goes for //REFACTOR

// REFACTOR也是如此

// REFACTOR - should pull this method up and remove near-dupe code in XYZ.cs

#13


1  

Todo Comment.

#14


1  

// TODO: <explanation>

if it's something that I haven't gotten around to implementing, and don't want to forget.

如果这是我没有实现的东西,并且不想忘记。

// FIXME: <explanation>

if it's something that I don't think works right, and want to come back later or have other eyes look at it.

如果这是我认为不正常的事情,并希望稍后回来或让其他人看一眼。

Never thought of the #error/#warning options. Those could come in handy too.

从未想过#error /#警告选项。这些也可以派上用场。

#15


1  

I use //FIXME: xxx for broken code, and //CHGME: xxx for code that needs attention but works (perhaps only in a limited context).

我使用// FIXME:xxx表示损坏的代码,// CHGME:xxx表示需要注意但可以工作的代码(可能只在有限的上下文中)。

#16


1  

These are the three different ways I have found helpful to flag something that needs to be addressed.

这些是我发现有助于标记需要解决的问题的三种不同方式。

  1. Place a comment flag next to the code that needs to be looked at. Most compilers can recognize common flags and display them in an organized fashion. Usually your IDE has a watch window specifically designed for these flags. The most common comment flag is: //TODO This how you would use it:

    在需要查看的代码旁边放置一个注释标记。大多数编译器可以识别常见标志并以有组织的方式显示它们。通常,您的IDE具有专门为这些标志设计的监视窗口。最常见的注释标志是:// TODO这将如何使用它:

    //TODO: Fix this before it is released. This causes an access violation because it is using memory that isn't created yet.

    // TODO:在发布之前解决此问题。这会导致访问冲突,因为它正在使用尚未创建的内存。

  2. One way to flag something that needs to be addressed before release would be to create a useless variable. Most compilers will warn you if you have a variable that isn't used. Here is how you could use this technique:

    标记在发布之前需要解决的事情的一种方法是创建无用的变量。如果您有一个未使用的变量,大多数编译器会发出警告。以下是您可以使用此技术的方法:

    int This_Is_An_Access_Violation = 0;

    int This_Is_An_Access_Violation = 0;

  3. IDE Bookmarks. Most products will come with a way to place a bookmark in your code for future reference. This is a good idea, except that it can only be seen by you. When you share your code most IDE's won't share your bookmarks. You can check the help file system of your IDE to see how to use it's bookmarking features.

    IDE书签。大多数产品都会提供一种在您的代码中放置书签以供将来参考的方法。这是一个好主意,除了它只能由你看到。当您共享代码时,大多数IDE都不会共享您的书签。您可以查看IDE的帮助文件系统,了解如何使用它的书签功能。

#17


1  

If it's some long term technical debt, you can comment like:

如果这是一些长期技术债务,你可以评论如下:

// TODO: This code loan causes an annual interest rate of 7.5% developer/hour. Upfront fee as stated by the current implementation. This contract is subject of prior authorization from the DCB (Developer's Code Bank), and tariff may change without warning.

// TODO:此代码贷款导致7.5%开发人员/小时的年利率。当前实施所述的前期费​​用。本合同受DCB(开发商代码库)的事先授权,关税可能会在没有任何警告的情况下发生变化。

... err. I guess a TODO will do it, as long as you don't simply ignore them.

... 呃。我想TODO会做到这一点,只要你不要简单地忽略它们。

#18


1  

I'm a C++ programmer, but I imagine my technique could be easily implemented in C# or any other language for that matter:

我是一名C ++程序员,但我想我的技术很容易用C#或任何其他语言实现:

I have a ToDo(msg) macro that expands into constructing a static object at local scope whose constructor outputs a log message. That way, the first time I execute unfinished code, I get a reminder in my log output that tells me that I can defer the task no longer.

我有一个ToDo(msg)宏,它扩展为在本地范围构造一个静态对象,其构造函数输出一条日志消息。这样,我第一次执行未完成的代码时,我在日志输出中收到提醒,告诉我我不能再推迟任务了。

It looks like this:

它看起来像这样:

class ToDo_helper
{
  public:
     ToDo_helper(const std::string& msg, const char* file, int line)
     {
       std::string header(79, '*');
       Log(LOG_WARNING) << header << '\n'
                        << "  TO DO:\n"
                        << "    Task:  " << msg << '\n'
                        << "    File:  " << file << '\n'
                        << "    Line:  " << line << '\n'
                        << header;
     }
};

#define TODO_HELPER_2(X, file, line) \
  static Error::ToDo_helper tdh##line(X, file, line)

#define TODO_HELPER_1(X, file, line) TODO_HELPER_2(X, file, line)
#define ToDo(X) TODO_HELPER_1(X, __FILE__, __LINE__)

... and you use it like this:

......你这样使用它:

 void some_unfinished_business() {
   ToDo("Take care of unfinished business");
 }

#19


0  

I also use TODO: comments. I understand the criticism that they rarely actually get fixed, and that they'd be better off reported as bugs. However, I think that misses a couple points:

我也使用TODO:评论。我理解他们很少得到修复的批评,并且他们会更好地报告为错误。但是,我认为错过了几点:

  • I use them most during heavy development, when I'm constantly refactoring and redesigning things. So I'm looking at them all the time. In situations like that, most of them actually do get addressed. Plus it's easy to do a search for TODO: to make sure I didn't miss anything.

    在重度开发期间,当我不断地重构和重新设计时,我最常使用它们。所以我一直在看他们。在这样的情况下,他们中的大多数确实得到解决。此外,它很容易搜索TODO:确保我没有错过任何东西。

  • It can be very helpful for people reading your code, to know the spots that you think were poorly written or hacked together. If I'm reading unfamiliar code, I tend to look for organizational patterns, naming conventions, consistent logic, etc.. If that consistency had to be violated one or two times for expediency, I'd rather see a note to that effect. That way I don't waste time trying to find logic where there is none.

    对于阅读代码的人来说,了解您认为写得不好或被黑客攻击的地点非常有用。如果我正在阅读不熟悉的代码,我倾向于寻找组织模式,命名约定,一致的逻辑等。如果为了权宜之计必须违反一次或两次一致性,我宁愿看到这种效果的注释。这样我就不会浪费时间去寻找没有的逻辑。

#20


0  

As most programmers seem to do here, I use TODO comments. Additionally, I use Eclipse's task interface Mylyn. When a task is active, Mylyn remembers all resources I have opened. This way I can track

正如大多数程序员似乎在这里做的那样,我使用了TODO评论。另外,我使用Eclipse的任务接口Mylyn。当任务处于活动状态时,Mylyn会记住我打开的所有资源。这样我就可以跟踪

  1. where in a file I have to do something (and what),
  2. 在文件中我必须做什么(以及什么),

  3. in which files I have to do it, and
  4. 我必须在哪些文件中执行此操作

  5. to what task they are related.
  6. 他们与什么相关的任务。

#21


0  

Besides keying off the "TODO:" comment, many IDE's also key off the "TASK:" comment. Some IDE's even let you configure your own special identifier.

除了剔除“TODO:”评论之外,许多IDE还关注“任务:”评论。有些IDE甚至允许您配置自己的特殊标识符。