02 Mar 2008

A Neat Commenting Trick

While coding, one comments and uncomments a lot while optimising and testing the code, which means adding and deleting the /* */ by hand. With the following syntax hack you only need to delete one slash to comment or uncomment a section.

/*
foo1 ();
foo2 ();
...
// */

Once you add an extra / to the /* comment block, the block gets uncommented.

//*
foo1 ();
foo2 ();
...
// */

via Ajaxian.