代碼小技巧:一鍵註釋

轉載自 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 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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s