Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

comments

c#

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

See Using the Task List.


Todo comment as well.

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.

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).


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: Person's name - please fix this.

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.


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).


'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();