HOBALL 筆記簿

October 21, 2008

代碼小技巧:一鍵註釋

Filed under: Coding/Programming — Tags: , , , — hoball @ 12:55 pm

轉載自 http://www.cnblogs.com/biggates/archive/2008/02/28/1085216.html

書寫(和調試)大段大段的代碼的過程中,經常遇到頻繁的註釋和取消註釋的麻煩吧。今天在Ajaxian上學到一招,可以非常方便地對代碼進行註釋和取消註釋:

foo();
/**//*
bar();
baz.foo = 200;
return{
dolly:clone()
}
//
*/

簡單地說,就是把表示區塊註釋的 /* 和 */  改成  /* 和 //*/ ,代碼的修改量只有一個 // 而已。

之後,只要在 /* 的前面加上或刪除一個 / ,就能切換整塊註釋的狀態了。

foo();
//*
bar();
baz.foo
= 200;
return{
dolly:clone()
}

// */


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

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

Create a free website or blog at WordPress.com.

%d bloggers like this: