Commenting code is an important aspect of programming which affects the maintainability of any software product. Visual Studio provides a feature to list out all the pending tasks in the working code. For detail please go through the tip..
Suppose there is a pending code which you would like to complete after some hours/days/weeks. As a best practice in this kind of situation you should add a comment explaining that what needs to be done later. For example, if you are hard coding an employeeId and later you will fetch it from database, the comment might look like :
// employeeId is currently hard coded and will be fetched from database later.
Now imagine you have created 10 such instances of incomplete code today. Tomorrow when you will back to work you might forget some of these 10 instances of incomplete work. In order to track these kind of incomplete work Visual Studio/Visual Web Developer shows ToDo comments in TaskList.
You can define a ToDo comment by just prepending “TODO” in your comment and this is not case sensitive.
In order to show the above comment in task list we can define it in following way;
// ToDo: employeeId is currently hard coded and will be fetched from database later.
Now you can check your TaskList. Double click on any ToDo item in TaskList and it will navigate you to that line.
* In Visual Web Developer TaskList is shown in View menu list only if setting is set to “Expert Setting”.