Comment Switches

What are comment switches and how to use them? To comment and uncomment certain blocks of code repeatedly, I use what I call a "comment switch", allowing me to switch a block of code on or off with a single character. It looks like this:
//*
printf("I am active!\n");
// */
/*
printf("I am commented out!\n");
// */

Switch between two code blocks with a single character:
//*
printf ("I am active!\n");
/*/
printf ("I am commented out!\n");
// */
/*
printf("Now I am commented out!\n");
/*/
printf("And I am active!\n");
// */
Addendum:
I recently found a forum posting where a similar comment switch was proposed:
/*
comment
/* */

//*
uncomment
/* */

Comments

Popular posts from this blog

Selenium IDE Flow Control - Goto and While Loops

REST API Best Practices 4: Collections, Resources and Identifiers

REST API Best Practices 3: Partial Updates - PATCH vs PUT