Quick Tip : TODO’s in Visual Studio 2005

Visual Studio 2005 has one interesting feature: if you write TODO in a code comment(or any other token defined in Options -> Environment -> Task List) that comment will appear in the Task List pane, making this perfect a perfect way to add notes to the source code and gather them all in one place to check later.

// TODO Assign variable this later
int a = 0;

But there’s just one problem, the comments in the Task List are just the ones that appear in the file currently opened in VS 2005, making a bit difficult to track them all in larger projects. A nice workaround is explicitly define a compile warning for these TODO’s, instead of using a comment, just like this:


#warning TODO Assign variable this later
int a = 0;

This way all the TODO’s in one project can be checked in one place

Technorati Tags:

Related Posts (generated)

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Switch to our mobile site