A simple and useful trick with multi-line comments.


Cryptexo's Blog

 

1. Here is a simple example of multi-line comment we follow in most of the languages,

/*if( some conditional statements ){ ... a lot of brilliant code goes here... ...}*/

2. Many times when we need to un-comment the code block, it becomes difficult to find closing part of multi-line comment (*/) or vice a vesra.

3. Lets change above code block as following,

/*if( some conditional statements ){ ... a lot of brilliant code goes here... ...}//*/

Above cod block is now commented.

4. When you need to uncomment the block, make simple change at line 1, as following

///*if( some conditional statements ){ .... a lot of brilliant code goes here... ...}//*/

Now above code block is un-commented (will execute).

5. Using this trick one won’t have to look for (or remember) closing fragments every-time to comment or un-comment the…

View original post 52 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s