I have seen many codes that include TODO statements. In general, TODOs should be added only in your own Git branch.
However, there are cases where it is acceptable to let TODOs in the code base. Let us see it in more details.
💡 Please keep in that this is also acceptable for both TODO
and FIXME
Advices for adding TODO and FIXME in the code
Write TODO
or FIXME
that will be merged and seen by other developers:
**// TODO:YYYY-MM-DD:feature_name_optional:<your_username>:describle what you want to do here:other details.**
Example
**// TODO:2023-07-11:9_points_calibration:Albert Oplog:Add fixation time of 2 minutes:read haizly paper before.
public int performCalibration**(){
}
When you write your TODO like this, you want sort them when you want to see the oldest or newest ones:
grep -R TODO: * | sort
Write TODO
or FIXME
just for yourself:
You can write TODO
and FIXME
for your local branch like this:
**// TODO describle what you want to do here**
Example
**//TODO Add fixation time of 2 minutes
public int performCalibration**(){
}
Remember, better have a simple attitude when coding, you will way faster.
Some good Tools you can use for TODO
or FIXME
This is a VS code plugin. According to their documentation, this extension quickly searches (using ripgrep) your workspace for comment tags like TODO and FIXME, and displays them in a tree view in the activity bar. The view can be dragged out of the activity bar into the explorer pane or anywhere else you would prefer it to be.
Todo Tree – Visual Studio Marketplace
IntelliJ IDEA lets you add special types of comments that are highlighted in the editor, indexed, and listed in the TODO tool window.