bling.github.io

This blog has relocated to bling.github.io.

Tuesday, September 30, 2008

A sweeeeet commenting tip

No no no...this isn't another typical post splurging about how you should comment your code, just another sweet tip I got from a good friend of mine. If you've been coding for a while you'll run into a time where you have 2 sections of code that you need to edit. However, you can only have 1 section commented, and the 2nd section uncommented, or vice versa. Even with the built-in keyboard shortcuts (Ctrl+K, Ctrl+C) and (Ctrl+K, Ctrl+U), it's still a pain in the behind. To the rescue!
/*   OR  //*
1ST SECTION OF CODE
/*/
2ND SECTION OF CODE
//*/
All you need to do is swap between /* and //* on the first line of code, and you can easily and quickly swap comments between the 2 sections of code. Very handy at times...

No comments: