Daily Dev Speedup - Commenting and Uncommenting Code Quickly

Visual Studio as well as many other applications which know what language you're using are able to do a lot of the little shortcuts for common tasks like commenting and uncommenting code. This can help speed things up a great deal since you can usually do many lines at a time. Also you don't have the context switching to go to a mouse to click the button.

CommentButtons

Instead of clicking that button just type.

[Ctrl] + K + C - Comments out code

[Ctrl] + K + U - Uncomments code

It is not the best of keyboard shortcuts, however, it lets you avoid the context switching of moving to the mouse and when commenting out multiple lines it is quite quick. This will work in code such as C# as well as with the markup of XML-based languages.

Comments