How do you flag code so that you can come back later and work on it?

前端 未结 23 2335
后悔当初
后悔当初 2020-12-24 11:46

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

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


        
23条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 12:17

    This is my list of temporary comment tags I use:

    //+TODO  Usual meaning.
    //+H     Where I was working last time.
    //+T     Temporary/test code.
    //+B     Bug.
    //+P     Performance issue.
    

    To indicate different priorities, e.g.: //+B vs //+B+++

    Advantages:

    • Easy to search-in/remove-from the code (look for //+).
    • Easy to filter on a priority basis, e.g.: search for //+B to find all bugs, search for //+B+++ to only get high priority ones.

    Can be used with C++, C#, Java, ...

    Why the //+ notation? Because the + symbol looks like a little t, for temporary.

    Note: this is not a Standard recommendation, just a personal one.

提交回复
热议问题