Dot Net Perls

Visual Studio TODO Comments

by Sam Allen

Problem

Keep track of tasks in Visual Studio by using TODO comments. These comments can help get you more organized about your projects. You want to get the interface set up and gain a way to list your to-do items in a central place, in a way that is simple and easy to remember.

Solution: C#

TODO comments allow you to tell Visual Studio to maintain a central list of tasks, which it reads from many different places in your code. The Task List is a panel or floating window in Visual Studio that will display all the TODO comments in your project. To open the list, go to View menu -> Task List.

Some example TODO comments

You probably have a lot of code that needs a lot of work. If you don't, then you need to write code that needs a lot of work. Here are some examples of TODO lines that Visual Studio 2008 will notice and put into its special Task Pane.

//todo: fix dialog windows
//TODO: work on SQLCE guide
// Todo new screenshot

This will appear in your tasks pane as a separate task. Note that you have some flexibility with these tokens. The strings "todo", "TODO", and "TODO" all work equally well--Visual Studio's parser gives you a little bit of freedom.

What other comments can I use?

There are many different kinds of comment tokens and options. TODO comments are simply the most popular ones. Let's look at some task list options we can set in Visual Studio 2008. These steps will allow you to see all the different tokens that you can use. Go to Tools -> Options... -> Task List.

Discussion

You can go through your project and put TODO comments everywhere you need to do something. Also, there are a couple other predefined comment tokens you can use, called UNDONE and HACK. Experiment and find what suits your style the best, so you can be as productive as possible--or as productive as you want to be.

Dot Net Perls
About
Sitemap
Source code
RSS
Tools
Visual Studio Post-Build, Pre-Build Macros
Visual Studio TODO Comments
Visual Studio Settings.settings Use
Visual Studio 2008 Review
Rounded Corners Tutorial
Recent
Pi
NGEN Installer Class
List Element Equality
DateTime Tips and Tricks
Remove HTML Tags From String
© 2008 Sam Allen. All rights reserved.