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

前端 未结 23 2326
后悔当初
后悔当初 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:02

    '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:

    PutTheUpdateCodeHere();
    

提交回复
热议问题